diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd7f384477c..29102aeb503 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.2.0" + ".": "4.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 470cb923dca..b78433dccc4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1734 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fbc6a8fce0f0e610b2737d9dc9755ab47d02a55d23152e9bdee060780a422df5.yml -openapi_spec_hash: 26c9bd123e3ac76b7c135c949c244286 -config_hash: 7e270b3449efce600e3469937a344c2d +configured_endpoints: 1749 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b15b44e0efd207de48e7e74e742b0b4b190c74f12a941a1a0ef59a51656a5224.yml +openapi_spec_hash: 83243c9ee06f88d0fa91e9b185d8a42e +config_hash: d0ab46f06dbe6f6e33d86a3ede15ac44 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4694afa4a47..88488216652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,73 @@ # Changelog +## 4.3.0 (2025-06-16) + +Full Changelog: [v4.2.0...v4.3.0](https://github.com/cloudflare/cloudflare-python/compare/v4.2.0...v4.3.0) + +### Features + +* **api:** Add IAM User Groups and AutoRAG ([1cc4487](https://github.com/cloudflare/cloudflare-python/commit/1cc44875013c4f6e1b7629469972ddd130a4c244)) +* **api:** Add new bulk deletion endpoint for ZT infra targets ([a5f7dc7](https://github.com/cloudflare/cloudflare-python/commit/a5f7dc7757ea94f17f8bed472fb7671d369ae6e1)) +* **api:** api update ([eed581b](https://github.com/cloudflare/cloudflare-python/commit/eed581b90816807ee25b70fbe028f2dd9360b50b)) +* **api:** api update ([98fee4a](https://github.com/cloudflare/cloudflare-python/commit/98fee4a2925e1894d3c87836ce63f22b0772f2d6)) +* **api:** api update ([5b9ca58](https://github.com/cloudflare/cloudflare-python/commit/5b9ca588f552a6853f607f5162fcf025e577cc07)) +* **api:** api update ([5824050](https://github.com/cloudflare/cloudflare-python/commit/5824050255ae3685193082ac8eda5e705b1246b3)) +* **api:** api update ([666946a](https://github.com/cloudflare/cloudflare-python/commit/666946a5de14a0f79fec282673b994156f4b7ad4)) +* **api:** api update ([bde7bba](https://github.com/cloudflare/cloudflare-python/commit/bde7bba347aa677babad2c52ff37183a0ccb47a1)) +* **api:** api update ([638a408](https://github.com/cloudflare/cloudflare-python/commit/638a408467ca214e6210c0760fed7f886ef33f1d)) +* **api:** api update ([e8a25d6](https://github.com/cloudflare/cloudflare-python/commit/e8a25d6857ddc301eccf70a4ff8728d2d8295d06)) +* **api:** api update ([c6a8e46](https://github.com/cloudflare/cloudflare-python/commit/c6a8e46d6ab1b59728e97ed2e14ae7ed97d943bf)) +* **api:** api update ([dcfb003](https://github.com/cloudflare/cloudflare-python/commit/dcfb0036e671ef9c492619003589a6bff1ed993a)) +* **api:** api update ([c81d4ce](https://github.com/cloudflare/cloudflare-python/commit/c81d4cefa72e8e53e51f7b1e61f4ed4d101642bb)) +* **api:** api update ([ad5aa87](https://github.com/cloudflare/cloudflare-python/commit/ad5aa879fdb1532745d8581d09ccdd3023486173)) +* **api:** api update ([f0bc6f2](https://github.com/cloudflare/cloudflare-python/commit/f0bc6f2c1cc3cc716e61fe9af0600ce263f198b2)) +* **api:** api update ([ff06097](https://github.com/cloudflare/cloudflare-python/commit/ff06097767b46ce05ce5b3fd6ce262c28338f08a)) +* **api:** api update ([3cd208b](https://github.com/cloudflare/cloudflare-python/commit/3cd208b548b9c17b512998367c6c899007bd47f7)) +* **api:** api update ([694e7bd](https://github.com/cloudflare/cloudflare-python/commit/694e7bdd1981b22ee7b0ddde79b0f2116585969a)) +* **api:** api update ([63e9021](https://github.com/cloudflare/cloudflare-python/commit/63e9021ee79001b4c44d45cd0d56bd5270dc7409)) +* **api:** api update ([784cbd8](https://github.com/cloudflare/cloudflare-python/commit/784cbd8a41b2899ea033f263795429821be9c367)) +* **api:** api update ([c73f7da](https://github.com/cloudflare/cloudflare-python/commit/c73f7da0b97f7e3010dcd3bdc7df62f86f025b1c)) +* **api:** api update ([1239774](https://github.com/cloudflare/cloudflare-python/commit/1239774eaeb2c3f7cc6fd283183ac5d16f196f22)) +* **api:** api update ([70c6acb](https://github.com/cloudflare/cloudflare-python/commit/70c6acb46d69e637339c946cd22d8cacc52a26cb)) +* **api:** api update ([f430026](https://github.com/cloudflare/cloudflare-python/commit/f430026e5b88c6291a5947847d353b01b57ef118)) +* **api:** api update ([69d5705](https://github.com/cloudflare/cloudflare-python/commit/69d570549353c3103a925843e9e48918e39e270c)) +* **api:** api update ([953ea46](https://github.com/cloudflare/cloudflare-python/commit/953ea469bc86a43620d460e94ca1fb2c7ced5d3f)) +* **api:** api update ([ef0e953](https://github.com/cloudflare/cloudflare-python/commit/ef0e95365dae02d85d8fc62c1d68d43450c883e2)) +* **api:** api update ([677bc09](https://github.com/cloudflare/cloudflare-python/commit/677bc09c92b3d955a4703d09a8efc60cd6291c09)) +* **api:** api update ([1c06a6b](https://github.com/cloudflare/cloudflare-python/commit/1c06a6b21e1813f9721a842bbf66940fd14210d4)) +* **api:** api update ([ad75922](https://github.com/cloudflare/cloudflare-python/commit/ad75922803ada5f04c2495989a5cb8d9c371abac)) +* **api:** api update ([6fa8c01](https://github.com/cloudflare/cloudflare-python/commit/6fa8c01474d353c1f83436e54224e481b1106396)) +* **api:** api update ([e0fa8ba](https://github.com/cloudflare/cloudflare-python/commit/e0fa8ba5d60f7960fb626a52c20fd3a5b05ca2cc)) +* **api:** api update ([7ec9f75](https://github.com/cloudflare/cloudflare-python/commit/7ec9f75255ac5406c76af5d477c870f97e6522d8)) +* **api:** fix account ID types ([41069fe](https://github.com/cloudflare/cloudflare-python/commit/41069fe111a574d243f63137e8e8670ca2a1b093)) +* **client:** add follow_redirects request option ([88ec221](https://github.com/cloudflare/cloudflare-python/commit/88ec22171086bd1b87514daec0df62a0dcd01012)) +* **infrastructure_targets:** swap DELETE handler to new endpoint ([eb08f59](https://github.com/cloudflare/cloudflare-python/commit/eb08f599d6788bbba580129605a31256bb1ba1df)) + + +### Bug Fixes + +* add back kv.namespaces bulk methods ([5d271a4](https://github.com/cloudflare/cloudflare-python/commit/5d271a4267343bc82c45dc60635cd28ca30ebf98)) +* add missing properties ([5777e78](https://github.com/cloudflare/cloudflare-python/commit/5777e787d63491587c4eaf512e738cf49f5e70e5)) +* **AI:** Add explicit variant names for union types ([332065c](https://github.com/cloudflare/cloudflare-python/commit/332065cd40e8809b82dc5d3c2d998d1f752546e3)) +* **api:** 'name' and 'type' are required on dns_record ([d4795c5](https://github.com/cloudflare/cloudflare-python/commit/d4795c5d22c7b8ea28c3e9c1b6dcef59ac7285c2)) +* **client:** correctly parse binary response | stream ([fceaf95](https://github.com/cloudflare/cloudflare-python/commit/fceaf952e4f834bec6dffe0c4d6a9a40952096a0)) +* **config:** Diagnostic errors ([cb5769e](https://github.com/cloudflare/cloudflare-python/commit/cb5769e1395544547519f05995636b6e6001c414)) +* **DLP:** Add explicit variant names ([490c4a7](https://github.com/cloudflare/cloudflare-python/commit/490c4a7cf1367d011e590ce7132132a96ad539ab)) +* **docs/api:** remove references to nonexistent types ([e78bbed](https://github.com/cloudflare/cloudflare-python/commit/e78bbede6d92c10cd8de5df976a14d0a9de9ed07)) +* **workers:** correctly use multipart while uploading scripts ([#2661](https://github.com/cloudflare/cloudflare-python/issues/2661)) ([756dc87](https://github.com/cloudflare/cloudflare-python/commit/756dc87dde3a42c8d4c860ff2239c920c22014ec)) + + +### Chores + +* **api:** Fix edge IPs variant names ([fa43851](https://github.com/cloudflare/cloudflare-python/commit/fa43851595ab2ce4556e292ab1009dc57a6d90cb)) +* **api:** mark some methods as deprecated ([cc53052](https://github.com/cloudflare/cloudflare-python/commit/cc53052ce07fd4ae796ba897f143bbc76c4a5fc5)) +* **docs:** remove reference to rye shell ([8781542](https://github.com/cloudflare/cloudflare-python/commit/87815427341c4418c2458d31df8c290671fbacf6)) +* **docs:** remove unnecessary param examples ([07f3fd3](https://github.com/cloudflare/cloudflare-python/commit/07f3fd366edd14d22327fa351140df6561acc777)) +* **internal:** codegen related update ([09930a5](https://github.com/cloudflare/cloudflare-python/commit/09930a5ad4c577f26c2832697b95988969d8fba8)) +* **internal:** codegen related update ([5fdf1d6](https://github.com/cloudflare/cloudflare-python/commit/5fdf1d676b8ae8d13c20fa0044432326737fbd0d)) +* **tests:** add tests for httpx client instantiation & proxies ([0291352](https://github.com/cloudflare/cloudflare-python/commit/0291352a035c150268b15424dedb9127d1833d71)) +* **tests:** run tests in parallel ([cc4533e](https://github.com/cloudflare/cloudflare-python/commit/cc4533e3550032e8eecea3140411d7ff05ff9420)) + ## 4.2.0 (2025-05-21) Full Changelog: [v4.1.0...v4.2.0](https://github.com/cloudflare/cloudflare-python/compare/v4.1.0...v4.2.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 891df768550..f6d738cea14 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,7 @@ $ rye sync --all-features You can then run scripts using `rye run python script.py` or by activating the virtual environment: ```sh -$ rye shell -# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work +# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate # now you can omit the `rye run` prefix diff --git a/README.md b/README.md index 603a1859f26..755e3162353 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,7 @@ import os from cloudflare import Cloudflare client = Cloudflare( - api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted - api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted + api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) zone = client.zones.create( @@ -53,8 +52,7 @@ import asyncio from cloudflare import AsyncCloudflare client = AsyncCloudflare( - api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted - api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted + api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) @@ -152,7 +150,7 @@ from cloudflare import Cloudflare client = Cloudflare() zone = client.zones.create( - account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, + account={}, name="example.com", ) print(zone.account) diff --git a/SECURITY.md b/SECURITY.md index 0735c892994..f04da23d126 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,3 +1,3 @@ # Reporting Security Vulnerabilities -Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks! +Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks! \ No newline at end of file diff --git a/api.md b/api.md index 84288fb94de..afec60c6f85 100644 --- a/api.md +++ b/api.md @@ -73,17 +73,13 @@ Methods: Types: ```python -from cloudflare.types.accounts import ( - SubscriptionCreateResponse, - SubscriptionUpdateResponse, - SubscriptionDeleteResponse, -) +from cloudflare.types.accounts import SubscriptionDeleteResponse ``` Methods: -- client.accounts.subscriptions.create(\*, account_id, \*\*params) -> SubscriptionCreateResponse -- client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> SubscriptionUpdateResponse +- client.accounts.subscriptions.create(\*, account_id, \*\*params) -> Subscription +- client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> Subscription - client.accounts.subscriptions.delete(subscription_identifier, \*, account_id) -> SubscriptionDeleteResponse - client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[Subscription] @@ -160,7 +156,7 @@ Methods: Types: ```python -from cloudflare.types.ips import IPs, JDCloudIPs, IPListResponse +from cloudflare.types.ips import IPs, IPListResponse ``` Methods: @@ -197,8 +193,8 @@ from cloudflare.types.user import UserEditResponse, UserGetResponse Methods: -- client.user.edit(\*\*params) -> object -- client.user.get() -> object +- client.user.edit(\*\*params) -> Optional[UserEditResponse] +- client.user.get() -> Optional[UserGetResponse] ## AuditLogs @@ -251,14 +247,14 @@ Methods: Types: ```python -from cloudflare.types.user import Organization, OrganizationDeleteResponse, OrganizationGetResponse +from cloudflare.types.user import Organization, OrganizationDeleteResponse ``` Methods: - client.user.organizations.list(\*\*params) -> SyncV4PagePaginationArray[Organization] - client.user.organizations.delete(organization_id) -> OrganizationDeleteResponse -- client.user.organizations.get(organization_id) -> object +- client.user.organizations.get(organization_id) -> object ## Subscriptions @@ -431,24 +427,6 @@ Methods: - client.zones.holds.edit(\*, zone_id, \*\*params) -> ZoneHold - client.zones.holds.get(\*, zone_id) -> ZoneHold -## Subscriptions - -Types: - -```python -from cloudflare.types.zones import ( - SubscriptionCreateResponse, - SubscriptionUpdateResponse, - SubscriptionGetResponse, -) -``` - -Methods: - -- client.zones.subscriptions.create(identifier, \*\*params) -> SubscriptionCreateResponse -- client.zones.subscriptions.update(identifier, \*\*params) -> SubscriptionUpdateResponse -- client.zones.subscriptions.get(identifier) -> SubscriptionGetResponse - ## Plans Types: @@ -724,15 +702,9 @@ Methods: ## Analyze -Types: - -```python -from cloudflare.types.ssl import AnalyzeCreateResponse -``` - Methods: -- client.ssl.analyze.create(\*, zone_id, \*\*params) -> object +- client.ssl.analyze.create(\*, zone_id, \*\*params) -> object ## CertificatePacks @@ -745,20 +717,18 @@ from cloudflare.types.ssl import ( Status, ValidationMethod, CertificatePackCreateResponse, - CertificatePackListResponse, CertificatePackDeleteResponse, CertificatePackEditResponse, - CertificatePackGetResponse, ) ``` Methods: - client.ssl.certificate_packs.create(\*, zone_id, \*\*params) -> Optional[CertificatePackCreateResponse] -- client.ssl.certificate_packs.list(\*, zone_id, \*\*params) -> SyncSinglePage[object] +- client.ssl.certificate_packs.list(\*, zone_id, \*\*params) -> SyncSinglePage[object] - client.ssl.certificate_packs.delete(certificate_pack_id, \*, zone_id) -> Optional[CertificatePackDeleteResponse] - client.ssl.certificate_packs.edit(certificate_pack_id, \*, zone_id, \*\*params) -> Optional[CertificatePackEditResponse] -- client.ssl.certificate_packs.get(certificate_pack_id, \*, zone_id) -> object +- client.ssl.certificate_packs.get(certificate_pack_id, \*, zone_id) -> object ### Quota @@ -1399,15 +1369,9 @@ Methods: ### Reclassify -Types: - -```python -from cloudflare.types.email_security.investigate import ReclassifyCreateResponse -``` - Methods: -- client.email_security.investigate.reclassify.create(postfix_id, \*, account_id, \*\*params) -> object +- client.email_security.investigate.reclassify.create(postfix_id, \*, account_id, \*\*params) -> object ### Release @@ -1764,12 +1728,12 @@ Methods: Types: ```python -from cloudflare.types.firewall.waf import PackageListResponse, PackageGetResponse +from cloudflare.types.firewall.waf import PackageGetResponse ``` Methods: -- client.firewall.waf.packages.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[object] +- client.firewall.waf.packages.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[object] - client.firewall.waf.packages.get(package_id, \*, zone_id) -> PackageGetResponse #### Groups @@ -1870,15 +1834,9 @@ Methods: ### Fields -Types: - -```python -from cloudflare.types.logpush.datasets import FieldGetResponse -``` - Methods: -- client.logpush.datasets.fields.get(dataset_id, \*, account_id, zone_id) -> object +- client.logpush.datasets.fields.get(dataset_id, \*, account_id, zone_id) -> object ### Jobs @@ -1970,13 +1928,13 @@ Methods: Types: ```python -from cloudflare.types.logs.control.cmb import CmbConfig, ConfigDeleteResponse +from cloudflare.types.logs.control.cmb import CmbConfig ``` Methods: - client.logs.control.cmb.config.create(\*, account_id, \*\*params) -> Optional[CmbConfig] -- client.logs.control.cmb.config.delete(\*, account_id) -> object +- client.logs.control.cmb.config.delete(\*, account_id) -> object - client.logs.control.cmb.config.get(\*, account_id) -> Optional[CmbConfig] ## RayID @@ -2336,20 +2294,14 @@ Methods: Types: ```python -from cloudflare.types.workers import ( - Script, - ScriptSetting, - ScriptUpdateResponse, - ScriptDeleteResponse, - ScriptGetResponse, -) +from cloudflare.types.workers import Script, ScriptSetting, ScriptUpdateResponse, ScriptGetResponse ``` Methods: - client.workers.scripts.update(script_name, \*, account_id, \*\*params) -> ScriptUpdateResponse - client.workers.scripts.list(\*, account_id) -> SyncSinglePage[Script] -- client.workers.scripts.delete(script_name, \*, account_id, \*\*params) -> object +- client.workers.scripts.delete(script_name, \*, account_id, \*\*params) -> object - client.workers.scripts.get(script_name, \*, account_id) -> str ### Assets @@ -2473,7 +2425,6 @@ Types: from cloudflare.types.workers.scripts import ( SecretUpdateResponse, SecretListResponse, - SecretDeleteResponse, SecretGetResponse, ) ``` @@ -2482,7 +2433,7 @@ 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.delete(secret_name, \*, account_id, script_name) -> object - client.workers.scripts.secrets.get(secret_name, \*, account_id, script_name) -> Optional[SecretGetResponse] ### ScriptAndVersionSettings @@ -2569,7 +2520,13 @@ Methods: Types: ```python -from cloudflare.types.kv import Namespace, NamespaceDeleteResponse +from cloudflare.types.kv import ( + Namespace, + NamespaceDeleteResponse, + NamespaceBulkDeleteResponse, + NamespaceBulkGetResponse, + NamespaceBulkUpdateResponse, +) ``` Methods: @@ -2578,6 +2535,9 @@ Methods: - client.kv.namespaces.update(namespace_id, \*, account_id, \*\*params) -> Namespace - client.kv.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Namespace] - client.kv.namespaces.delete(namespace_id, \*, account_id) -> Optional[NamespaceDeleteResponse] +- client.kv.namespaces.bulk_delete(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkDeleteResponse] +- client.kv.namespaces.bulk_get(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkGetResponse] +- client.kv.namespaces.bulk_update(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkUpdateResponse] - client.kv.namespaces.get(namespace_id, \*, account_id) -> Optional[Namespace] ### Keys @@ -2701,7 +2661,7 @@ Methods: - client.queues.messages.ack(queue_id, \*, account_id, \*\*params) -> Optional[MessageAckResponse] - client.queues.messages.bulk_push(queue_id, \*, account_id, \*\*params) -> MessageBulkPushResponse -- client.queues.messages.pull(queue_id, \*, account_id, \*\*params) -> SyncSinglePage[MessagePullResponse] +- client.queues.messages.pull(queue_id, \*, account_id, \*\*params) -> Optional[MessagePullResponse] - client.queues.messages.push(queue_id, \*, account_id, \*\*params) -> MessagePushResponse ## Purge @@ -4375,37 +4335,25 @@ Methods: Types: ```python -from cloudflare.types.pages import ( - Deployment, - Project, - Stage, - ProjectDeleteResponse, - ProjectPurgeBuildCacheResponse, -) +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.delete(project_name, \*, account_id) -> object +- 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 -- client.pages.projects.purge_build_cache(project_name, \*, account_id) -> object +- client.pages.projects.purge_build_cache(project_name, \*, account_id) -> object ### Deployments -Types: - -```python -from cloudflare.types.pages.projects import DeploymentDeleteResponse -``` - Methods: - client.pages.projects.deployments.create(project_name, \*, account_id, \*\*params) -> Deployment - client.pages.projects.deployments.list(project_name, \*, account_id, \*\*params) -> SyncSinglePage[Deployment] -- client.pages.projects.deployments.delete(deployment_id, \*, account_id, project_name) -> object +- client.pages.projects.deployments.delete(deployment_id, \*, account_id, project_name) -> object - client.pages.projects.deployments.get(deployment_id, \*, account_id, project_name) -> Deployment - client.pages.projects.deployments.retry(deployment_id, \*, account_id, project_name, \*\*params) -> Deployment - client.pages.projects.deployments.rollback(deployment_id, \*, account_id, project_name, \*\*params) -> Deployment @@ -4432,7 +4380,6 @@ Types: from cloudflare.types.pages.projects import ( DomainCreateResponse, DomainListResponse, - DomainDeleteResponse, DomainEditResponse, DomainGetResponse, ) @@ -4442,7 +4389,7 @@ Methods: - client.pages.projects.domains.create(project_name, \*, account_id, \*\*params) -> Optional[DomainCreateResponse] - client.pages.projects.domains.list(project_name, \*, account_id) -> SyncSinglePage[DomainListResponse] -- client.pages.projects.domains.delete(domain_name, \*, account_id, project_name) -> object +- client.pages.projects.domains.delete(domain_name, \*, account_id, project_name) -> object - client.pages.projects.domains.edit(domain_name, \*, account_id, project_name, \*\*params) -> Optional[DomainEditResponse] - client.pages.projects.domains.get(domain_name, \*, account_id, project_name) -> Optional[DomainGetResponse] @@ -4453,14 +4400,14 @@ Methods: Types: ```python -from cloudflare.types.registrar import Domain, DomainUpdateResponse, DomainGetResponse +from cloudflare.types.registrar import Domain ``` Methods: -- client.registrar.domains.update(domain_name, \*, account_id, \*\*params) -> object +- client.registrar.domains.update(domain_name, \*, account_id, \*\*params) -> object - client.registrar.domains.list(\*, account_id) -> SyncSinglePage[Domain] -- client.registrar.domains.get(domain_name, \*, account_id) -> object +- client.registrar.domains.get(domain_name, \*, account_id) -> object # RequestTracers @@ -4677,14 +4624,14 @@ Methods: Types: ```python -from cloudflare.types.stream import WebhookUpdateResponse, WebhookDeleteResponse, WebhookGetResponse +from cloudflare.types.stream import WebhookDeleteResponse ``` Methods: -- client.stream.webhooks.update(\*, account_id, \*\*params) -> object +- client.stream.webhooks.update(\*, account_id, \*\*params) -> object - client.stream.webhooks.delete(\*, account_id) -> str -- client.stream.webhooks.get(\*, account_id) -> object +- client.stream.webhooks.get(\*, account_id) -> object ## Captions @@ -4730,18 +4677,14 @@ Methods: Types: ```python -from cloudflare.types.stream import ( - DownloadCreateResponse, - DownloadDeleteResponse, - DownloadGetResponse, -) +from cloudflare.types.stream import DownloadDeleteResponse ``` Methods: -- client.stream.downloads.create(identifier, \*, account_id, \*\*params) -> object +- client.stream.downloads.create(identifier, \*, account_id, \*\*params) -> object - client.stream.downloads.delete(identifier, \*, account_id) -> str -- client.stream.downloads.get(identifier, \*, account_id) -> object +- client.stream.downloads.get(identifier, \*, account_id) -> object ## Embed @@ -4887,7 +4830,6 @@ Types: from cloudflare.types.d1 import ( QueryResult, DatabaseListResponse, - DatabaseDeleteResponse, DatabaseExportResponse, DatabaseImportResponse, DatabaseRawResponse, @@ -4899,7 +4841,7 @@ Methods: - client.d1.database.create(\*, account_id, \*\*params) -> D1 - client.d1.database.update(database_id, \*, account_id, \*\*params) -> D1 - client.d1.database.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DatabaseListResponse] -- client.d1.database.delete(database_id, \*, account_id) -> object +- client.d1.database.delete(database_id, \*, account_id) -> object - client.d1.database.edit(database_id, \*, account_id, \*\*params) -> D1 - client.d1.database.export(database_id, \*, account_id, \*\*params) -> DatabaseExportResponse - client.d1.database.get(database_id, \*, account_id) -> D1 @@ -4914,14 +4856,14 @@ Methods: Types: ```python -from cloudflare.types.r2 import Bucket, BucketListResponse, BucketDeleteResponse +from cloudflare.types.r2 import Bucket, BucketListResponse ``` Methods: - client.r2.buckets.create(\*, account_id, \*\*params) -> Bucket - client.r2.buckets.list(\*, account_id, \*\*params) -> BucketListResponse -- client.r2.buckets.delete(bucket_name, \*, account_id) -> object +- client.r2.buckets.delete(bucket_name, \*, account_id) -> object - client.r2.buckets.edit(bucket_name, \*, account_id) -> Bucket - client.r2.buckets.get(bucket_name, \*, account_id) -> Bucket @@ -4930,12 +4872,12 @@ Methods: Types: ```python -from cloudflare.types.r2.buckets import LifecycleUpdateResponse, LifecycleGetResponse +from cloudflare.types.r2.buckets import LifecycleGetResponse ``` Methods: -- client.r2.buckets.lifecycle.update(bucket_name, \*, account_id, \*\*params) -> object +- client.r2.buckets.lifecycle.update(bucket_name, \*, account_id, \*\*params) -> object - client.r2.buckets.lifecycle.get(bucket_name, \*, account_id) -> LifecycleGetResponse ### CORS @@ -4943,13 +4885,13 @@ Methods: Types: ```python -from cloudflare.types.r2.buckets import CORSUpdateResponse, CORSDeleteResponse, CORSGetResponse +from cloudflare.types.r2.buckets import CORSGetResponse ``` Methods: -- client.r2.buckets.cors.update(bucket_name, \*, account_id, \*\*params) -> object -- client.r2.buckets.cors.delete(bucket_name, \*, account_id) -> object +- client.r2.buckets.cors.update(bucket_name, \*, account_id, \*\*params) -> object +- client.r2.buckets.cors.delete(bucket_name, \*, account_id) -> object - client.r2.buckets.cors.get(bucket_name, \*, account_id) -> CORSGetResponse ### Domains @@ -4994,19 +4936,14 @@ Methods: Types: ```python -from cloudflare.types.r2.buckets import ( - EventNotificationUpdateResponse, - EventNotificationListResponse, - EventNotificationDeleteResponse, - EventNotificationGetResponse, -) +from cloudflare.types.r2.buckets import EventNotificationListResponse, EventNotificationGetResponse ``` Methods: -- client.r2.buckets.event_notifications.update(queue_id, \*, account_id, bucket_name, \*\*params) -> object +- client.r2.buckets.event_notifications.update(queue_id, \*, account_id, bucket_name, \*\*params) -> object - client.r2.buckets.event_notifications.list(bucket_name, \*, account_id) -> EventNotificationListResponse -- client.r2.buckets.event_notifications.delete(queue_id, \*, account_id, bucket_name) -> object +- client.r2.buckets.event_notifications.delete(queue_id, \*, account_id, bucket_name) -> object - client.r2.buckets.event_notifications.get(queue_id, \*, account_id, bucket_name) -> EventNotificationGetResponse ### Locks @@ -5014,12 +4951,12 @@ Methods: Types: ```python -from cloudflare.types.r2.buckets import LockUpdateResponse, LockGetResponse +from cloudflare.types.r2.buckets import LockGetResponse ``` Methods: -- client.r2.buckets.locks.update(bucket_name, \*, account_id, \*\*params) -> object +- client.r2.buckets.locks.update(bucket_name, \*, account_id, \*\*params) -> object - client.r2.buckets.locks.get(bucket_name, \*, account_id) -> LockGetResponse ### Metrics @@ -5130,7 +5067,6 @@ Types: from cloudflare.types.workers_for_platforms.dispatch import ( NamespaceCreateResponse, NamespaceListResponse, - NamespaceDeleteResponse, NamespaceGetResponse, ) ``` @@ -5139,7 +5075,7 @@ Methods: - client.workers_for_platforms.dispatch.namespaces.create(\*, account_id, \*\*params) -> Optional[NamespaceCreateResponse] - client.workers_for_platforms.dispatch.namespaces.list(\*, account_id) -> SyncSinglePage[NamespaceListResponse] -- client.workers_for_platforms.dispatch.namespaces.delete(dispatch_namespace, \*, account_id) -> object +- client.workers_for_platforms.dispatch.namespaces.delete(dispatch_namespace, \*, account_id) -> object - client.workers_for_platforms.dispatch.namespaces.get(dispatch_namespace, \*, account_id) -> Optional[NamespaceGetResponse] #### Scripts @@ -5147,17 +5083,13 @@ Methods: Types: ```python -from cloudflare.types.workers_for_platforms.dispatch.namespaces import ( - Script, - ScriptUpdateResponse, - ScriptDeleteResponse, -) +from cloudflare.types.workers_for_platforms.dispatch.namespaces import Script, ScriptUpdateResponse ``` Methods: - client.workers_for_platforms.dispatch.namespaces.scripts.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> ScriptUpdateResponse -- client.workers_for_platforms.dispatch.namespaces.scripts.delete(script_name, \*, account_id, dispatch_namespace, \*\*params) -> object +- client.workers_for_platforms.dispatch.namespaces.scripts.delete(script_name, \*, account_id, dispatch_namespace, \*\*params) -> object - client.workers_for_platforms.dispatch.namespaces.scripts.get(script_name, \*, account_id, dispatch_namespace) -> Script ##### AssetUpload @@ -5217,7 +5149,6 @@ Types: from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( SecretUpdateResponse, SecretListResponse, - SecretDeleteResponse, SecretGetResponse, ) ``` @@ -5226,7 +5157,7 @@ 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.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 ##### Tags @@ -5237,7 +5168,6 @@ Types: from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( TagUpdateResponse, TagListResponse, - TagDeleteResponse, ) ``` @@ -5245,7 +5175,7 @@ Methods: - client.workers_for_platforms.dispatch.namespaces.scripts.tags.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SyncSinglePage[TagUpdateResponse] - client.workers_for_platforms.dispatch.namespaces.scripts.tags.list(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[TagListResponse] -- client.workers_for_platforms.dispatch.namespaces.scripts.tags.delete(tag, \*, account_id, dispatch_namespace, script_name) -> object +- client.workers_for_platforms.dispatch.namespaces.scripts.tags.delete(tag, \*, account_id, dispatch_namespace, script_name) -> object # ZeroTrust @@ -5267,20 +5197,15 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.devices import ( - DeviceListResponse, - DeviceDeleteResponse, - DeviceGetResponse, - DeviceRevokeResponse, -) +from cloudflare.types.zero_trust.devices import DeviceListResponse, DeviceGetResponse ``` 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.delete(device_id, \*, account_id) -> object - client.zero*trust.devices.devices.get(device_id, \*, account_id) -> DeviceGetResponse -- client.zero*trust.devices.devices.revoke(device_id, \*, account_id) -> object +- client.zero*trust.devices.devices.revoke(device_id, \*, account_id) -> object ### Resilience @@ -5305,33 +5230,42 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.devices import ( - RegistrationListResponse, - RegistrationDeleteResponse, - RegistrationBulkDeleteResponse, - RegistrationGetResponse, - RegistrationRevokeResponse, - RegistrationUnrevokeResponse, -) +from cloudflare.types.zero_trust.devices import RegistrationListResponse, RegistrationGetResponse ``` 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.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.revoke(\*, account_id, \*\*params) -> object -- client.zero_trust.devices.registrations.unrevoke(\*, account_id, \*\*params) -> object +- client.zero_trust.devices.registrations.revoke(\*, account_id, \*\*params) -> object +- client.zero_trust.devices.registrations.unrevoke(\*, account_id, \*\*params) -> object ### DEXTests Types: ```python -from cloudflare.types.zero_trust.devices import SchemaData, SchemaHTTP +from cloudflare.types.zero_trust.devices import ( + SchemaData, + SchemaHTTP, + DEXTestCreateResponse, + DEXTestUpdateResponse, + DEXTestListResponse, + DEXTestDeleteResponse, + DEXTestGetResponse, +) ``` +Methods: + +- client.zero_trust.devices.dex_tests.create(\*, account_id, \*\*params) -> Optional[DEXTestCreateResponse] +- client.zero_trust.devices.dex_tests.update(dex_test_id, \*, account_id, \*\*params) -> Optional[DEXTestUpdateResponse] +- client.zero_trust.devices.dex_tests.list(\*, account_id) -> SyncSinglePage[DEXTestListResponse] +- client.zero_trust.devices.dex_tests.delete(dex_test_id, \*, account_id) -> Optional[DEXTestDeleteResponse] +- client.zero_trust.devices.dex_tests.get(dex_test_id, \*, account_id) -> Optional[DEXTestGetResponse] + ### Networks Types: @@ -5522,6 +5456,7 @@ from cloudflare.types.zero_trust.devices import DeviceSettings Methods: - client.zero_trust.devices.settings.update(\*, account_id, \*\*params) -> Optional[DeviceSettings] +- client.zero_trust.devices.settings.delete(\*, account_id) -> Optional[DeviceSettings] - client.zero_trust.devices.settings.edit(\*, account_id, \*\*params) -> Optional[DeviceSettings] - client.zero_trust.devices.settings.get(\*, account_id) -> Optional[DeviceSettings] @@ -5542,12 +5477,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.devices import OverrideCodeListResponse, OverrideCodeGetResponse +from cloudflare.types.zero_trust.devices import OverrideCodeGetResponse ``` Methods: -- client.zero_trust.devices.override_codes.list(device_id, \*, account_id) -> SyncSinglePage[object] +- client.zero_trust.devices.override_codes.list(device_id, \*, account_id) -> SyncSinglePage[object] - client.zero_trust.devices.override_codes.get(registration_id, \*, account_id) -> OverrideCodeGetResponse ## IdentityProviders @@ -5671,6 +5606,7 @@ Methods: - client.zero_trust.access.infrastructure.targets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TargetListResponse] - client.zero_trust.access.infrastructure.targets.delete(target_id, \*, account_id) -> None - client.zero_trust.access.infrastructure.targets.bulk_delete(\*, account_id) -> None +- client.zero_trust.access.infrastructure.targets.bulk_delete_v2(\*, account_id, \*\*params) -> None - client.zero_trust.access.infrastructure.targets.bulk_update(\*, account_id, \*\*params) -> SyncSinglePage[TargetBulkUpdateResponse] - client.zero_trust.access.infrastructure.targets.get(target_id, \*, account_id) -> Optional[TargetGetResponse] @@ -5704,7 +5640,6 @@ from cloudflare.types.zero_trust.access import ( ApplicationListResponse, ApplicationDeleteResponse, ApplicationGetResponse, - ApplicationRevokeTokensResponse, ) ``` @@ -5715,7 +5650,7 @@ Methods: - client.zero_trust.access.applications.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[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 +- client.zero_trust.access.applications.revoke_tokens(app_id, \*, account_id, zone_id) -> object #### CAs @@ -6100,6 +6035,18 @@ from cloudflare.types.zero_trust import ( ) ``` +### WARPChangeEvents + +Types: + +```python +from cloudflare.types.zero_trust.dex import WARPChangeEventGetResponse +``` + +Methods: + +- client.zero_trust.dex.warp_change_events.get(\*, account_id, \*\*params) -> Optional[WARPChangeEventGetResponse] + ### Commands Types: @@ -6145,15 +6092,9 @@ Methods: ### Colos -Types: - -```python -from cloudflare.types.zero_trust.dex import ColoListResponse -``` - Methods: -- client.zero_trust.dex.colos.list(\*, account_id, \*\*params) -> SyncSinglePage[object] +- client.zero_trust.dex.colos.list(\*, account_id, \*\*params) -> SyncSinglePage[object] ### FleetStatus @@ -6311,12 +6252,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.tunnels.cloudflared import Client, ConnectionDeleteResponse +from cloudflare.types.zero_trust.tunnels.cloudflared import Client ``` Methods: -- client.zero_trust.tunnels.cloudflared.connections.delete(tunnel_id, \*, account_id, \*\*params) -> object +- client.zero_trust.tunnels.cloudflared.connections.delete(tunnel_id, \*, account_id, \*\*params) -> object - client.zero_trust.tunnels.cloudflared.connections.get(tunnel_id, \*, account_id) -> SyncSinglePage[Client] #### Token @@ -6539,19 +6480,14 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.dlp.profiles import ( - CustomProfile, - Pattern, - CustomCreateResponse, - CustomDeleteResponse, -) +from cloudflare.types.zero_trust.dlp.profiles import CustomProfile, Pattern ``` Methods: -- client.zero_trust.dlp.profiles.custom.create(\*, account_id, \*\*params) -> Optional[CustomCreateResponse] +- client.zero_trust.dlp.profiles.custom.create(\*, account_id, \*\*params) -> Optional[Profile] - client.zero_trust.dlp.profiles.custom.update(profile_id, \*, account_id, \*\*params) -> Optional[Profile] -- client.zero_trust.dlp.profiles.custom.delete(profile_id, \*, account_id) -> object +- client.zero_trust.dlp.profiles.custom.delete(profile_id, \*, account_id) -> object - client.zero_trust.dlp.profiles.custom.get(profile_id, \*, account_id) -> Optional[Profile] #### Predefined @@ -6588,7 +6524,6 @@ from cloudflare.types.zero_trust.dlp import ( EntryCreateResponse, EntryUpdateResponse, EntryListResponse, - EntryDeleteResponse, EntryGetResponse, ) ``` @@ -6598,7 +6533,7 @@ 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.delete(entry_id, \*, account_id) -> object - client.zero_trust.dlp.entries.get(entry_id, \*, account_id) -> Optional[EntryGetResponse] ## Gateway @@ -6693,12 +6628,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.gateway import ( - GatewayItem, - GatewayList, - ListCreateResponse, - ListDeleteResponse, -) +from cloudflare.types.zero_trust.gateway import GatewayItem, GatewayList, ListCreateResponse ``` Methods: @@ -6706,7 +6636,7 @@ Methods: - client.zero_trust.gateway.lists.create(\*, account_id, \*\*params) -> Optional[ListCreateResponse] - client.zero_trust.gateway.lists.update(list_id, \*, account_id, \*\*params) -> Optional[GatewayList] - client.zero_trust.gateway.lists.list(\*, account_id, \*\*params) -> SyncSinglePage[GatewayList] -- client.zero_trust.gateway.lists.delete(list_id, \*, account_id) -> object +- client.zero_trust.gateway.lists.delete(list_id, \*, account_id) -> object - client.zero_trust.gateway.lists.edit(list_id, \*, account_id, \*\*params) -> Optional[GatewayList] - client.zero_trust.gateway.lists.get(list_id, \*, account_id) -> Optional[GatewayList] @@ -6736,7 +6666,6 @@ from cloudflare.types.zero_trust.gateway import ( IPV6Endpoint, IPV6Network, Location, - LocationDeleteResponse, ) ``` @@ -6745,7 +6674,7 @@ Methods: - client.zero_trust.gateway.locations.create(\*, account_id, \*\*params) -> Optional[Location] - client.zero_trust.gateway.locations.update(location_id, \*, account_id, \*\*params) -> Optional[Location] - client.zero_trust.gateway.locations.list(\*, account_id) -> SyncSinglePage[Location] -- client.zero_trust.gateway.locations.delete(location_id, \*, account_id) -> object +- client.zero_trust.gateway.locations.delete(location_id, \*, account_id) -> object - client.zero_trust.gateway.locations.get(location_id, \*, account_id) -> Optional[Location] ### Logging @@ -6766,18 +6695,14 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.gateway import ( - GatewayIPs, - ProxyEndpoint, - ProxyEndpointDeleteResponse, -) +from cloudflare.types.zero_trust.gateway import GatewayIPs, ProxyEndpoint ``` Methods: - client.zero_trust.gateway.proxy_endpoints.create(\*, account_id, \*\*params) -> Optional[ProxyEndpoint] - client.zero_trust.gateway.proxy_endpoints.list(\*, account_id) -> Optional[ProxyEndpoint] -- client.zero_trust.gateway.proxy_endpoints.delete(proxy_endpoint_id, \*, account_id) -> object +- client.zero_trust.gateway.proxy_endpoints.delete(proxy_endpoint_id, \*, account_id) -> object - client.zero_trust.gateway.proxy_endpoints.edit(proxy_endpoint_id, \*, account_id, \*\*params) -> Optional[ProxyEndpoint] - client.zero_trust.gateway.proxy_endpoints.get(proxy_endpoint_id, \*, account_id) -> SyncSinglePage[ProxyEndpoint] @@ -6793,7 +6718,6 @@ from cloudflare.types.zero_trust.gateway import ( GatewayRule, RuleSetting, Schedule, - RuleDeleteResponse, ) ``` @@ -6802,7 +6726,7 @@ Methods: - client.zero_trust.gateway.rules.create(\*, account_id, \*\*params) -> Optional[GatewayRule] - client.zero_trust.gateway.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[GatewayRule] - 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.delete(rule_id, \*, account_id) -> object - client.zero_trust.gateway.rules.get(rule_id, \*, account_id) -> Optional[GatewayRule] - client.zero_trust.gateway.rules.reset_expiration(rule_id, \*, account_id) -> Optional[GatewayRule] @@ -6907,13 +6831,13 @@ Methods: Types: ```python -from cloudflare.types.zero_trust import RiskScoringGetResponse, RiskScoringResetResponse +from cloudflare.types.zero_trust import RiskScoringGetResponse ``` Methods: - client.zero_trust.risk_scoring.get(user_id, \*, account_id) -> Optional[RiskScoringGetResponse] -- client.zero_trust.risk_scoring.reset(user_id, \*, account_id) -> object +- client.zero_trust.risk_scoring.reset(user_id, \*, account_id) -> object ### Behaviours @@ -6949,7 +6873,6 @@ from cloudflare.types.zero_trust.risk_scoring import ( IntegrationCreateResponse, IntegrationUpdateResponse, IntegrationListResponse, - IntegrationDeleteResponse, IntegrationGetResponse, ) ``` @@ -6959,7 +6882,7 @@ Methods: - client.zero_trust.risk_scoring.integrations.create(\*, account_id, \*\*params) -> Optional[IntegrationCreateResponse] - client.zero_trust.risk_scoring.integrations.update(integration_id, \*, account_id, \*\*params) -> Optional[IntegrationUpdateResponse] - client.zero_trust.risk_scoring.integrations.list(\*, account_id) -> SyncSinglePage[IntegrationListResponse] -- client.zero_trust.risk_scoring.integrations.delete(integration_id, \*, account_id) -> object +- client.zero_trust.risk_scoring.integrations.delete(integration_id, \*, account_id) -> object - client.zero_trust.risk_scoring.integrations.get(integration_id, \*, account_id) -> Optional[IntegrationGetResponse] #### References @@ -7003,18 +6926,12 @@ from cloudflare.types.hyperdrive import Configuration, Hyperdrive ## Configs -Types: - -```python -from cloudflare.types.hyperdrive import ConfigDeleteResponse -``` - Methods: - client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Hyperdrive - client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive - client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[Hyperdrive] -- client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> object +- client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> object - client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive - client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Hyperdrive @@ -7073,7 +6990,6 @@ from cloudflare.types.vectorize import ( IndexUpsert, IndexDeleteResponse, IndexDeleteByIDsResponse, - IndexGetByIDsResponse, IndexInfoResponse, IndexInsertResponse, IndexQueryResponse, @@ -7088,7 +7004,7 @@ Methods: - client.vectorize.indexes.delete(index_name, \*, account_id) -> Optional[IndexDeleteResponse] - client.vectorize.indexes.delete_by_ids(index_name, \*, account_id, \*\*params) -> Optional[IndexDeleteByIDsResponse] - client.vectorize.indexes.get(index_name, \*, account_id) -> Optional[CreateIndex] -- client.vectorize.indexes.get_by_ids(index_name, \*, account_id, \*\*params) -> object +- 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.query(index_name, \*, account_id, \*\*params) -> Optional[IndexQueryResponse] @@ -8820,7 +8736,6 @@ Types: from cloudflare.types.cloudforce_one.scans import ( ConfigCreateResponse, ConfigListResponse, - ConfigDeleteResponse, ConfigEditResponse, ) ``` @@ -8829,7 +8744,7 @@ Methods: - client.cloudforce_one.scans.config.create(\*, account_id, \*\*params) -> Optional[ConfigCreateResponse] - client.cloudforce_one.scans.config.list(\*, account_id) -> SyncSinglePage[ConfigListResponse] -- client.cloudforce_one.scans.config.delete(config_id, \*, account_id) -> object +- client.cloudforce_one.scans.config.delete(config_id, \*, account_id) -> object - client.cloudforce_one.scans.config.edit(config_id, \*, account_id, \*\*params) -> Optional[ConfigEditResponse] ## Requests @@ -9014,11 +8929,23 @@ from cloudflare.types.cloudforce_one.threat_events import ( Methods: -- client.cloudforce_one.threat_events.datasets.create(\*, account_id, \*\*params) -> DatasetCreateResponse -- client.cloudforce_one.threat_events.datasets.list(\*, account_id) -> DatasetListResponse -- client.cloudforce_one.threat_events.datasets.edit(dataset_id, \*, account_id, \*\*params) -> DatasetEditResponse -- 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 +- client.cloudforce_one.threat_events.datasets.create(\*, account_id, \*\*params) -> DatasetCreateResponse +- client.cloudforce_one.threat_events.datasets.list(\*, account_id) -> DatasetListResponse +- client.cloudforce_one.threat_events.datasets.edit(dataset_id, \*, account_id, \*\*params) -> DatasetEditResponse +- 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 @@ -9156,24 +9083,17 @@ Methods: Types: ```python -from cloudflare.types.ai_gateway import ( - LogListResponse, - LogDeleteResponse, - LogEditResponse, - LogGetResponse, - LogRequestResponse, - LogResponseResponse, -) +from cloudflare.types.ai_gateway import LogListResponse, LogDeleteResponse, LogGetResponse ``` Methods: - client.ai_gateway.logs.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[LogListResponse] - client.ai_gateway.logs.delete(gateway_id, \*, account_id, \*\*params) -> LogDeleteResponse -- client.ai_gateway.logs.edit(id, \*, account_id, gateway_id, \*\*params) -> object +- client.ai_gateway.logs.edit(id, \*, account_id, gateway_id, \*\*params) -> object - client.ai_gateway.logs.get(id, \*, account_id, gateway_id) -> LogGetResponse -- client.ai_gateway.logs.request(id, \*, account_id, gateway_id) -> object -- client.ai_gateway.logs.response(id, \*, account_id, gateway_id) -> object +- client.ai_gateway.logs.request(id, \*, account_id, gateway_id) -> object +- client.ai_gateway.logs.response(id, \*, account_id, gateway_id) -> object ## Datasets @@ -9266,6 +9186,48 @@ Methods: - client.iam.resource_groups.delete(resource_group_id, \*, account_id) -> Optional[ResourceGroupDeleteResponse] - client.iam.resource_groups.get(resource_group_id, \*, account_id) -> ResourceGroupGetResponse +## UserGroups + +Types: + +```python +from cloudflare.types.iam import ( + UserGroupCreateResponse, + UserGroupUpdateResponse, + UserGroupListResponse, + UserGroupDeleteResponse, + UserGroupGetResponse, +) +``` + +Methods: + +- client.iam.user_groups.create(\*, account_id, \*\*params) -> Optional[UserGroupCreateResponse] +- client.iam.user_groups.update(user_group_id, \*, account_id, \*\*params) -> Optional[UserGroupUpdateResponse] +- client.iam.user_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserGroupListResponse] +- client.iam.user_groups.delete(user_group_id, \*, account_id) -> Optional[UserGroupDeleteResponse] +- client.iam.user_groups.get(user_group_id, \*, account_id) -> Optional[UserGroupGetResponse] + +### Members + +Types: + +```python +from cloudflare.types.iam.user_groups import ( + MemberCreateResponse, + MemberUpdateResponse, + MemberListResponse, + MemberDeleteResponse, +) +``` + +Methods: + +- client.iam.user_groups.members.create(user_group_id, \*, account_id, \*\*params) -> Optional[MemberCreateResponse] +- client.iam.user_groups.members.update(user_group_id, \*, account_id, \*\*params) -> SyncSinglePage[MemberUpdateResponse] +- client.iam.user_groups.members.list(user_group_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[MemberListResponse] +- client.iam.user_groups.members.delete(member_id, \*, account_id, user_group_id) -> Optional[MemberDeleteResponse] + # CloudConnector ## Rules @@ -9383,15 +9345,9 @@ Methods: ### Events -Types: - -```python -from cloudflare.types.workflows.instances import EventCreateResponse -``` - Methods: -- client.workflows.instances.events.create(event_type, \*, account_id, workflow_name, instance_id, \*\*params) -> object +- client.workflows.instances.events.create(event_type, \*, account_id, workflow_name, instance_id, \*\*params) -> object ## Versions @@ -9495,7 +9451,6 @@ from cloudflare.types.leaked_credential_checks import ( DetectionCreateResponse, DetectionUpdateResponse, DetectionListResponse, - DetectionDeleteResponse, ) ``` @@ -9504,23 +9459,14 @@ Methods: - client.leaked_credential_checks.detections.create(\*, zone_id, \*\*params) -> DetectionCreateResponse - client.leaked_credential_checks.detections.update(detection_id, \*, zone_id, \*\*params) -> DetectionUpdateResponse - client.leaked_credential_checks.detections.list(\*, zone_id) -> SyncSinglePage[DetectionListResponse] -- client.leaked_credential_checks.detections.delete(detection_id, \*, zone_id) -> object +- client.leaked_credential_checks.detections.delete(detection_id, \*, zone_id) -> object # ContentScanning -Types: - -```python -from cloudflare.types.content_scanning import ( - ContentScanningDisableResponse, - ContentScanningEnableResponse, -) -``` - Methods: -- client.content_scanning.disable(\*, zone_id) -> object -- client.content_scanning.enable(\*, zone_id) -> object +- client.content_scanning.disable(\*, zone_id) -> object +- client.content_scanning.enable(\*, zone_id) -> object ## Payloads @@ -9615,51 +9561,27 @@ Methods: ## Authors -Types: - -```python -from cloudflare.types.ai import AuthorListResponse -``` - Methods: -- client.ai.authors.list(\*, account_id) -> SyncSinglePage[object] +- client.ai.authors.list(\*, account_id) -> SyncSinglePage[object] ## Tasks -Types: - -```python -from cloudflare.types.ai import TaskListResponse -``` - Methods: -- client.ai.tasks.list(\*, account_id) -> SyncSinglePage[object] +- client.ai.tasks.list(\*, account_id) -> SyncSinglePage[object] ## Models -Types: - -```python -from cloudflare.types.ai import ModelListResponse -``` - Methods: -- client.ai.models.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object] +- client.ai.models.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object] ### Schema -Types: - -```python -from cloudflare.types.ai.models import SchemaGetResponse -``` - Methods: -- client.ai.models.schema.get(\*, account_id, \*\*params) -> object +- client.ai.models.schema.get(\*, account_id, \*\*params) -> object # SecurityCenter @@ -9809,17 +9731,13 @@ Methods: Types: ```python -from cloudflare.types.custom_pages import ( - CustomPageUpdateResponse, - CustomPageListResponse, - CustomPageGetResponse, -) +from cloudflare.types.custom_pages import CustomPageUpdateResponse, 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[object] - client.custom_pages.get(identifier, \*, account_id, zone_id) -> Optional[CustomPageGetResponse] # SecretsStore diff --git a/examples/workers/script_upload.py b/examples/workers/script_upload.py index f6b7fd64efc..2343e0e33d2 100644 --- a/examples/workers/script_upload.py +++ b/examples/workers/script_upload.py @@ -25,7 +25,6 @@ """ import os -import json from cloudflare import Cloudflare, BadRequestError @@ -88,7 +87,7 @@ def main() -> None: }, ) print("Script Upload success!") - print(json.dumps(script, indent=2)) + print(script.to_json(indent=2)) except BadRequestError as err: print("Script Upload failure!") print(err) diff --git a/pyproject.toml b/pyproject.toml index 4b50076ca14..857f3da92b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cloudflare" -version = "4.2.0" +version = "4.3.0" description = "The official Python library for the cloudflare API" dynamic = ["readme"] license = "Apache-2.0" @@ -54,6 +54,7 @@ dev-dependencies = [ "importlib-metadata>=6.7.0", "rich>=13.7.1", "nest_asyncio==1.6.0", + "pytest-xdist>=3.6.1", ] [tool.rye.scripts] @@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/cloudflare/cloudflare-python/tree/main/\g [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "--tb=short" +addopts = "--tb=short -n auto" xfail_strict = true asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" diff --git a/requirements-dev.lock b/requirements-dev.lock index 0e7026b775d..d30c3e08170 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -30,6 +30,8 @@ distro==1.8.0 exceptiongroup==1.2.2 # via anyio # via pytest +execnet==2.1.1 + # via pytest-xdist filelock==3.12.4 # via virtualenv h11==0.14.0 @@ -72,7 +74,9 @@ pygments==2.18.0 pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio + # via pytest-xdist pytest-asyncio==0.24.0 +pytest-xdist==3.7.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py index 912a4de8ebb..d6d981cb568 100644 --- a/src/cloudflare/_base_client.py +++ b/src/cloudflare/_base_client.py @@ -1002,6 +1002,9 @@ def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None @@ -1110,7 +1113,14 @@ def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, APIResponse): raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") @@ -1504,6 +1514,9 @@ async def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None @@ -1612,7 +1625,14 @@ async def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, AsyncAPIResponse): raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") diff --git a/src/cloudflare/_models.py b/src/cloudflare/_models.py index 669f6bcc00b..7bf82bb0bde 100644 --- a/src/cloudflare/_models.py +++ b/src/cloudflare/_models.py @@ -739,6 +739,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): json_data: Body extra_json: AnyMapping multipart_syntax: MultipartSyntax + follow_redirects: bool @final @@ -753,6 +754,7 @@ class FinalRequestOptions(pydantic.BaseModel): idempotency_key: Union[str, None] = None multipart_syntax: Union[MultipartSyntax, None] = None post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() + follow_redirects: Union[bool, None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. diff --git a/src/cloudflare/_types.py b/src/cloudflare/_types.py index 81cd5757e17..1d0b53f5ab8 100644 --- a/src/cloudflare/_types.py +++ b/src/cloudflare/_types.py @@ -103,6 +103,7 @@ class RequestOptions(TypedDict, total=False): extra_json: AnyMapping idempotency_key: str multipart_syntax: MultipartSyntax + follow_redirects: bool # Sentinel class used until PEP 0661 is accepted @@ -218,3 +219,4 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth + follow_redirects: bool diff --git a/src/cloudflare/_version.py b/src/cloudflare/_version.py index 1013e2ad416..4f0b5539ef2 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.2.0" # x-release-please-version +__version__ = "4.3.0" # x-release-please-version diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py index 2ee703b9f22..aa9779c2552 100644 --- a/src/cloudflare/resources/accounts/accounts.py +++ b/src/cloudflare/resources/accounts/accounts.py @@ -165,6 +165,7 @@ def update( self, *, account_id: str, + id: str, name: str, settings: account_update_params.Settings | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -180,6 +181,8 @@ def update( Args: account_id: Account identifier tag. + id: Identifier + name: Account name settings: Account settings @@ -198,6 +201,7 @@ def update( f"/accounts/{account_id}", body=maybe_transform( { + "id": id, "name": name, "settings": settings, }, @@ -448,6 +452,7 @@ async def update( self, *, account_id: str, + id: str, name: str, settings: account_update_params.Settings | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -463,6 +468,8 @@ async def update( Args: account_id: Account identifier tag. + id: Identifier + name: Account name settings: Account settings @@ -481,6 +488,7 @@ async def update( f"/accounts/{account_id}", body=await async_maybe_transform( { + "id": id, "name": name, "settings": settings, }, diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py index d5ea8076548..5a080571e45 100644 --- a/src/cloudflare/resources/accounts/logs/audit.py +++ b/src/cloudflare/resources/accounts/logs/audit.py @@ -52,30 +52,30 @@ def list( account_id: str, before: Union[str, date], since: Union[str, date], - account_name: str | NotGiven = NOT_GIVEN, - action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN, - action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN, - actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] | NotGiven = NOT_GIVEN, - actor_email: str | NotGiven = NOT_GIVEN, - actor_id: str | NotGiven = NOT_GIVEN, - actor_ip_address: str | NotGiven = NOT_GIVEN, - actor_token_id: str | NotGiven = NOT_GIVEN, - actor_token_name: str | NotGiven = NOT_GIVEN, - actor_type: Literal["cloudflare_admin", "account", "user"] | NotGiven = NOT_GIVEN, - audit_log_id: str | NotGiven = NOT_GIVEN, + 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: str | NotGiven = NOT_GIVEN, - raw_method: str | NotGiven = NOT_GIVEN, - raw_status_code: int | NotGiven = NOT_GIVEN, - raw_uri: str | NotGiven = NOT_GIVEN, - resource_id: str | NotGiven = NOT_GIVEN, - resource_product: str | NotGiven = NOT_GIVEN, - resource_scope: Literal["accounts", "user", "zones"] | NotGiven = NOT_GIVEN, - resource_type: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -94,33 +94,13 @@ def list( Args: account_id: The unique id that identifies the account. - before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and before the specified date. + before: Limits the returned results to logs older than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. - since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and after the specified date. - - account_name: Filters by the account name. - - action_result: Whether the action was successful or not. - - action_type: Filters by the action type. - - actor_context: Filters by the actor context. - - actor_email: Filters by the actor's email address. - - actor_id: Filters by the actor ID. This can be either the Account ID or User ID. - - actor_ip_address: The IP address where the action was initiated. - - actor_token_id: Filters by the API token ID when the actor context is an api_token or oauth. - - actor_token_name: Filters by the API token name when the actor context is an api_token or oauth. - - actor_type: Filters by the actor type. - - audit_log_id: Finds a specific log by its ID. + since: Limits the returned results to logs newer than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. cursor: The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of @@ -132,28 +112,6 @@ def list( limit: The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit. - raw_cf_rayid: Filters by the response CF Ray ID. - - raw_method: The HTTP method for the API call. - - raw_status_code: The response status code that was returned. - - raw_uri: Filters by the request URI. - - resource_id: Filters by the resource ID. - - resource_product: Filters audit logs by the Cloudflare product associated with the changed - resource. - - resource_scope: Filters by the resource scope, specifying whether the resource is associated - with an user, an account, or a zone. - - resource_type: Filters audit logs based on the unique type of resource changed by the action. - - zone_id: Filters by the zone ID. - - zone_name: Filters by the zone name associated with the change. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -234,30 +192,30 @@ def list( account_id: str, before: Union[str, date], since: Union[str, date], - account_name: str | NotGiven = NOT_GIVEN, - action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN, - action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN, - actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] | NotGiven = NOT_GIVEN, - actor_email: str | NotGiven = NOT_GIVEN, - actor_id: str | NotGiven = NOT_GIVEN, - actor_ip_address: str | NotGiven = NOT_GIVEN, - actor_token_id: str | NotGiven = NOT_GIVEN, - actor_token_name: str | NotGiven = NOT_GIVEN, - actor_type: Literal["cloudflare_admin", "account", "user"] | NotGiven = NOT_GIVEN, - audit_log_id: str | NotGiven = NOT_GIVEN, + 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: str | NotGiven = NOT_GIVEN, - raw_method: str | NotGiven = NOT_GIVEN, - raw_status_code: int | NotGiven = NOT_GIVEN, - raw_uri: str | NotGiven = NOT_GIVEN, - resource_id: str | NotGiven = NOT_GIVEN, - resource_product: str | NotGiven = NOT_GIVEN, - resource_scope: Literal["accounts", "user", "zones"] | NotGiven = NOT_GIVEN, - resource_type: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -276,33 +234,13 @@ def list( Args: account_id: The unique id that identifies the account. - before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and before the specified date. + before: Limits the returned results to logs older than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. - since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and after the specified date. - - account_name: Filters by the account name. - - action_result: Whether the action was successful or not. - - action_type: Filters by the action type. - - actor_context: Filters by the actor context. - - actor_email: Filters by the actor's email address. - - actor_id: Filters by the actor ID. This can be either the Account ID or User ID. - - actor_ip_address: The IP address where the action was initiated. - - actor_token_id: Filters by the API token ID when the actor context is an api_token or oauth. - - actor_token_name: Filters by the API token name when the actor context is an api_token or oauth. - - actor_type: Filters by the actor type. - - audit_log_id: Finds a specific log by its ID. + since: Limits the returned results to logs newer than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. cursor: The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of @@ -314,28 +252,6 @@ def list( limit: The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit. - raw_cf_rayid: Filters by the response CF Ray ID. - - raw_method: The HTTP method for the API call. - - raw_status_code: The response status code that was returned. - - raw_uri: Filters by the request URI. - - resource_id: Filters by the resource ID. - - resource_product: Filters audit logs by the Cloudflare product associated with the changed - resource. - - resource_scope: Filters by the resource scope, specifying whether the resource is associated - with an user, an account, or a zone. - - resource_type: Filters audit logs based on the unique type of resource changed by the action. - - zone_id: Filters by the zone ID. - - zone_name: Filters by the zone name associated with the change. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index 11c77ea9015..cddf77edb7f 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -23,9 +23,7 @@ from ...types.accounts import subscription_create_params, subscription_update_params from ...types.shared.subscription import Subscription from ...types.shared_params.rate_plan import RatePlan -from ...types.accounts.subscription_create_response import SubscriptionCreateResponse from ...types.accounts.subscription_delete_response import SubscriptionDeleteResponse -from ...types.accounts.subscription_update_response import SubscriptionUpdateResponse __all__ = ["SubscriptionsResource", "AsyncSubscriptionsResource"] @@ -62,7 +60,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionCreateResponse: + ) -> Subscription: """ Creates an account subscription. @@ -83,28 +81,23 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - SubscriptionCreateResponse, - self._post( - f"/accounts/{account_id}/subscriptions", - body=maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._post( + f"/accounts/{account_id}/subscriptions", + body=maybe_transform( + { + "frequency": frequency, + "rate_plan": rate_plan, + }, + 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[Subscription]._unwrapper, ), + cast_to=cast(Type[Subscription], ResultWrapper[Subscription]), ) def update( @@ -120,7 +113,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionUpdateResponse: + ) -> Subscription: """ Updates an account subscription. @@ -147,28 +140,23 @@ def update( raise ValueError( f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}" ) - return cast( - SubscriptionUpdateResponse, - self._put( - f"/accounts/{account_id}/subscriptions/{subscription_identifier}", - body=maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._put( + f"/accounts/{account_id}/subscriptions/{subscription_identifier}", + body=maybe_transform( + { + "frequency": frequency, + "rate_plan": rate_plan, + }, + 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[Subscription]._unwrapper, ), + cast_to=cast(Type[Subscription], ResultWrapper[Subscription]), ) def delete( @@ -286,7 +274,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionCreateResponse: + ) -> Subscription: """ Creates an account subscription. @@ -307,28 +295,23 @@ 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( - SubscriptionCreateResponse, - await self._post( - f"/accounts/{account_id}/subscriptions", - body=await async_maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + f"/accounts/{account_id}/subscriptions", + body=await async_maybe_transform( + { + "frequency": frequency, + "rate_plan": rate_plan, + }, + 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[Subscription]._unwrapper, ), + cast_to=cast(Type[Subscription], ResultWrapper[Subscription]), ) async def update( @@ -344,7 +327,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionUpdateResponse: + ) -> Subscription: """ Updates an account subscription. @@ -371,28 +354,23 @@ async def update( raise ValueError( f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}" ) - return cast( - SubscriptionUpdateResponse, - await self._put( - f"/accounts/{account_id}/subscriptions/{subscription_identifier}", - body=await async_maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._put( + f"/accounts/{account_id}/subscriptions/{subscription_identifier}", + body=await async_maybe_transform( + { + "frequency": frequency, + "rate_plan": rate_plan, + }, + 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[Subscription]._unwrapper, ), + cast_to=cast(Type[Subscription], ResultWrapper[Subscription]), ) async def delete( diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py index 2152615ba1f..7eee6d184bc 100644 --- a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py +++ b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast import httpx @@ -45,6 +46,7 @@ def with_streaming_response(self) -> AdvertisementStatusResourceWithStreamingRes """ return AdvertisementStatusResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def edit( self, prefix_id: str, @@ -101,6 +103,7 @@ def edit( ), ) + @typing_extensions.deprecated("deprecated") def get( self, prefix_id: str, @@ -169,6 +172,7 @@ def with_streaming_response(self) -> AsyncAdvertisementStatusResourceWithStreami """ return AsyncAdvertisementStatusResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def edit( self, prefix_id: str, @@ -225,6 +229,7 @@ async def edit( ), ) + @typing_extensions.deprecated("deprecated") async def get( self, prefix_id: str, @@ -277,11 +282,15 @@ class AdvertisementStatusResourceWithRawResponse: def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: self._advertisement_status = advertisement_status - self.edit = to_raw_response_wrapper( - advertisement_status.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + advertisement_status.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - advertisement_status.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + advertisement_status.get # pyright: ignore[reportDeprecated], + ) ) @@ -289,11 +298,15 @@ class AsyncAdvertisementStatusResourceWithRawResponse: def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None: self._advertisement_status = advertisement_status - self.edit = async_to_raw_response_wrapper( - advertisement_status.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + advertisement_status.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - advertisement_status.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + advertisement_status.get # pyright: ignore[reportDeprecated], + ) ) @@ -301,11 +314,15 @@ class AdvertisementStatusResourceWithStreamingResponse: def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: self._advertisement_status = advertisement_status - self.edit = to_streamed_response_wrapper( - advertisement_status.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + advertisement_status.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - advertisement_status.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + advertisement_status.get # pyright: ignore[reportDeprecated], + ) ) @@ -313,9 +330,13 @@ class AsyncAdvertisementStatusResourceWithStreamingResponse: def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None: self._advertisement_status = advertisement_status - self.edit = async_to_streamed_response_wrapper( - advertisement_status.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + advertisement_status.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - advertisement_status.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + advertisement_status.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/billing/profiles.py b/src/cloudflare/resources/billing/profiles.py index 6d97c84a04c..16e7235a279 100644 --- a/src/cloudflare/resources/billing/profiles.py +++ b/src/cloudflare/resources/billing/profiles.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, cast import httpx @@ -42,6 +43,7 @@ def with_streaming_response(self) -> ProfilesResourceWithStreamingResponse: """ return ProfilesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def get( self, *, @@ -102,6 +104,7 @@ def with_streaming_response(self) -> AsyncProfilesResourceWithStreamingResponse: """ return AsyncProfilesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def get( self, *, @@ -146,8 +149,10 @@ class ProfilesResourceWithRawResponse: def __init__(self, profiles: ProfilesResource) -> None: self._profiles = profiles - self.get = to_raw_response_wrapper( - profiles.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + profiles.get # pyright: ignore[reportDeprecated], + ) ) @@ -155,8 +160,10 @@ class AsyncProfilesResourceWithRawResponse: def __init__(self, profiles: AsyncProfilesResource) -> None: self._profiles = profiles - self.get = async_to_raw_response_wrapper( - profiles.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + profiles.get # pyright: ignore[reportDeprecated], + ) ) @@ -164,8 +171,10 @@ class ProfilesResourceWithStreamingResponse: def __init__(self, profiles: ProfilesResource) -> None: self._profiles = profiles - self.get = to_streamed_response_wrapper( - profiles.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + profiles.get # pyright: ignore[reportDeprecated], + ) ) @@ -173,6 +182,8 @@ class AsyncProfilesResourceWithStreamingResponse: def __init__(self, profiles: AsyncProfilesResource) -> None: self._profiles = profiles - self.get = async_to_streamed_response_wrapper( - profiles.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + profiles.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py b/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py index 2a12682c361..e7ea6619101 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py @@ -42,7 +42,7 @@ def with_streaming_response(self) -> AttackersResourceWithStreamingResponse: def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -64,6 +64,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/attackers", options=make_request_options( @@ -96,7 +98,7 @@ def with_streaming_response(self) -> AsyncAttackersResourceWithStreamingResponse async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,6 +120,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/attackers", options=make_request_options( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/categories.py b/src/cloudflare/resources/cloudforce_one/threat_events/categories.py index b3bdef15bce..2fdb0ac0af6 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/categories.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/categories.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> CategoriesResourceWithStreamingResponse: def create( self, *, - account_id: float, + account_id: str, kill_chain: float, name: str, mitre_attack: List[str] | NotGiven = NOT_GIVEN, @@ -76,6 +76,8 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/cloudforce-one/events/categories/create", body=maybe_transform( @@ -96,7 +98,7 @@ def create( def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,6 +120,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/categories", options=make_request_options( @@ -130,7 +134,7 @@ def delete( self, category_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -154,6 +158,8 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}") return self._delete( @@ -168,7 +174,7 @@ def edit( self, category_id: str, *, - account_id: float, + account_id: str, kill_chain: float | NotGiven = NOT_GIVEN, mitre_attack: List[str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -196,6 +202,8 @@ def edit( 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 category_id: raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}") return self._patch( @@ -219,7 +227,7 @@ def get( self, category_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -243,6 +251,8 @@ def get( 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 category_id: raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}") return self._get( @@ -277,7 +287,7 @@ def with_streaming_response(self) -> AsyncCategoriesResourceWithStreamingRespons async def create( self, *, - account_id: float, + account_id: str, kill_chain: float, name: str, mitre_attack: List[str] | NotGiven = NOT_GIVEN, @@ -303,6 +313,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/cloudforce-one/events/categories/create", body=await async_maybe_transform( @@ -323,7 +335,7 @@ async def create( async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -345,6 +357,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/categories", options=make_request_options( @@ -357,7 +371,7 @@ async def delete( self, category_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -381,6 +395,8 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}") return await self._delete( @@ -395,7 +411,7 @@ async def edit( self, category_id: str, *, - account_id: float, + account_id: str, kill_chain: float | NotGiven = NOT_GIVEN, mitre_attack: List[str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -423,6 +439,8 @@ async def edit( 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 category_id: raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}") return await self._patch( @@ -446,7 +464,7 @@ async def get( self, category_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -470,6 +488,8 @@ async def get( 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 category_id: raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/countries.py b/src/cloudflare/resources/cloudforce_one/threat_events/countries.py index 598c8f2a241..2aff1d3f293 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/countries.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/countries.py @@ -42,7 +42,7 @@ def with_streaming_response(self) -> CountriesResourceWithStreamingResponse: def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -64,6 +64,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/countries", options=make_request_options( @@ -96,7 +98,7 @@ def with_streaming_response(self) -> AsyncCountriesResourceWithStreamingResponse async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,6 +120,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/countries", options=make_request_options( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/crons.py b/src/cloudflare/resources/cloudforce_one/threat_events/crons.py index 85efabfaaa6..c7c869c10d3 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/crons.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/crons.py @@ -43,7 +43,7 @@ def with_streaming_response(self) -> CronsResourceWithStreamingResponse: def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -65,6 +65,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/cron", options=make_request_options( @@ -76,7 +78,7 @@ def list( def edit( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -98,6 +100,8 @@ def edit( 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._patch( f"/accounts/{account_id}/cloudforce-one/events/cron", options=make_request_options( @@ -130,7 +134,7 @@ def with_streaming_response(self) -> AsyncCronsResourceWithStreamingResponse: async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -152,6 +156,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/cron", options=make_request_options( @@ -163,7 +169,7 @@ async def list( async def edit( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -185,6 +191,8 @@ async def edit( 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._patch( f"/accounts/{account_id}/cloudforce-one/events/cron", options=make_request_options( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py new file mode 100644 index 00000000000..678a74c3cf1 --- /dev/null +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py @@ -0,0 +1,33 @@ +# 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, + DatasetsResourceWithRawResponse, + AsyncDatasetsResourceWithRawResponse, + DatasetsResourceWithStreamingResponse, + AsyncDatasetsResourceWithStreamingResponse, +) + +__all__ = [ + "HealthResource", + "AsyncHealthResource", + "HealthResourceWithRawResponse", + "AsyncHealthResourceWithRawResponse", + "HealthResourceWithStreamingResponse", + "AsyncHealthResourceWithStreamingResponse", + "DatasetsResource", + "AsyncDatasetsResource", + "DatasetsResourceWithRawResponse", + "AsyncDatasetsResourceWithRawResponse", + "DatasetsResourceWithStreamingResponse", + "AsyncDatasetsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py similarity index 85% rename from src/cloudflare/resources/cloudforce_one/threat_events/datasets.py rename to src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py index 33843178fd6..b0f839c7070 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/datasets.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py @@ -4,28 +4,40 @@ 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 .health import ( + HealthResource, + AsyncHealthResource, + HealthResourceWithRawResponse, + AsyncHealthResourceWithRawResponse, + HealthResourceWithStreamingResponse, + AsyncHealthResourceWithStreamingResponse, +) +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 ...._base_client import make_request_options -from ....types.cloudforce_one.threat_events import dataset_edit_params, dataset_create_params -from ....types.cloudforce_one.threat_events.dataset_get_response import DatasetGetResponse -from ....types.cloudforce_one.threat_events.dataset_raw_response import DatasetRawResponse -from ....types.cloudforce_one.threat_events.dataset_edit_response import DatasetEditResponse -from ....types.cloudforce_one.threat_events.dataset_list_response import DatasetListResponse -from ....types.cloudforce_one.threat_events.dataset_create_response import DatasetCreateResponse +from ....._base_client import make_request_options +from .....types.cloudforce_one.threat_events import dataset_edit_params, dataset_create_params +from .....types.cloudforce_one.threat_events.dataset_get_response import DatasetGetResponse +from .....types.cloudforce_one.threat_events.dataset_raw_response import DatasetRawResponse +from .....types.cloudforce_one.threat_events.dataset_edit_response import DatasetEditResponse +from .....types.cloudforce_one.threat_events.dataset_list_response import DatasetListResponse +from .....types.cloudforce_one.threat_events.dataset_create_response import DatasetCreateResponse __all__ = ["DatasetsResource", "AsyncDatasetsResource"] class DatasetsResource(SyncAPIResource): + @cached_property + def health(self) -> HealthResource: + return HealthResource(self._client) + @cached_property def with_raw_response(self) -> DatasetsResourceWithRawResponse: """ @@ -48,7 +60,7 @@ def with_streaming_response(self) -> DatasetsResourceWithStreamingResponse: def create( self, *, - account_id: float, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,6 +89,8 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/cloudforce-one/events/dataset/create", body=maybe_transform( @@ -95,7 +109,7 @@ def create( def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -117,6 +131,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/dataset", options=make_request_options( @@ -129,7 +145,7 @@ def edit( self, dataset_id: str, *, - account_id: float, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -160,6 +176,8 @@ def edit( 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 dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") return self._patch( @@ -181,7 +199,7 @@ def get( self, dataset_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -205,6 +223,8 @@ def get( 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 dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") return self._get( @@ -219,7 +239,7 @@ def raw( self, event_id: str, *, - account_id: float, + account_id: str, dataset_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -246,6 +266,8 @@ def raw( 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 dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") if not event_id: @@ -260,6 +282,10 @@ def raw( class AsyncDatasetsResource(AsyncAPIResource): + @cached_property + def health(self) -> AsyncHealthResource: + return AsyncHealthResource(self._client) + @cached_property def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse: """ @@ -282,7 +308,7 @@ def with_streaming_response(self) -> AsyncDatasetsResourceWithStreamingResponse: async def create( self, *, - account_id: float, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -311,6 +337,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/cloudforce-one/events/dataset/create", body=await async_maybe_transform( @@ -329,7 +357,7 @@ async def create( async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -351,6 +379,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/dataset", options=make_request_options( @@ -363,7 +393,7 @@ async def edit( self, dataset_id: str, *, - account_id: float, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -394,6 +424,8 @@ async def edit( 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 dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") return await self._patch( @@ -415,7 +447,7 @@ async def get( self, dataset_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -439,6 +471,8 @@ async def get( 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 dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") return await self._get( @@ -453,7 +487,7 @@ async def raw( self, event_id: str, *, - account_id: float, + account_id: str, dataset_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -480,6 +514,8 @@ async def raw( 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 dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") if not event_id: @@ -513,6 +549,10 @@ 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: @@ -534,6 +574,10 @@ 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: @@ -555,6 +599,10 @@ 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: @@ -575,3 +623,7 @@ 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/datasets/health.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/health.py new file mode 100644 index 00000000000..9d45aeebd89 --- /dev/null +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/health.py @@ -0,0 +1,177 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +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 ....._base_client import make_request_options +from .....types.cloudforce_one.threat_events.datasets.health_get_response import HealthGetResponse + +__all__ = ["HealthResource", "AsyncHealthResource"] + + +class HealthResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> HealthResourceWithRawResponse: + """ + 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) + + @cached_property + def with_streaming_response(self) -> HealthResourceWithStreamingResponse: + """ + 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) + + def get( + self, + dataset_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, + ) -> HealthGetResponse: + """ + Benchmark Durable Object warmup + + Args: + account_id: Account ID. + + dataset_id: Dataset 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 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", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthGetResponse, + ) + + +class AsyncHealthResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncHealthResourceWithRawResponse: + """ + 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) + + @cached_property + def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse: + """ + 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) + + async def get( + self, + dataset_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, + ) -> HealthGetResponse: + """ + Benchmark Durable Object warmup + + Args: + account_id: Account ID. + + dataset_id: Dataset 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 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", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthGetResponse, + ) + + +class HealthResourceWithRawResponse: + def __init__(self, health: HealthResource) -> None: + self._health = health + + self.get = to_raw_response_wrapper( + health.get, + ) + + +class AsyncHealthResourceWithRawResponse: + def __init__(self, health: AsyncHealthResource) -> None: + self._health = health + + self.get = async_to_raw_response_wrapper( + health.get, + ) + + +class HealthResourceWithStreamingResponse: + def __init__(self, health: HealthResource) -> None: + self._health = health + + self.get = to_streamed_response_wrapper( + health.get, + ) + + +class AsyncHealthResourceWithStreamingResponse: + def __init__(self, health: AsyncHealthResource) -> None: + self._health = health + + self.get = async_to_streamed_response_wrapper( + health.get, + ) 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 f1bffdf9e7f..8727db58a68 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py @@ -49,7 +49,7 @@ def create( self, event_id: str, *, - account_id: float, + account_id: str, tags: List[str], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,6 +74,8 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._post( @@ -93,7 +95,7 @@ def delete( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -117,6 +119,8 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._delete( @@ -156,7 +160,7 @@ async def create( self, event_id: str, *, - account_id: float, + account_id: str, tags: List[str], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -181,6 +185,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._post( @@ -200,7 +206,7 @@ async def delete( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -224,6 +230,8 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._delete( 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 574acc44dcd..5e0345f7e61 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py @@ -42,7 +42,7 @@ def with_streaming_response(self) -> IndicatorTypesResourceWithStreamingResponse def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -64,6 +64,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/indicatorTypes", options=make_request_options( @@ -96,7 +98,7 @@ def with_streaming_response(self) -> AsyncIndicatorTypesResourceWithStreamingRes async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,6 +120,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/indicatorTypes", options=make_request_options( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/insights.py b/src/cloudflare/resources/cloudforce_one/threat_events/insights.py index 3b27bbbc076..97373be775d 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/insights.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/insights.py @@ -51,7 +51,7 @@ def create( self, event_id: str, *, - account_id: float, + 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. @@ -76,6 +76,8 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._post( @@ -95,7 +97,7 @@ def delete( self, insight_id: str, *, - account_id: float, + 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. @@ -122,6 +124,8 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") if not insight_id: @@ -142,7 +146,7 @@ def edit( self, insight_id: str, *, - account_id: float, + 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. @@ -170,6 +174,8 @@ def edit( 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: @@ -191,7 +197,7 @@ def get( self, insight_id: str, *, - account_id: float, + 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. @@ -218,6 +224,8 @@ def get( 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: @@ -259,7 +267,7 @@ async def create( self, event_id: str, *, - account_id: float, + 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. @@ -284,6 +292,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._post( @@ -303,7 +313,7 @@ async def delete( self, insight_id: str, *, - account_id: float, + 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. @@ -330,6 +340,8 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") if not insight_id: @@ -350,7 +362,7 @@ async def edit( self, insight_id: str, *, - account_id: float, + 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. @@ -378,6 +390,8 @@ async def edit( 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: @@ -399,7 +413,7 @@ async def get( self, insight_id: str, *, - account_id: float, + 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. @@ -426,6 +440,8 @@ async def get( 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: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/raw.py b/src/cloudflare/resources/cloudforce_one/threat_events/raw.py index aaab85bff46..69e2955d748 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/raw.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/raw.py @@ -46,7 +46,7 @@ def edit( self, raw_id: str, *, - account_id: float, + account_id: str, event_id: str, data: object | NotGiven = NOT_GIVEN, source: str | NotGiven = NOT_GIVEN, @@ -76,6 +76,8 @@ def edit( 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 raw_id: @@ -100,7 +102,7 @@ def get( self, raw_id: str, *, - account_id: float, + 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. @@ -127,6 +129,8 @@ def get( 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 raw_id: @@ -164,7 +168,7 @@ async def edit( self, raw_id: str, *, - account_id: float, + account_id: str, event_id: str, data: object | NotGiven = NOT_GIVEN, source: str | NotGiven = NOT_GIVEN, @@ -194,6 +198,8 @@ async def edit( 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 raw_id: @@ -218,7 +224,7 @@ async def get( self, raw_id: str, *, - account_id: float, + 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. @@ -245,6 +251,8 @@ async def get( 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 raw_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/relate.py b/src/cloudflare/resources/cloudforce_one/threat_events/relate.py index edb8ffe2e89..3983fcf3385 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/relate.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/relate.py @@ -46,7 +46,7 @@ def delete( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -70,6 +70,8 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._delete( @@ -109,7 +111,7 @@ async def delete( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -133,6 +135,8 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._delete( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/tags.py b/src/cloudflare/resources/cloudforce_one/threat_events/tags.py index 8530511ea29..84d511d62b8 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/tags.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/tags.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> TagsResourceWithStreamingResponse: def create( self, *, - account_id: float, + account_id: str, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -67,6 +67,8 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/cloudforce-one/events/tags/create", body=maybe_transform({"name": name}, tag_create_params.TagCreateParams), @@ -100,7 +102,7 @@ def with_streaming_response(self) -> AsyncTagsResourceWithStreamingResponse: async def create( self, *, - account_id: float, + account_id: str, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -123,6 +125,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/cloudforce-one/events/tags/create", body=await async_maybe_transform({"name": name}, tag_create_params.TagCreateParams), 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 0436247e5e0..df7ddb996b2 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py @@ -42,7 +42,7 @@ def with_streaming_response(self) -> TargetIndustriesResourceWithStreamingRespon def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -64,6 +64,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events/targetIndustries", options=make_request_options( @@ -96,7 +98,7 @@ def with_streaming_response(self) -> AsyncTargetIndustriesResourceWithStreamingR async def list( self, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -118,6 +120,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events/targetIndustries", options=make_request_options( 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 0401fdaa33e..a313c5426f1 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py @@ -40,14 +40,6 @@ RelateResourceWithStreamingResponse, AsyncRelateResourceWithStreamingResponse, ) -from .datasets import ( - DatasetsResource, - AsyncDatasetsResource, - DatasetsResourceWithRawResponse, - AsyncDatasetsResourceWithRawResponse, - DatasetsResourceWithStreamingResponse, - AsyncDatasetsResourceWithStreamingResponse, -) from .insights import ( InsightsResource, AsyncInsightsResource, @@ -107,6 +99,14 @@ IndicatorTypesResourceWithStreamingResponse, AsyncIndicatorTypesResourceWithStreamingResponse, ) +from .datasets.datasets import ( + DatasetsResource, + AsyncDatasetsResource, + DatasetsResourceWithRawResponse, + AsyncDatasetsResourceWithRawResponse, + DatasetsResourceWithStreamingResponse, + AsyncDatasetsResourceWithStreamingResponse, +) from .target_industries import ( TargetIndustriesResource, AsyncTargetIndustriesResource, @@ -202,7 +202,7 @@ def with_streaming_response(self) -> ThreatEventsResourceWithStreamingResponse: def create( self, *, - path_account_id: float, + path_account_id: str, attacker: str, attacker_country: str, category: str, @@ -241,6 +241,8 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not path_account_id: + raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") return self._post( f"/accounts/{path_account_id}/cloudforce-one/events/create", body=maybe_transform( @@ -271,7 +273,7 @@ def create( def list( self, *, - account_id: float, + account_id: str, dataset_id: List[str] | NotGiven = NOT_GIVEN, force_refresh: bool | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, @@ -303,6 +305,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( f"/accounts/{account_id}/cloudforce-one/events", options=make_request_options( @@ -330,7 +334,7 @@ def delete( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -358,6 +362,8 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._delete( @@ -371,7 +377,7 @@ def delete( def bulk_create( self, *, - account_id: float, + account_id: str, data: Iterable[threat_event_bulk_create_params.Data], dataset_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -399,6 +405,8 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/cloudforce-one/events/create/bulk", body=maybe_transform( @@ -418,7 +426,7 @@ def edit( self, event_id: str, *, - account_id: float, + account_id: str, attacker: str | NotGiven = NOT_GIVEN, attacker_country: str | NotGiven = NOT_GIVEN, category: str | NotGiven = NOT_GIVEN, @@ -452,6 +460,8 @@ def edit( 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._patch( @@ -481,7 +491,7 @@ def get( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -505,6 +515,8 @@ def get( 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._get( @@ -587,7 +599,7 @@ def with_streaming_response(self) -> AsyncThreatEventsResourceWithStreamingRespo async def create( self, *, - path_account_id: float, + path_account_id: str, attacker: str, attacker_country: str, category: str, @@ -626,6 +638,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + if not path_account_id: + raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") return await self._post( f"/accounts/{path_account_id}/cloudforce-one/events/create", body=await async_maybe_transform( @@ -656,7 +670,7 @@ async def create( async def list( self, *, - account_id: float, + account_id: str, dataset_id: List[str] | NotGiven = NOT_GIVEN, force_refresh: bool | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, @@ -688,6 +702,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( f"/accounts/{account_id}/cloudforce-one/events", options=make_request_options( @@ -715,7 +731,7 @@ async def delete( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -743,6 +759,8 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._delete( @@ -756,7 +774,7 @@ async def delete( async def bulk_create( self, *, - account_id: float, + account_id: str, data: Iterable[threat_event_bulk_create_params.Data], dataset_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -784,6 +802,8 @@ async def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/cloudforce-one/events/create/bulk", body=await async_maybe_transform( @@ -803,7 +823,7 @@ async def edit( self, event_id: str, *, - account_id: float, + account_id: str, attacker: str | NotGiven = NOT_GIVEN, attacker_country: str | NotGiven = NOT_GIVEN, category: str | NotGiven = NOT_GIVEN, @@ -837,6 +857,8 @@ async def edit( 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._patch( @@ -866,7 +888,7 @@ async def get( self, event_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -890,6 +912,8 @@ async def get( 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._get( diff --git a/src/cloudflare/resources/dns/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/analytics/reports/bytimes.py index 3a5efabcc97..e18d4872e7e 100644 --- a/src/cloudflare/resources/dns/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/analytics/reports/bytimes.py @@ -74,7 +74,7 @@ def get( for detailed information about the available query parameters. Args: - zone_id: Identifier + zone_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. @@ -177,7 +177,7 @@ async def get( for detailed information about the available query parameters. Args: - zone_id: Identifier + zone_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. diff --git a/src/cloudflare/resources/dns/analytics/reports/reports.py b/src/cloudflare/resources/dns/analytics/reports/reports.py index a2da044463d..39a975be9f5 100644 --- a/src/cloudflare/resources/dns/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns/analytics/reports/reports.py @@ -83,7 +83,7 @@ def get( for detailed information about the available query parameters. Args: - zone_id: Identifier + zone_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. @@ -185,7 +185,7 @@ async def get( for detailed information about the available query parameters. Args: - zone_id: Identifier + zone_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index f15be57534e..7fe82213b8c 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -31,7 +31,6 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.dns.ttl_param import TTLParam from ...types.dns.record_tags import RecordTags -from ...types.dns.record_param import RecordParam from ...types.dns.batch_put_param import BatchPutParam from ...types.dns.record_response import RecordResponse from ...types.dns.batch_patch_param import BatchPatchParam @@ -69,14 +68,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["A"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -97,13 +96,15 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv4 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -115,8 +116,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -132,14 +131,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["AAAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -160,13 +159,15 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv6 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -178,8 +179,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,14 +194,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -223,12 +222,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CAA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid hostname. Must not match the record's name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -241,8 +242,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -258,14 +257,15 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CERT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -286,12 +286,17 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CERT record. + content: A valid mail server hostname. - name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -304,8 +309,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -321,14 +324,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["NS"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CNAME"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -349,12 +352,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid hostname. Must not match the record's name. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid name server host name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -367,8 +372,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -384,14 +387,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["OPENPGPKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -412,12 +415,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DNSKEY record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -430,8 +435,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -447,14 +450,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["PTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -475,12 +478,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DS record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: Domain name pointing to the address. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -493,8 +498,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -510,14 +513,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -538,12 +541,19 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a HTTPS record. + content: Text content for the record. The content must consist of quoted "character + strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding + this allowed maximum length are automatically split. - name: DNS record name (or @ for the zone apex) in Punycode. + Learn more at + . proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -556,8 +566,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -573,14 +581,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["CAA"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["LOC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -601,12 +609,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a LOC record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a CAA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -619,8 +629,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -636,15 +644,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["CERT"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["MX"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -665,15 +672,14 @@ def create( Args: zone_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: A valid mail server hostname. + type: Record type. - name: DNS record name (or @ for the zone apex) in Punycode. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. + data: Components of a CERT record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -686,8 +692,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -703,14 +707,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["DNSKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -731,12 +735,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a NAPTR record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DNSKEY record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -749,8 +755,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -766,14 +770,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["DS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -794,12 +798,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid name server host name. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -812,8 +818,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -829,14 +833,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["HTTPS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -857,12 +861,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a HTTPS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -875,8 +881,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -892,14 +896,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["LOC"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["PTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -920,12 +924,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Domain name pointing to the address. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a LOC record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -938,8 +944,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -955,14 +959,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -983,12 +987,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SMIMEA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a NAPTR record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1001,8 +1007,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1018,14 +1022,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["SMIMEA"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SRV"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1046,12 +1050,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SRV record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SMIMEA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1064,8 +1070,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1081,14 +1085,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["SRV"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1109,12 +1113,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SSHFP record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SRV record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1127,8 +1133,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1144,14 +1148,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["SSHFP"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SVCB"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1172,12 +1176,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SVCB record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SSHFP record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1190,8 +1196,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1207,14 +1211,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["SVCB"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TLSA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1235,12 +1239,14 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a TLSA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SVCB record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1253,8 +1259,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1270,14 +1274,14 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["TLSA"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TXT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1298,17 +1302,14 @@ def create( Args: zone_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: Text content for the record. The content must consist of quoted "character - strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding - this allowed maximum length are automatically split. + type: Record type. - Learn more at - . + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a TLSA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1321,8 +1322,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1338,15 +1337,15 @@ def create( self, *, zone_id: str, + name: str, + type: Literal["URI"], comment: str | NotGiven = NOT_GIVEN, data: record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - name: str | 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, - type: Literal["URI"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1367,13 +1366,15 @@ def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. data: Components of a URI record. - name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. @@ -1388,8 +1389,6 @@ def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1400,42 +1399,42 @@ def create( """ ... - @required_args(["zone_id"]) + @required_args(["zone_id", "name", "type"]) def create( self, *, zone_id: str, - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings - | record_create_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + name: str, type: Literal["A"] | Literal["AAAA"] + | Literal["CNAME"] + | Literal["MX"] + | Literal["NS"] + | Literal["OPENPGPKEY"] + | Literal["PTR"] + | Literal["TXT"] | Literal["CAA"] | Literal["CERT"] - | Literal["CNAME"] | Literal["DNSKEY"] | Literal["DS"] | Literal["HTTPS"] | Literal["LOC"] - | Literal["MX"] | Literal["NAPTR"] - | Literal["NS"] - | Literal["OPENPGPKEY"] - | Literal["PTR"] | Literal["SMIMEA"] | Literal["SRV"] | Literal["SSHFP"] | Literal["SVCB"] | Literal["TLSA"] - | Literal["TXT"] - | Literal["URI"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + content: str | str | str | str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.ARecordSettings + | record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + tags: List[RecordTags] | NotGiven = NOT_GIVEN, + ttl: TTLParam | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, data: record_create_params.CAARecordData | record_create_params.CERTRecordData | record_create_params.DNSKEYRecordData @@ -1448,7 +1447,6 @@ def create( | record_create_params.SSHFPRecordData | record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1464,16 +1462,16 @@ def create( f"/zones/{zone_id}/dns_records", body=maybe_transform( { + "name": name, + "type": type, "comment": comment, "content": content, - "name": name, "proxied": proxied, "settings": settings, "tags": tags, "ttl": ttl, - "type": type, - "data": data, "priority": priority, + "data": data, }, record_create_params.RecordCreateParams, ), @@ -1496,14 +1494,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["A"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1526,13 +1524,15 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv4 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1544,8 +1544,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1562,14 +1560,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["AAAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1592,13 +1590,15 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv6 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1610,8 +1610,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1628,14 +1626,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1658,12 +1656,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CAA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid hostname. Must not match the record's name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1676,8 +1676,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1694,14 +1692,15 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CERT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1724,12 +1723,17 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CERT record. + content: A valid mail server hostname. - name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1742,8 +1746,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1760,14 +1762,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NS"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CNAME"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1790,12 +1792,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid hostname. Must not match the record's name. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid name server host name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1808,8 +1812,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1826,14 +1828,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["OPENPGPKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1856,12 +1858,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DNSKEY record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1874,8 +1878,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1892,14 +1894,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["PTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1922,12 +1924,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DS record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: Domain name pointing to the address. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1940,8 +1944,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1958,14 +1960,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1988,12 +1990,19 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a HTTPS record. + content: Text content for the record. The content must consist of quoted "character + strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding + this allowed maximum length are automatically split. - name: DNS record name (or @ for the zone apex) in Punycode. + Learn more at + . proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2006,8 +2015,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2024,14 +2031,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CAA"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["LOC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2054,12 +2061,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a LOC record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a CAA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2072,8 +2081,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2090,15 +2097,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CERT"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["MX"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2121,15 +2127,14 @@ def update( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: A valid mail server hostname. + type: Record type. - name: DNS record name (or @ for the zone apex) in Punycode. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. + data: Components of a CERT record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2142,8 +2147,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2160,14 +2163,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DNSKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2190,12 +2193,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a NAPTR record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DNSKEY record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2208,8 +2213,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2226,14 +2229,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2256,12 +2259,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid name server host name. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2274,8 +2279,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2292,14 +2295,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["HTTPS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2322,12 +2325,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a HTTPS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2340,8 +2345,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2358,14 +2361,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["LOC"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["PTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2388,12 +2391,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Domain name pointing to the address. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a LOC record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2406,8 +2411,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2424,14 +2427,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2454,12 +2457,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SMIMEA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a NAPTR record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2472,8 +2477,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2490,14 +2493,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SMIMEA"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SRV"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2520,12 +2523,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SRV record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SMIMEA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2538,8 +2543,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2556,14 +2559,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SRV"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2586,12 +2589,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SSHFP record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SRV record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2604,8 +2609,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2622,14 +2625,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SSHFP"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SVCB"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2652,12 +2655,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SVCB record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SSHFP record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2670,8 +2675,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2688,14 +2691,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SVCB"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TLSA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2718,12 +2721,14 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a TLSA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SVCB record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2736,8 +2741,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2754,14 +2757,14 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TLSA"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TXT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2784,17 +2787,14 @@ def update( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: Text content for the record. The content must consist of quoted "character - strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding - this allowed maximum length are automatically split. + type: Record type. - Learn more at - . + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a TLSA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -2807,8 +2807,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2825,15 +2823,15 @@ def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["URI"], comment: str | NotGiven = NOT_GIVEN, data: record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - name: str | 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, - type: Literal["URI"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2856,13 +2854,15 @@ def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. data: Components of a URI record. - name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. @@ -2877,8 +2877,6 @@ def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2889,43 +2887,43 @@ def update( """ ... - @required_args(["zone_id"]) + @required_args(["zone_id", "name", "type"]) def update( self, dns_record_id: str, *, zone_id: str, - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings - | record_update_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + name: str, type: Literal["A"] | Literal["AAAA"] + | Literal["CNAME"] + | Literal["MX"] + | Literal["NS"] + | Literal["OPENPGPKEY"] + | Literal["PTR"] + | Literal["TXT"] | Literal["CAA"] | Literal["CERT"] - | Literal["CNAME"] | Literal["DNSKEY"] | Literal["DS"] | Literal["HTTPS"] | Literal["LOC"] - | Literal["MX"] | Literal["NAPTR"] - | Literal["NS"] - | Literal["OPENPGPKEY"] - | Literal["PTR"] | Literal["SMIMEA"] | Literal["SRV"] | Literal["SSHFP"] | Literal["SVCB"] | Literal["TLSA"] - | Literal["TXT"] - | Literal["URI"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + content: str | str | str | str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.ARecordSettings + | record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + tags: List[RecordTags] | NotGiven = NOT_GIVEN, + ttl: TTLParam | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, data: record_update_params.CAARecordData | record_update_params.CERTRecordData | record_update_params.DNSKEYRecordData @@ -2938,7 +2936,6 @@ def update( | record_update_params.SSHFPRecordData | record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2956,16 +2953,16 @@ def update( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( { + "name": name, + "type": type, "comment": comment, "content": content, - "name": name, "proxied": proxied, "settings": settings, "tags": tags, "ttl": ttl, - "type": type, - "data": data, "priority": priority, + "data": data, }, record_update_params.RecordUpdateParams, ), @@ -3154,7 +3151,7 @@ def batch( zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, + posts: Iterable[record_batch_params.Post] | NotGiven = NOT_GIVEN, puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3222,14 +3219,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["A"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3252,13 +3249,15 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv4 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3270,8 +3269,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3288,14 +3285,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["AAAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3318,13 +3315,15 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv6 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3336,8 +3335,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3354,14 +3351,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3384,12 +3381,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CAA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid hostname. Must not match the record's name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3402,8 +3401,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3420,14 +3417,15 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CERT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3450,12 +3448,17 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CERT record. + content: A valid mail server hostname. - name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3468,8 +3471,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3486,14 +3487,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NS"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CNAME"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3516,12 +3517,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid hostname. Must not match the record's name. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid name server host name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3534,8 +3537,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3552,14 +3553,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["OPENPGPKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3582,12 +3583,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DNSKEY record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3600,8 +3603,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3618,14 +3619,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["PTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3648,12 +3649,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DS record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: Domain name pointing to the address. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3666,8 +3669,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3684,14 +3685,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3714,12 +3715,19 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a HTTPS record. + content: Text content for the record. The content must consist of quoted "character + strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding + this allowed maximum length are automatically split. - name: DNS record name (or @ for the zone apex) in Punycode. + Learn more at + . proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3732,8 +3740,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3750,14 +3756,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CAA"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["LOC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3780,12 +3786,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a LOC record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a CAA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3798,8 +3806,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3816,15 +3822,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CERT"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["MX"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3847,15 +3852,14 @@ def edit( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: A valid mail server hostname. + type: Record type. - name: DNS record name (or @ for the zone apex) in Punycode. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. + data: Components of a CERT record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3868,8 +3872,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3886,14 +3888,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DNSKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3916,12 +3918,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a NAPTR record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DNSKEY record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -3934,8 +3938,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3952,14 +3954,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3982,12 +3984,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid name server host name. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4000,8 +4004,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4018,14 +4020,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["HTTPS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4048,12 +4050,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a HTTPS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4066,8 +4070,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4084,14 +4086,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["LOC"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["PTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4114,12 +4116,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Domain name pointing to the address. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a LOC record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4132,8 +4136,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4150,14 +4152,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4180,12 +4182,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SMIMEA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a NAPTR record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4198,8 +4202,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4216,14 +4218,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SMIMEA"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SRV"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4246,12 +4248,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SRV record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SMIMEA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4264,8 +4268,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4282,14 +4284,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SRV"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4312,12 +4314,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SSHFP record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SRV record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4330,8 +4334,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4348,14 +4350,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SSHFP"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SVCB"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4378,12 +4380,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SVCB record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SSHFP record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4396,8 +4400,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4414,14 +4416,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SVCB"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TLSA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4444,12 +4446,14 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a TLSA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SVCB record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4462,8 +4466,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4480,14 +4482,14 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TLSA"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TXT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4510,17 +4512,14 @@ def edit( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: Text content for the record. The content must consist of quoted "character - strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding - this allowed maximum length are automatically split. + type: Record type. - Learn more at - . + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a TLSA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4533,8 +4532,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4551,15 +4548,15 @@ def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["URI"], comment: str | NotGiven = NOT_GIVEN, data: record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - name: str | 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, - type: Literal["URI"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4582,13 +4579,15 @@ def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. data: Components of a URI record. - name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. @@ -4603,8 +4602,6 @@ def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4615,41 +4612,41 @@ def edit( """ ... - @required_args(["zone_id"]) + @required_args(["zone_id", "name", "type"]) def edit( self, dns_record_id: str, *, zone_id: str, - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - name: 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, + name: str, type: Literal["A"] | Literal["AAAA"] + | Literal["CNAME"] + | Literal["MX"] + | Literal["NS"] + | Literal["OPENPGPKEY"] + | Literal["PTR"] + | Literal["TXT"] | Literal["CAA"] | Literal["CERT"] - | Literal["CNAME"] | Literal["DNSKEY"] | Literal["DS"] | Literal["HTTPS"] | Literal["LOC"] - | Literal["MX"] | Literal["NAPTR"] - | Literal["NS"] - | Literal["OPENPGPKEY"] - | Literal["PTR"] | Literal["SMIMEA"] | Literal["SRV"] | Literal["SSHFP"] | Literal["SVCB"] | Literal["TLSA"] - | Literal["TXT"] - | Literal["URI"] - | NotGiven = NOT_GIVEN, + | 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, data: record_edit_params.CAARecordData | record_edit_params.CERTRecordData | record_edit_params.DNSKEYRecordData @@ -4662,7 +4659,6 @@ def edit( | record_edit_params.SSHFPRecordData | record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4680,16 +4676,16 @@ def edit( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( { + "name": name, + "type": type, "comment": comment, "content": content, - "name": name, "proxied": proxied, "settings": settings, "tags": tags, "ttl": ttl, - "type": type, - "data": data, "priority": priority, + "data": data, }, record_edit_params.RecordEditParams, ), @@ -4934,14 +4930,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["A"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4962,13 +4958,15 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv4 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -4980,8 +4978,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4997,14 +4993,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["AAAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5025,13 +5021,15 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv6 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5043,8 +5041,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5060,14 +5056,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5088,12 +5084,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CAA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid hostname. Must not match the record's name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5106,8 +5104,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5123,14 +5119,15 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CERT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5151,12 +5148,17 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CERT record. + content: A valid mail server hostname. - name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5169,8 +5171,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5186,14 +5186,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["NS"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CNAME"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5214,12 +5214,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid hostname. Must not match the record's name. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid name server host name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5232,8 +5234,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5249,14 +5249,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["OPENPGPKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5277,12 +5277,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DNSKEY record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5295,8 +5297,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5312,14 +5312,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["PTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5340,12 +5340,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DS record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: Domain name pointing to the address. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5358,8 +5360,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5375,14 +5375,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5403,12 +5403,19 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a HTTPS record. + content: Text content for the record. The content must consist of quoted "character + strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding + this allowed maximum length are automatically split. - name: DNS record name (or @ for the zone apex) in Punycode. + Learn more at + . proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5421,8 +5428,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5438,14 +5443,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["CAA"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["LOC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5466,12 +5471,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a LOC record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a CAA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5484,8 +5491,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5501,15 +5506,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["CERT"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["MX"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5530,15 +5534,14 @@ async def create( Args: zone_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: A valid mail server hostname. + type: Record type. - name: DNS record name (or @ for the zone apex) in Punycode. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. + data: Components of a CERT record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5551,8 +5554,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5568,14 +5569,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["DNSKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5596,12 +5597,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a NAPTR record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DNSKEY record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5614,8 +5617,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5631,14 +5632,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["DS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5659,12 +5660,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid name server host name. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5677,8 +5680,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5694,14 +5695,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["HTTPS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5722,12 +5723,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a HTTPS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5740,8 +5743,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5757,14 +5758,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["LOC"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["PTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5785,12 +5786,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Domain name pointing to the address. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a LOC record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5803,8 +5806,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5820,14 +5821,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5848,12 +5849,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SMIMEA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a NAPTR record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5866,8 +5869,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5883,14 +5884,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["SMIMEA"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SRV"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5911,12 +5912,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SRV record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SMIMEA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5929,8 +5932,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5946,14 +5947,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["SRV"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5974,12 +5975,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SSHFP record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SRV record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -5992,8 +5995,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6009,14 +6010,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["SSHFP"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SVCB"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6037,12 +6038,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SVCB record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SSHFP record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6055,8 +6058,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6072,14 +6073,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["SVCB"], comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TLSA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6100,12 +6101,14 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a TLSA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SVCB record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6118,8 +6121,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6135,14 +6136,14 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["TLSA"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TXT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6163,17 +6164,14 @@ async def create( Args: zone_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: Text content for the record. The content must consist of quoted "character - strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding - this allowed maximum length are automatically split. + type: Record type. - Learn more at - . + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a TLSA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6186,8 +6184,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6203,15 +6199,15 @@ async def create( self, *, zone_id: str, + name: str, + type: Literal["URI"], comment: str | NotGiven = NOT_GIVEN, data: record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - name: str | 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, - type: Literal["URI"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6232,13 +6228,15 @@ async def create( Args: zone_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. data: Components of a URI record. - name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. @@ -6253,8 +6251,6 @@ async def create( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6265,42 +6261,42 @@ async def create( """ ... - @required_args(["zone_id"]) + @required_args(["zone_id", "name", "type"]) async def create( self, *, zone_id: str, - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings - | record_create_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + name: str, type: Literal["A"] | Literal["AAAA"] + | Literal["CNAME"] + | Literal["MX"] + | Literal["NS"] + | Literal["OPENPGPKEY"] + | Literal["PTR"] + | Literal["TXT"] | Literal["CAA"] | Literal["CERT"] - | Literal["CNAME"] | Literal["DNSKEY"] | Literal["DS"] | Literal["HTTPS"] | Literal["LOC"] - | Literal["MX"] | Literal["NAPTR"] - | Literal["NS"] - | Literal["OPENPGPKEY"] - | Literal["PTR"] | Literal["SMIMEA"] | Literal["SRV"] | Literal["SSHFP"] | Literal["SVCB"] | Literal["TLSA"] - | Literal["TXT"] - | Literal["URI"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + content: str | str | str | str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.ARecordSettings + | record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + tags: List[RecordTags] | NotGiven = NOT_GIVEN, + ttl: TTLParam | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, data: record_create_params.CAARecordData | record_create_params.CERTRecordData | record_create_params.DNSKEYRecordData @@ -6313,7 +6309,6 @@ async def create( | record_create_params.SSHFPRecordData | record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6329,16 +6324,16 @@ async def create( f"/zones/{zone_id}/dns_records", body=await async_maybe_transform( { + "name": name, + "type": type, "comment": comment, "content": content, - "name": name, "proxied": proxied, "settings": settings, "tags": tags, "ttl": ttl, - "type": type, - "data": data, "priority": priority, + "data": data, }, record_create_params.RecordCreateParams, ), @@ -6361,14 +6356,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["A"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6391,13 +6386,15 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv4 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6409,8 +6406,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6427,14 +6422,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["AAAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6457,13 +6452,15 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv6 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6475,8 +6472,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6493,14 +6488,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6523,12 +6518,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CAA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid hostname. Must not match the record's name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6541,8 +6538,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6559,14 +6554,15 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CERT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6589,12 +6585,17 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CERT record. + content: A valid mail server hostname. - name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6607,8 +6608,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6625,14 +6624,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NS"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CNAME"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6655,12 +6654,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid hostname. Must not match the record's name. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid name server host name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6673,8 +6674,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6691,14 +6690,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["OPENPGPKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6721,12 +6720,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DNSKEY record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6739,8 +6740,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6757,14 +6756,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["PTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6787,12 +6786,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DS record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: Domain name pointing to the address. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6805,8 +6806,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6823,14 +6822,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6853,12 +6852,19 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a HTTPS record. + content: Text content for the record. The content must consist of quoted "character + strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding + this allowed maximum length are automatically split. - name: DNS record name (or @ for the zone apex) in Punycode. + Learn more at + . proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6871,8 +6877,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6889,14 +6893,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CAA"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["LOC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6919,12 +6923,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a LOC record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a CAA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -6937,8 +6943,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6955,15 +6959,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CERT"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["MX"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6986,15 +6989,14 @@ async def update( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: A valid mail server hostname. + type: Record type. - name: DNS record name (or @ for the zone apex) in Punycode. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. + data: Components of a CERT record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7007,8 +7009,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7025,14 +7025,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DNSKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7055,12 +7055,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a NAPTR record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DNSKEY record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7073,8 +7075,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7091,14 +7091,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7121,12 +7121,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid name server host name. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7139,8 +7141,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7157,14 +7157,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["HTTPS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7187,12 +7187,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a HTTPS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7205,8 +7207,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7223,14 +7223,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["LOC"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["PTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7253,12 +7253,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Domain name pointing to the address. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a LOC record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7271,8 +7273,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7289,14 +7289,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7319,12 +7319,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SMIMEA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a NAPTR record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7337,8 +7339,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7355,14 +7355,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SMIMEA"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SRV"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7385,12 +7385,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SRV record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SMIMEA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7403,8 +7405,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7421,14 +7421,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SRV"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7451,12 +7451,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SSHFP record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SRV record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7469,8 +7471,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7487,14 +7487,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SSHFP"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SVCB"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7517,12 +7517,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SVCB record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SSHFP record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7535,8 +7537,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7553,14 +7553,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SVCB"], comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TLSA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7583,12 +7583,14 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a TLSA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SVCB record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7601,8 +7603,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7619,14 +7619,14 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TLSA"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TXT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7649,17 +7649,14 @@ async def update( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: Text content for the record. The content must consist of quoted "character - strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding - this allowed maximum length are automatically split. + type: Record type. - Learn more at - . + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a TLSA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -7672,8 +7669,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7690,15 +7685,15 @@ async def update( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["URI"], comment: str | NotGiven = NOT_GIVEN, data: record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - name: str | 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, - type: Literal["URI"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7721,13 +7716,15 @@ async def update( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. data: Components of a URI record. - name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. @@ -7742,8 +7739,6 @@ async def update( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7754,43 +7749,43 @@ async def update( """ ... - @required_args(["zone_id"]) + @required_args(["zone_id", "name", "type"]) async def update( self, dns_record_id: str, *, zone_id: str, - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings - | record_update_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + name: str, type: Literal["A"] | Literal["AAAA"] + | Literal["CNAME"] + | Literal["MX"] + | Literal["NS"] + | Literal["OPENPGPKEY"] + | Literal["PTR"] + | Literal["TXT"] | Literal["CAA"] | Literal["CERT"] - | Literal["CNAME"] | Literal["DNSKEY"] | Literal["DS"] | Literal["HTTPS"] | Literal["LOC"] - | Literal["MX"] | Literal["NAPTR"] - | Literal["NS"] - | Literal["OPENPGPKEY"] - | Literal["PTR"] | Literal["SMIMEA"] | Literal["SRV"] | Literal["SSHFP"] | Literal["SVCB"] | Literal["TLSA"] - | Literal["TXT"] - | Literal["URI"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + content: str | str | str | str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.ARecordSettings + | record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + tags: List[RecordTags] | NotGiven = NOT_GIVEN, + ttl: TTLParam | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, data: record_update_params.CAARecordData | record_update_params.CERTRecordData | record_update_params.DNSKEYRecordData @@ -7803,7 +7798,6 @@ async def update( | record_update_params.SSHFPRecordData | record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7821,16 +7815,16 @@ async def update( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( { + "name": name, + "type": type, "comment": comment, "content": content, - "name": name, "proxied": proxied, "settings": settings, "tags": tags, "ttl": ttl, - "type": type, - "data": data, "priority": priority, + "data": data, }, record_update_params.RecordUpdateParams, ), @@ -8019,7 +8013,7 @@ async def batch( zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, + posts: Iterable[record_batch_params.Post] | NotGiven = NOT_GIVEN, puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -8087,14 +8081,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["A"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8117,13 +8111,15 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv4 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8135,8 +8131,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8153,14 +8147,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: 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, - type: Literal["AAAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8183,13 +8177,15 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. content: A valid IPv6 address. - name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8201,8 +8197,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8219,14 +8213,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CAA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8249,12 +8243,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CAA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid hostname. Must not match the record's name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8267,8 +8263,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8285,14 +8279,15 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CERT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8315,12 +8310,17 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a CERT record. + content: A valid mail server hostname. - name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8333,8 +8333,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8351,14 +8349,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NS"], comment: str | NotGiven = NOT_GIVEN, content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["CNAME"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8381,12 +8379,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid hostname. Must not match the record's name. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A valid name server host name. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8399,8 +8399,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8417,14 +8415,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["OPENPGPKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8447,12 +8445,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DNSKEY record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8465,8 +8465,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8483,14 +8481,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["PTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["DS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8513,12 +8511,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a DS record. - - name: DNS record name (or @ for the zone apex) in Punycode. + content: Domain name pointing to the address. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8531,8 +8531,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8549,14 +8547,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8579,12 +8577,19 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a HTTPS record. + content: Text content for the record. The content must consist of quoted "character + strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding + this allowed maximum length are automatically split. - name: DNS record name (or @ for the zone apex) in Punycode. + Learn more at + . proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8597,8 +8602,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8615,14 +8618,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CAA"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["LOC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8645,12 +8648,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a LOC record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a CAA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8663,8 +8668,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8681,15 +8684,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["CERT"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["MX"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8712,15 +8714,14 @@ async def edit( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: A valid mail server hostname. + type: Record type. - name: DNS record name (or @ for the zone apex) in Punycode. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. + data: Components of a CERT record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8733,8 +8734,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8751,14 +8750,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DNSKEY"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8781,12 +8780,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a NAPTR record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DNSKEY record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8799,8 +8800,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8817,14 +8816,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["DS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["NS"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8847,12 +8846,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A valid name server host name. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a DS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8865,8 +8866,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8883,14 +8882,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["HTTPS"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8913,12 +8912,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a HTTPS record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8931,8 +8932,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8949,14 +8948,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["LOC"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["PTR"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8979,12 +8978,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Domain name pointing to the address. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a LOC record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -8997,8 +8998,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9015,14 +9014,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9045,12 +9044,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SMIMEA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a NAPTR record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -9063,8 +9064,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9081,14 +9080,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SMIMEA"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SRV"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9111,12 +9110,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SRV record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SMIMEA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -9129,8 +9130,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9147,14 +9146,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SRV"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9177,12 +9176,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SSHFP record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SRV record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -9195,8 +9196,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9213,14 +9212,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SSHFP"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["SVCB"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9243,12 +9242,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a SVCB record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SSHFP record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -9261,8 +9262,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9279,14 +9278,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["SVCB"], comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TLSA"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9309,12 +9308,14 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - data: Components of a TLSA record. - - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a SVCB record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -9327,8 +9328,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9345,14 +9344,14 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["TLSA"], comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, + settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, - type: Literal["TXT"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9375,17 +9374,14 @@ async def edit( dns_record_id: Identifier. - comment: Comments or notes about the DNS record. This field has no effect on DNS - responses. + name: DNS record name (or @ for the zone apex) in Punycode. - content: Text content for the record. The content must consist of quoted "character - strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding - this allowed maximum length are automatically split. + type: Record type. - Learn more at - . + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - name: DNS record name (or @ for the zone apex) in Punycode. + data: Components of a TLSA record. proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -9398,8 +9394,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9416,15 +9410,15 @@ async def edit( dns_record_id: str, *, zone_id: str, + name: str, + type: Literal["URI"], comment: str | NotGiven = NOT_GIVEN, data: record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - name: str | 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, - type: Literal["URI"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9447,13 +9441,15 @@ async def edit( dns_record_id: Identifier. + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS responses. data: Components of a URI record. - name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. @@ -9468,8 +9464,6 @@ async def edit( Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - type: Record type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9480,41 +9474,41 @@ async def edit( """ ... - @required_args(["zone_id"]) + @required_args(["zone_id", "name", "type"]) async def edit( self, dns_record_id: str, *, zone_id: str, - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - name: 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, + name: str, type: Literal["A"] | Literal["AAAA"] + | Literal["CNAME"] + | Literal["MX"] + | Literal["NS"] + | Literal["OPENPGPKEY"] + | Literal["PTR"] + | Literal["TXT"] | Literal["CAA"] | Literal["CERT"] - | Literal["CNAME"] | Literal["DNSKEY"] | Literal["DS"] | Literal["HTTPS"] | Literal["LOC"] - | Literal["MX"] | Literal["NAPTR"] - | Literal["NS"] - | Literal["OPENPGPKEY"] - | Literal["PTR"] | Literal["SMIMEA"] | Literal["SRV"] | Literal["SSHFP"] | Literal["SVCB"] | Literal["TLSA"] - | Literal["TXT"] - | Literal["URI"] - | NotGiven = NOT_GIVEN, + | 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, data: record_edit_params.CAARecordData | record_edit_params.CERTRecordData | record_edit_params.DNSKEYRecordData @@ -9527,7 +9521,6 @@ async def edit( | record_edit_params.SSHFPRecordData | record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -9545,16 +9538,16 @@ async def edit( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( { + "name": name, + "type": type, "comment": comment, "content": content, - "name": name, "proxied": proxied, "settings": settings, "tags": tags, "ttl": ttl, - "type": type, - "data": data, "priority": priority, + "data": data, }, record_edit_params.RecordEditParams, ), diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py index dd2818626d5..638bc7968b1 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py @@ -75,9 +75,9 @@ def get( for detailed information about the available query parameters. Args: - account_id: Identifier + account_id: Identifier. - dns_firewall_id: Identifier + dns_firewall_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. @@ -183,9 +183,9 @@ async def get( for detailed information about the available query parameters. Args: - account_id: Identifier + account_id: Identifier. - dns_firewall_id: Identifier + dns_firewall_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py index ea094740212..6943542d65c 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py @@ -84,9 +84,9 @@ def get( for detailed information about the available query parameters. Args: - account_id: Identifier + account_id: Identifier. - dns_firewall_id: Identifier + dns_firewall_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. @@ -191,9 +191,9 @@ async def get( for detailed information about the available query parameters. Args: - account_id: Identifier + account_id: Identifier. - dns_firewall_id: Identifier + dns_firewall_id: Identifier. dimensions: A comma-separated list of dimensions to group results by. diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index 1fc2bdf4a40..142ae4eaa4e 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast import httpx @@ -80,6 +81,7 @@ def with_streaming_response(self) -> EmailRoutingResourceWithStreamingResponse: """ return EmailRoutingResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def disable( self, *, @@ -123,6 +125,7 @@ def disable( cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) + @typing_extensions.deprecated("deprecated") def enable( self, *, @@ -237,6 +240,7 @@ def with_streaming_response(self) -> AsyncEmailRoutingResourceWithStreamingRespo """ return AsyncEmailRoutingResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def disable( self, *, @@ -280,6 +284,7 @@ async def disable( cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) + @typing_extensions.deprecated("deprecated") async def enable( self, *, @@ -366,11 +371,15 @@ class EmailRoutingResourceWithRawResponse: def __init__(self, email_routing: EmailRoutingResource) -> None: self._email_routing = email_routing - self.disable = to_raw_response_wrapper( - email_routing.disable, + self.disable = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + email_routing.disable # pyright: ignore[reportDeprecated], + ) ) - self.enable = to_raw_response_wrapper( - email_routing.enable, + self.enable = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + email_routing.enable # pyright: ignore[reportDeprecated], + ) ) self.get = to_raw_response_wrapper( email_routing.get, @@ -393,11 +402,15 @@ class AsyncEmailRoutingResourceWithRawResponse: def __init__(self, email_routing: AsyncEmailRoutingResource) -> None: self._email_routing = email_routing - self.disable = async_to_raw_response_wrapper( - email_routing.disable, + self.disable = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + email_routing.disable # pyright: ignore[reportDeprecated], + ) ) - self.enable = async_to_raw_response_wrapper( - email_routing.enable, + self.enable = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + email_routing.enable # pyright: ignore[reportDeprecated], + ) ) self.get = async_to_raw_response_wrapper( email_routing.get, @@ -420,11 +433,15 @@ class EmailRoutingResourceWithStreamingResponse: def __init__(self, email_routing: EmailRoutingResource) -> None: self._email_routing = email_routing - self.disable = to_streamed_response_wrapper( - email_routing.disable, + self.disable = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + email_routing.disable # pyright: ignore[reportDeprecated], + ) ) - self.enable = to_streamed_response_wrapper( - email_routing.enable, + self.enable = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + email_routing.enable # pyright: ignore[reportDeprecated], + ) ) self.get = to_streamed_response_wrapper( email_routing.get, @@ -447,11 +464,15 @@ class AsyncEmailRoutingResourceWithStreamingResponse: def __init__(self, email_routing: AsyncEmailRoutingResource) -> None: self._email_routing = email_routing - self.disable = async_to_streamed_response_wrapper( - email_routing.disable, + self.disable = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + email_routing.disable # pyright: ignore[reportDeprecated], + ) ) - self.enable = async_to_streamed_response_wrapper( - email_routing.enable, + self.enable = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + email_routing.enable # pyright: ignore[reportDeprecated], + ) ) self.get = async_to_streamed_response_wrapper( email_routing.get, diff --git a/src/cloudflare/resources/firewall/lockdowns.py b/src/cloudflare/resources/firewall/lockdowns.py index a4d8d3a9b3f..1081d553f48 100644 --- a/src/cloudflare/resources/firewall/lockdowns.py +++ b/src/cloudflare/resources/firewall/lockdowns.py @@ -55,6 +55,9 @@ 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -76,6 +79,15 @@ 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. + + paused: When true, indicates that the rule is currently paused. + + priority: The priority of the rule to control the processing order. A lower number + indicates higher priority. If not provided, any rules with a configured priority + will be processed before rules without a priority. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -92,6 +104,9 @@ def create( { "configurations": configurations, "urls": urls, + "description": description, + "paused": paused, + "priority": priority, }, lockdown_create_params.LockdownCreateParams, ), @@ -374,6 +389,9 @@ 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -395,6 +413,15 @@ 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. + + paused: When true, indicates that the rule is currently paused. + + priority: The priority of the rule to control the processing order. A lower number + indicates higher priority. If not provided, any rules with a configured priority + will be processed before rules without a priority. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -411,6 +438,9 @@ async def create( { "configurations": configurations, "urls": urls, + "description": description, + "paused": paused, + "priority": priority, }, lockdown_create_params.LockdownCreateParams, ), diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index d8df4ad44b4..5de9246f2c3 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -69,8 +69,6 @@ def create( Args: zone_id: Defines an identifier. - configuration: The rule configuration. - mode: The action to apply to a matched request. extra_headers: Send extra headers @@ -369,8 +367,6 @@ async def create( Args: zone_id: Defines an identifier. - configuration: The rule configuration. - mode: The action to apply to a matched request. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/firewall/waf/overrides.py b/src/cloudflare/resources/firewall/waf/overrides.py index 8f572e050ad..be591ce129f 100644 --- a/src/cloudflare/resources/firewall/waf/overrides.py +++ b/src/cloudflare/resources/firewall/waf/overrides.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Optional, cast import httpx @@ -53,6 +54,7 @@ def with_streaming_response(self) -> OverridesResourceWithStreamingResponse: """ return OverridesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, *, @@ -101,6 +103,7 @@ def create( cast_to=cast(Type[Override], ResultWrapper[Override]), ) + @typing_extensions.deprecated("deprecated") def update( self, overrides_id: str, @@ -176,6 +179,7 @@ def update( cast_to=cast(Type[Override], ResultWrapper[Override]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -231,6 +235,7 @@ def list( model=Override, ) + @typing_extensions.deprecated("deprecated") def delete( self, overrides_id: str, @@ -278,6 +283,7 @@ def delete( cast_to=cast(Type[Optional[OverrideDeleteResponse]], ResultWrapper[OverrideDeleteResponse]), ) + @typing_extensions.deprecated("deprecated") def get( self, overrides_id: str, @@ -346,6 +352,7 @@ def with_streaming_response(self) -> AsyncOverridesResourceWithStreamingResponse """ return AsyncOverridesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, *, @@ -394,6 +401,7 @@ async def create( cast_to=cast(Type[Override], ResultWrapper[Override]), ) + @typing_extensions.deprecated("deprecated") async def update( self, overrides_id: str, @@ -469,6 +477,7 @@ async def update( cast_to=cast(Type[Override], ResultWrapper[Override]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -524,6 +533,7 @@ def list( model=Override, ) + @typing_extensions.deprecated("deprecated") async def delete( self, overrides_id: str, @@ -571,6 +581,7 @@ async def delete( cast_to=cast(Type[Optional[OverrideDeleteResponse]], ResultWrapper[OverrideDeleteResponse]), ) + @typing_extensions.deprecated("deprecated") async def get( self, overrides_id: str, @@ -623,20 +634,30 @@ class OverridesResourceWithRawResponse: def __init__(self, overrides: OverridesResource) -> None: self._overrides = overrides - self.create = to_raw_response_wrapper( - overrides.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + overrides.create # pyright: ignore[reportDeprecated], + ) ) - self.update = to_raw_response_wrapper( - overrides.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + overrides.update # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - overrides.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + overrides.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - overrides.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + overrides.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - overrides.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + overrides.get # pyright: ignore[reportDeprecated], + ) ) @@ -644,20 +665,30 @@ class AsyncOverridesResourceWithRawResponse: def __init__(self, overrides: AsyncOverridesResource) -> None: self._overrides = overrides - self.create = async_to_raw_response_wrapper( - overrides.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + overrides.create # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_raw_response_wrapper( - overrides.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + overrides.update # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - overrides.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + overrides.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - overrides.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + overrides.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - overrides.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + overrides.get # pyright: ignore[reportDeprecated], + ) ) @@ -665,20 +696,30 @@ class OverridesResourceWithStreamingResponse: def __init__(self, overrides: OverridesResource) -> None: self._overrides = overrides - self.create = to_streamed_response_wrapper( - overrides.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + overrides.create # pyright: ignore[reportDeprecated], + ) ) - self.update = to_streamed_response_wrapper( - overrides.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + overrides.update # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - overrides.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + overrides.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - overrides.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + overrides.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - overrides.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + overrides.get # pyright: ignore[reportDeprecated], + ) ) @@ -686,18 +727,28 @@ class AsyncOverridesResourceWithStreamingResponse: def __init__(self, overrides: AsyncOverridesResource) -> None: self._overrides = overrides - self.create = async_to_streamed_response_wrapper( - overrides.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + overrides.create # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_streamed_response_wrapper( - overrides.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + overrides.update # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_streamed_response_wrapper( - overrides.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + overrides.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - overrides.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + overrides.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - overrides.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + 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 ee03dbe09d8..53f71816ac1 100644 --- a/src/cloudflare/resources/firewall/waf/packages/groups.py +++ b/src/cloudflare/resources/firewall/waf/packages/groups.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, cast from typing_extensions import Literal @@ -48,6 +49,7 @@ def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: """ return GroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, package_id: str, @@ -135,6 +137,7 @@ def list( model=Group, ) + @typing_extensions.deprecated("deprecated") def edit( self, group_id: str, @@ -199,6 +202,7 @@ def edit( ), ) + @typing_extensions.deprecated("deprecated") def get( self, group_id: str, @@ -277,6 +281,7 @@ def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: """ return AsyncGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, package_id: str, @@ -364,6 +369,7 @@ def list( model=Group, ) + @typing_extensions.deprecated("deprecated") async def edit( self, group_id: str, @@ -428,6 +434,7 @@ async def edit( ), ) + @typing_extensions.deprecated("deprecated") async def get( self, group_id: str, @@ -490,14 +497,20 @@ class GroupsResourceWithRawResponse: def __init__(self, groups: GroupsResource) -> None: self._groups = groups - self.list = to_raw_response_wrapper( - groups.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + groups.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_raw_response_wrapper( - groups.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + groups.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - groups.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + groups.get # pyright: ignore[reportDeprecated], + ) ) @@ -505,14 +518,20 @@ class AsyncGroupsResourceWithRawResponse: def __init__(self, groups: AsyncGroupsResource) -> None: self._groups = groups - self.list = async_to_raw_response_wrapper( - groups.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + groups.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_raw_response_wrapper( - groups.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + groups.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - groups.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + groups.get # pyright: ignore[reportDeprecated], + ) ) @@ -520,14 +539,20 @@ class GroupsResourceWithStreamingResponse: def __init__(self, groups: GroupsResource) -> None: self._groups = groups - self.list = to_streamed_response_wrapper( - groups.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + groups.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_streamed_response_wrapper( - groups.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + groups.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - groups.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + groups.get # pyright: ignore[reportDeprecated], + ) ) @@ -535,12 +560,18 @@ class AsyncGroupsResourceWithStreamingResponse: def __init__(self, groups: AsyncGroupsResource) -> None: self._groups = groups - self.list = async_to_streamed_response_wrapper( - groups.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + groups.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_streamed_response_wrapper( - groups.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + groups.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - groups.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + 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 87da330b095..a671e95e6fc 100644 --- a/src/cloudflare/resources/firewall/waf/packages/packages.py +++ b/src/cloudflare/resources/firewall/waf/packages/packages.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, cast from typing_extensions import Literal @@ -69,6 +70,7 @@ def with_streaming_response(self) -> PackagesResourceWithStreamingResponse: """ return PackagesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -141,6 +143,7 @@ def list( model=object, ) + @typing_extensions.deprecated("deprecated") def get( self, package_id: str, @@ -218,6 +221,7 @@ def with_streaming_response(self) -> AsyncPackagesResourceWithStreamingResponse: """ return AsyncPackagesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -290,6 +294,7 @@ def list( model=object, ) + @typing_extensions.deprecated("deprecated") async def get( self, package_id: str, @@ -343,11 +348,15 @@ class PackagesResourceWithRawResponse: def __init__(self, packages: PackagesResource) -> None: self._packages = packages - self.list = to_raw_response_wrapper( - packages.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + packages.list # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - packages.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + packages.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -363,11 +372,15 @@ class AsyncPackagesResourceWithRawResponse: def __init__(self, packages: AsyncPackagesResource) -> None: self._packages = packages - self.list = async_to_raw_response_wrapper( - packages.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + packages.list # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - packages.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + packages.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -383,11 +396,15 @@ class PackagesResourceWithStreamingResponse: def __init__(self, packages: PackagesResource) -> None: self._packages = packages - self.list = to_streamed_response_wrapper( - packages.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + packages.list # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - packages.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + packages.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -403,11 +420,15 @@ class AsyncPackagesResourceWithStreamingResponse: def __init__(self, packages: AsyncPackagesResource) -> None: self._packages = packages - self.list = async_to_streamed_response_wrapper( - packages.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + packages.list # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - packages.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + packages.get # pyright: ignore[reportDeprecated], + ) ) @cached_property diff --git a/src/cloudflare/resources/firewall/waf/packages/rules.py b/src/cloudflare/resources/firewall/waf/packages/rules.py index 397d474ad05..cd48cc7c1ba 100644 --- a/src/cloudflare/resources/firewall/waf/packages/rules.py +++ b/src/cloudflare/resources/firewall/waf/packages/rules.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, cast from typing_extensions import Literal @@ -48,6 +49,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: """ return RulesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, package_id: str, @@ -138,6 +140,7 @@ def list( model=cast(Any, RuleListResponse), # Union types cannot be passed in as arguments in the type system ) + @typing_extensions.deprecated("deprecated") def edit( self, rule_id: str, @@ -201,6 +204,7 @@ def edit( ), ) + @typing_extensions.deprecated("deprecated") def get( self, rule_id: str, @@ -279,6 +283,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: """ return AsyncRulesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, package_id: str, @@ -369,6 +374,7 @@ def list( model=cast(Any, RuleListResponse), # Union types cannot be passed in as arguments in the type system ) + @typing_extensions.deprecated("deprecated") async def edit( self, rule_id: str, @@ -432,6 +438,7 @@ async def edit( ), ) + @typing_extensions.deprecated("deprecated") async def get( self, rule_id: str, @@ -494,14 +501,20 @@ class RulesResourceWithRawResponse: def __init__(self, rules: RulesResource) -> None: self._rules = rules - self.list = to_raw_response_wrapper( - rules.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + rules.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_raw_response_wrapper( - rules.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + rules.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - rules.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + rules.get # pyright: ignore[reportDeprecated], + ) ) @@ -509,14 +522,20 @@ class AsyncRulesResourceWithRawResponse: def __init__(self, rules: AsyncRulesResource) -> None: self._rules = rules - self.list = async_to_raw_response_wrapper( - rules.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + rules.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_raw_response_wrapper( - rules.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + rules.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - rules.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + rules.get # pyright: ignore[reportDeprecated], + ) ) @@ -524,14 +543,20 @@ class RulesResourceWithStreamingResponse: def __init__(self, rules: RulesResource) -> None: self._rules = rules - self.list = to_streamed_response_wrapper( - rules.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + rules.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_streamed_response_wrapper( - rules.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + rules.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - rules.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + rules.get # pyright: ignore[reportDeprecated], + ) ) @@ -539,12 +564,18 @@ class AsyncRulesResourceWithStreamingResponse: def __init__(self, rules: AsyncRulesResource) -> None: self._rules = rules - self.list = async_to_streamed_response_wrapper( - rules.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + rules.list # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_streamed_response_wrapper( - rules.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + rules.edit # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - rules.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + rules.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/iam/__init__.py b/src/cloudflare/resources/iam/__init__.py index a233360f769..abe916b08a4 100644 --- a/src/cloudflare/resources/iam/__init__.py +++ b/src/cloudflare/resources/iam/__init__.py @@ -8,6 +8,14 @@ IAMResourceWithStreamingResponse, AsyncIAMResourceWithStreamingResponse, ) +from .user_groups import ( + UserGroupsResource, + AsyncUserGroupsResource, + UserGroupsResourceWithRawResponse, + AsyncUserGroupsResourceWithRawResponse, + UserGroupsResourceWithStreamingResponse, + AsyncUserGroupsResourceWithStreamingResponse, +) from .resource_groups import ( ResourceGroupsResource, AsyncResourceGroupsResource, @@ -38,6 +46,12 @@ "AsyncResourceGroupsResourceWithRawResponse", "ResourceGroupsResourceWithStreamingResponse", "AsyncResourceGroupsResourceWithStreamingResponse", + "UserGroupsResource", + "AsyncUserGroupsResource", + "UserGroupsResourceWithRawResponse", + "AsyncUserGroupsResourceWithRawResponse", + "UserGroupsResourceWithStreamingResponse", + "AsyncUserGroupsResourceWithStreamingResponse", "IAMResource", "AsyncIAMResource", "IAMResourceWithRawResponse", diff --git a/src/cloudflare/resources/iam/iam.py b/src/cloudflare/resources/iam/iam.py index af426ac7b67..c517278c36f 100644 --- a/src/cloudflare/resources/iam/iam.py +++ b/src/cloudflare/resources/iam/iam.py @@ -20,6 +20,14 @@ PermissionGroupsResourceWithStreamingResponse, AsyncPermissionGroupsResourceWithStreamingResponse, ) +from .user_groups.user_groups import ( + UserGroupsResource, + AsyncUserGroupsResource, + UserGroupsResourceWithRawResponse, + AsyncUserGroupsResourceWithRawResponse, + UserGroupsResourceWithStreamingResponse, + AsyncUserGroupsResourceWithStreamingResponse, +) __all__ = ["IAMResource", "AsyncIAMResource"] @@ -33,6 +41,10 @@ def permission_groups(self) -> PermissionGroupsResource: def resource_groups(self) -> ResourceGroupsResource: return ResourceGroupsResource(self._client) + @cached_property + def user_groups(self) -> UserGroupsResource: + return UserGroupsResource(self._client) + @cached_property def with_raw_response(self) -> IAMResourceWithRawResponse: """ @@ -62,6 +74,10 @@ def permission_groups(self) -> AsyncPermissionGroupsResource: def resource_groups(self) -> AsyncResourceGroupsResource: return AsyncResourceGroupsResource(self._client) + @cached_property + def user_groups(self) -> AsyncUserGroupsResource: + return AsyncUserGroupsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncIAMResourceWithRawResponse: """ @@ -94,6 +110,10 @@ def permission_groups(self) -> PermissionGroupsResourceWithRawResponse: def resource_groups(self) -> ResourceGroupsResourceWithRawResponse: return ResourceGroupsResourceWithRawResponse(self._iam.resource_groups) + @cached_property + def user_groups(self) -> UserGroupsResourceWithRawResponse: + return UserGroupsResourceWithRawResponse(self._iam.user_groups) + class AsyncIAMResourceWithRawResponse: def __init__(self, iam: AsyncIAMResource) -> None: @@ -107,6 +127,10 @@ def permission_groups(self) -> AsyncPermissionGroupsResourceWithRawResponse: def resource_groups(self) -> AsyncResourceGroupsResourceWithRawResponse: return AsyncResourceGroupsResourceWithRawResponse(self._iam.resource_groups) + @cached_property + def user_groups(self) -> AsyncUserGroupsResourceWithRawResponse: + return AsyncUserGroupsResourceWithRawResponse(self._iam.user_groups) + class IAMResourceWithStreamingResponse: def __init__(self, iam: IAMResource) -> None: @@ -120,6 +144,10 @@ def permission_groups(self) -> PermissionGroupsResourceWithStreamingResponse: def resource_groups(self) -> ResourceGroupsResourceWithStreamingResponse: return ResourceGroupsResourceWithStreamingResponse(self._iam.resource_groups) + @cached_property + def user_groups(self) -> UserGroupsResourceWithStreamingResponse: + return UserGroupsResourceWithStreamingResponse(self._iam.user_groups) + class AsyncIAMResourceWithStreamingResponse: def __init__(self, iam: AsyncIAMResource) -> None: @@ -132,3 +160,7 @@ def permission_groups(self) -> AsyncPermissionGroupsResourceWithStreamingRespons @cached_property def resource_groups(self) -> AsyncResourceGroupsResourceWithStreamingResponse: return AsyncResourceGroupsResourceWithStreamingResponse(self._iam.resource_groups) + + @cached_property + def user_groups(self) -> AsyncUserGroupsResourceWithStreamingResponse: + return AsyncUserGroupsResourceWithStreamingResponse(self._iam.user_groups) diff --git a/src/cloudflare/resources/iam/user_groups/__init__.py b/src/cloudflare/resources/iam/user_groups/__init__.py new file mode 100644 index 00000000000..7d2d6fac17b --- /dev/null +++ b/src/cloudflare/resources/iam/user_groups/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .members import ( + MembersResource, + AsyncMembersResource, + MembersResourceWithRawResponse, + AsyncMembersResourceWithRawResponse, + MembersResourceWithStreamingResponse, + AsyncMembersResourceWithStreamingResponse, +) +from .user_groups import ( + UserGroupsResource, + AsyncUserGroupsResource, + UserGroupsResourceWithRawResponse, + AsyncUserGroupsResourceWithRawResponse, + UserGroupsResourceWithStreamingResponse, + AsyncUserGroupsResourceWithStreamingResponse, +) + +__all__ = [ + "MembersResource", + "AsyncMembersResource", + "MembersResourceWithRawResponse", + "AsyncMembersResourceWithRawResponse", + "MembersResourceWithStreamingResponse", + "AsyncMembersResourceWithStreamingResponse", + "UserGroupsResource", + "AsyncUserGroupsResource", + "UserGroupsResourceWithRawResponse", + "AsyncUserGroupsResourceWithRawResponse", + "UserGroupsResourceWithStreamingResponse", + "AsyncUserGroupsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/iam/user_groups/members.py b/src/cloudflare/resources/iam/user_groups/members.py new file mode 100644 index 00000000000..2767acd3b45 --- /dev/null +++ b/src/cloudflare/resources/iam/user_groups/members.py @@ -0,0 +1,538 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import 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 ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...._base_client import AsyncPaginator, make_request_options +from ....types.iam.user_groups import member_list_params, member_create_params, member_update_params +from ....types.iam.user_groups.member_list_response import MemberListResponse +from ....types.iam.user_groups.member_create_response import MemberCreateResponse +from ....types.iam.user_groups.member_delete_response import MemberDeleteResponse +from ....types.iam.user_groups.member_update_response import MemberUpdateResponse + +__all__ = ["MembersResource", "AsyncMembersResource"] + + +class MembersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MembersResourceWithRawResponse: + """ + 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 MembersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MembersResourceWithStreamingResponse: + """ + 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 MembersResourceWithStreamingResponse(self) + + def create( + self, + user_group_id: str, + *, + account_id: str, + body: Iterable[member_create_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[MemberCreateResponse]: + """ + Add members to a User Group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._post( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members", + body=maybe_transform(body, Iterable[member_create_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[MemberCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[MemberCreateResponse]], ResultWrapper[MemberCreateResponse]), + ) + + def update( + self, + user_group_id: str, + *, + account_id: str, + body: Iterable[member_update_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[MemberUpdateResponse]: + """ + Replace the set of members attached to a User Group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + body: Set/Replace members to a user 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 user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members", + page=SyncSinglePage[MemberUpdateResponse], + body=maybe_transform(body, Iterable[member_update_params.Body]), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=MemberUpdateResponse, + method="put", + ) + + def list( + self, + user_group_id: str, + *, + account_id: str, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncV4PagePaginationArray[MemberListResponse]: + """ + List all the members attached to a user group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members", + page=SyncV4PagePaginationArray[MemberListResponse], + 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, + }, + member_list_params.MemberListParams, + ), + ), + model=MemberListResponse, + ) + + def delete( + self, + member_id: str, + *, + account_id: str, + user_group_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[MemberDeleteResponse]: + """ + Remove a member from User Group + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + member_id: The identifier of an existing account Member. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + if not member_id: + raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}") + return self._delete( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members/{member_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[MemberDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[MemberDeleteResponse]], ResultWrapper[MemberDeleteResponse]), + ) + + +class AsyncMembersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMembersResourceWithRawResponse: + """ + 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 AsyncMembersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse: + """ + 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 AsyncMembersResourceWithStreamingResponse(self) + + async def create( + self, + user_group_id: str, + *, + account_id: str, + body: Iterable[member_create_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[MemberCreateResponse]: + """ + Add members to a User Group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return await self._post( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members", + body=await async_maybe_transform(body, Iterable[member_create_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[MemberCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[MemberCreateResponse]], ResultWrapper[MemberCreateResponse]), + ) + + def update( + self, + user_group_id: str, + *, + account_id: str, + body: Iterable[member_update_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[MemberUpdateResponse, AsyncSinglePage[MemberUpdateResponse]]: + """ + Replace the set of members attached to a User Group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + body: Set/Replace members to a user 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 user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members", + page=AsyncSinglePage[MemberUpdateResponse], + body=maybe_transform(body, Iterable[member_update_params.Body]), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=MemberUpdateResponse, + method="put", + ) + + def list( + self, + user_group_id: str, + *, + account_id: str, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[MemberListResponse, AsyncV4PagePaginationArray[MemberListResponse]]: + """ + List all the members attached to a user group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members", + page=AsyncV4PagePaginationArray[MemberListResponse], + 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, + }, + member_list_params.MemberListParams, + ), + ), + model=MemberListResponse, + ) + + async def delete( + self, + member_id: str, + *, + account_id: str, + user_group_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[MemberDeleteResponse]: + """ + Remove a member from User Group + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + member_id: The identifier of an existing account Member. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + if not member_id: + raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}") + return await self._delete( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}/members/{member_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[MemberDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[MemberDeleteResponse]], ResultWrapper[MemberDeleteResponse]), + ) + + +class MembersResourceWithRawResponse: + def __init__(self, members: MembersResource) -> None: + self._members = members + + self.create = to_raw_response_wrapper( + members.create, + ) + self.update = to_raw_response_wrapper( + members.update, + ) + self.list = to_raw_response_wrapper( + members.list, + ) + self.delete = to_raw_response_wrapper( + members.delete, + ) + + +class AsyncMembersResourceWithRawResponse: + def __init__(self, members: AsyncMembersResource) -> None: + self._members = members + + self.create = async_to_raw_response_wrapper( + members.create, + ) + self.update = async_to_raw_response_wrapper( + members.update, + ) + self.list = async_to_raw_response_wrapper( + members.list, + ) + self.delete = async_to_raw_response_wrapper( + members.delete, + ) + + +class MembersResourceWithStreamingResponse: + def __init__(self, members: MembersResource) -> None: + self._members = members + + self.create = to_streamed_response_wrapper( + members.create, + ) + self.update = to_streamed_response_wrapper( + members.update, + ) + self.list = to_streamed_response_wrapper( + members.list, + ) + self.delete = to_streamed_response_wrapper( + members.delete, + ) + + +class AsyncMembersResourceWithStreamingResponse: + def __init__(self, members: AsyncMembersResource) -> None: + self._members = members + + self.create = async_to_streamed_response_wrapper( + members.create, + ) + self.update = async_to_streamed_response_wrapper( + members.update, + ) + self.list = async_to_streamed_response_wrapper( + members.list, + ) + self.delete = async_to_streamed_response_wrapper( + members.delete, + ) diff --git a/src/cloudflare/resources/iam/user_groups/user_groups.py b/src/cloudflare/resources/iam/user_groups/user_groups.py new file mode 100644 index 00000000000..3926c47b4e2 --- /dev/null +++ b/src/cloudflare/resources/iam/user_groups/user_groups.py @@ -0,0 +1,719 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Iterable, Optional, cast + +import httpx + +from .members import ( + MembersResource, + AsyncMembersResource, + MembersResourceWithRawResponse, + AsyncMembersResourceWithRawResponse, + MembersResourceWithStreamingResponse, + AsyncMembersResourceWithStreamingResponse, +) +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 ....types.iam import user_group_list_params, user_group_create_params, user_group_update_params +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...._base_client import AsyncPaginator, make_request_options +from ....types.iam.user_group_get_response import UserGroupGetResponse +from ....types.iam.user_group_list_response import UserGroupListResponse +from ....types.iam.user_group_create_response import UserGroupCreateResponse +from ....types.iam.user_group_delete_response import UserGroupDeleteResponse +from ....types.iam.user_group_update_response import UserGroupUpdateResponse + +__all__ = ["UserGroupsResource", "AsyncUserGroupsResource"] + + +class UserGroupsResource(SyncAPIResource): + @cached_property + def members(self) -> MembersResource: + return MembersResource(self._client) + + @cached_property + def with_raw_response(self) -> UserGroupsResourceWithRawResponse: + """ + 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 UserGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UserGroupsResourceWithStreamingResponse: + """ + 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 UserGroupsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + name: str, + policies: Iterable[user_group_create_params.Policy], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[UserGroupCreateResponse]: + """ + Create a new user group under the specified account. + + Args: + account_id: Account identifier tag. + + name: Name of the User group. + + policies: Policies attached to the User 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}/iam/user_groups", + body=maybe_transform( + { + "name": name, + "policies": policies, + }, + user_group_create_params.UserGroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupCreateResponse]], ResultWrapper[UserGroupCreateResponse]), + ) + + def update( + self, + user_group_id: str, + *, + account_id: str, + name: str | NotGiven = NOT_GIVEN, + policies: Iterable[user_group_update_params.Policy] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[UserGroupUpdateResponse]: + """ + Modify an existing user group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + name: Name of the User group. + + policies: Policies attached to the User 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 user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._put( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}", + body=maybe_transform( + { + "name": name, + "policies": policies, + }, + user_group_update_params.UserGroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupUpdateResponse]], ResultWrapper[UserGroupUpdateResponse]), + ) + + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[UserGroupListResponse]: + """ + List all the user groups for an account. + + Args: + account_id: Account identifier tag. + + id: ID of the user group to be fetched. + + direction: The sort order of returned user groups by name. Default sort order is ascending. + To switch to descending, set this parameter to "desc" + + fuzzy_name: A string used for searching for user groups containing that substring. + + name: Name of the user 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 + + 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}/iam/user_groups", + page=SyncV4PagePaginationArray[UserGroupListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "direction": direction, + "fuzzy_name": fuzzy_name, + "name": name, + "page": page, + "per_page": per_page, + }, + user_group_list_params.UserGroupListParams, + ), + ), + model=UserGroupListResponse, + ) + + def delete( + self, + user_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, + ) -> Optional[UserGroupDeleteResponse]: + """ + Remove a user group from an account. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._delete( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupDeleteResponse]], ResultWrapper[UserGroupDeleteResponse]), + ) + + def get( + self, + user_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, + ) -> Optional[UserGroupGetResponse]: + """ + Get information about a specific user group in an account. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return self._get( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupGetResponse]], ResultWrapper[UserGroupGetResponse]), + ) + + +class AsyncUserGroupsResource(AsyncAPIResource): + @cached_property + def members(self) -> AsyncMembersResource: + return AsyncMembersResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncUserGroupsResourceWithRawResponse: + """ + 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 AsyncUserGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUserGroupsResourceWithStreamingResponse: + """ + 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 AsyncUserGroupsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + name: str, + policies: Iterable[user_group_create_params.Policy], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[UserGroupCreateResponse]: + """ + Create a new user group under the specified account. + + Args: + account_id: Account identifier tag. + + name: Name of the User group. + + policies: Policies attached to the User 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}/iam/user_groups", + body=await async_maybe_transform( + { + "name": name, + "policies": policies, + }, + user_group_create_params.UserGroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupCreateResponse]], ResultWrapper[UserGroupCreateResponse]), + ) + + async def update( + self, + user_group_id: str, + *, + account_id: str, + name: str | NotGiven = NOT_GIVEN, + policies: Iterable[user_group_update_params.Policy] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[UserGroupUpdateResponse]: + """ + Modify an existing user group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + name: Name of the User group. + + policies: Policies attached to the User 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 user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return await self._put( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}", + body=await async_maybe_transform( + { + "name": name, + "policies": policies, + }, + user_group_update_params.UserGroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupUpdateResponse]], ResultWrapper[UserGroupUpdateResponse]), + ) + + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[UserGroupListResponse, AsyncV4PagePaginationArray[UserGroupListResponse]]: + """ + List all the user groups for an account. + + Args: + account_id: Account identifier tag. + + id: ID of the user group to be fetched. + + direction: The sort order of returned user groups by name. Default sort order is ascending. + To switch to descending, set this parameter to "desc" + + fuzzy_name: A string used for searching for user groups containing that substring. + + name: Name of the user 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 + + 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}/iam/user_groups", + page=AsyncV4PagePaginationArray[UserGroupListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "direction": direction, + "fuzzy_name": fuzzy_name, + "name": name, + "page": page, + "per_page": per_page, + }, + user_group_list_params.UserGroupListParams, + ), + ), + model=UserGroupListResponse, + ) + + async def delete( + self, + user_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, + ) -> Optional[UserGroupDeleteResponse]: + """ + Remove a user group from an account. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return await self._delete( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupDeleteResponse]], ResultWrapper[UserGroupDeleteResponse]), + ) + + async def get( + self, + user_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, + ) -> Optional[UserGroupGetResponse]: + """ + Get information about a specific user group in an account. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + return await self._get( + f"/accounts/{account_id}/iam/user_groups/{user_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGroupGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGroupGetResponse]], ResultWrapper[UserGroupGetResponse]), + ) + + +class UserGroupsResourceWithRawResponse: + def __init__(self, user_groups: UserGroupsResource) -> None: + self._user_groups = user_groups + + self.create = to_raw_response_wrapper( + user_groups.create, + ) + self.update = to_raw_response_wrapper( + user_groups.update, + ) + self.list = to_raw_response_wrapper( + user_groups.list, + ) + self.delete = to_raw_response_wrapper( + user_groups.delete, + ) + self.get = to_raw_response_wrapper( + user_groups.get, + ) + + @cached_property + def members(self) -> MembersResourceWithRawResponse: + return MembersResourceWithRawResponse(self._user_groups.members) + + +class AsyncUserGroupsResourceWithRawResponse: + def __init__(self, user_groups: AsyncUserGroupsResource) -> None: + self._user_groups = user_groups + + self.create = async_to_raw_response_wrapper( + user_groups.create, + ) + self.update = async_to_raw_response_wrapper( + user_groups.update, + ) + self.list = async_to_raw_response_wrapper( + user_groups.list, + ) + self.delete = async_to_raw_response_wrapper( + user_groups.delete, + ) + self.get = async_to_raw_response_wrapper( + user_groups.get, + ) + + @cached_property + def members(self) -> AsyncMembersResourceWithRawResponse: + return AsyncMembersResourceWithRawResponse(self._user_groups.members) + + +class UserGroupsResourceWithStreamingResponse: + def __init__(self, user_groups: UserGroupsResource) -> None: + self._user_groups = user_groups + + self.create = to_streamed_response_wrapper( + user_groups.create, + ) + self.update = to_streamed_response_wrapper( + user_groups.update, + ) + self.list = to_streamed_response_wrapper( + user_groups.list, + ) + self.delete = to_streamed_response_wrapper( + user_groups.delete, + ) + self.get = to_streamed_response_wrapper( + user_groups.get, + ) + + @cached_property + def members(self) -> MembersResourceWithStreamingResponse: + return MembersResourceWithStreamingResponse(self._user_groups.members) + + +class AsyncUserGroupsResourceWithStreamingResponse: + def __init__(self, user_groups: AsyncUserGroupsResource) -> None: + self._user_groups = user_groups + + self.create = async_to_streamed_response_wrapper( + user_groups.create, + ) + self.update = async_to_streamed_response_wrapper( + user_groups.update, + ) + self.list = async_to_streamed_response_wrapper( + user_groups.list, + ) + self.delete = async_to_streamed_response_wrapper( + user_groups.delete, + ) + self.get = async_to_streamed_response_wrapper( + user_groups.get, + ) + + @cached_property + def members(self) -> AsyncMembersResourceWithStreamingResponse: + return AsyncMembersResourceWithStreamingResponse(self._user_groups.members) diff --git a/src/cloudflare/resources/images/v1/v1.py b/src/cloudflare/resources/images/v1/v1.py index 1a69dd79e9a..dda2c2061d3 100644 --- a/src/cloudflare/resources/images/v1/v1.py +++ b/src/cloudflare/resources/images/v1/v1.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, Type, cast import httpx @@ -163,6 +164,7 @@ def create( cast_to=cast(Type[Image], ResultWrapper[Image]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -479,6 +481,7 @@ async def create( cast_to=cast(Type[Image], ResultWrapper[Image]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -698,8 +701,10 @@ def __init__(self, v1: V1Resource) -> None: self.create = to_raw_response_wrapper( v1.create, ) - self.list = to_raw_response_wrapper( - v1.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + v1.list # pyright: ignore[reportDeprecated], + ) ) self.delete = to_raw_response_wrapper( v1.delete, @@ -735,8 +740,10 @@ def __init__(self, v1: AsyncV1Resource) -> None: self.create = async_to_raw_response_wrapper( v1.create, ) - self.list = async_to_raw_response_wrapper( - v1.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + v1.list # pyright: ignore[reportDeprecated], + ) ) self.delete = async_to_raw_response_wrapper( v1.delete, @@ -772,8 +779,10 @@ def __init__(self, v1: V1Resource) -> None: self.create = to_streamed_response_wrapper( v1.create, ) - self.list = to_streamed_response_wrapper( - v1.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + v1.list # pyright: ignore[reportDeprecated], + ) ) self.delete = to_streamed_response_wrapper( v1.delete, @@ -809,8 +818,10 @@ def __init__(self, v1: AsyncV1Resource) -> None: self.create = async_to_streamed_response_wrapper( v1.create, ) - self.list = async_to_streamed_response_wrapper( - v1.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + v1.list # pyright: ignore[reportDeprecated], + ) ) self.delete = async_to_streamed_response_wrapper( v1.delete, diff --git a/src/cloudflare/resources/intel/attack_surface_report/issues.py b/src/cloudflare/resources/intel/attack_surface_report/issues.py index c7627c5a9f7..b1054cd0427 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issues.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issues.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Optional, cast import httpx @@ -57,6 +58,7 @@ def with_streaming_response(self) -> IssuesResourceWithStreamingResponse: """ return IssuesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -131,6 +133,7 @@ def list( model=IssueListResponse, ) + @typing_extensions.deprecated("deprecated") def class_( self, *, @@ -197,6 +200,7 @@ def class_( cast_to=cast(Type[Optional[IssueClassResponse]], ResultWrapper[IssueClassResponse]), ) + @typing_extensions.deprecated("deprecated") def dismiss( self, issue_id: str, @@ -237,6 +241,7 @@ def dismiss( cast_to=IssueDismissResponse, ) + @typing_extensions.deprecated("deprecated") def severity( self, *, @@ -303,6 +308,7 @@ def severity( cast_to=cast(Type[Optional[IssueSeverityResponse]], ResultWrapper[IssueSeverityResponse]), ) + @typing_extensions.deprecated("deprecated") def type( self, *, @@ -390,6 +396,7 @@ def with_streaming_response(self) -> AsyncIssuesResourceWithStreamingResponse: """ return AsyncIssuesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -464,6 +471,7 @@ def list( model=IssueListResponse, ) + @typing_extensions.deprecated("deprecated") async def class_( self, *, @@ -530,6 +538,7 @@ async def class_( cast_to=cast(Type[Optional[IssueClassResponse]], ResultWrapper[IssueClassResponse]), ) + @typing_extensions.deprecated("deprecated") async def dismiss( self, issue_id: str, @@ -570,6 +579,7 @@ async def dismiss( cast_to=IssueDismissResponse, ) + @typing_extensions.deprecated("deprecated") async def severity( self, *, @@ -636,6 +646,7 @@ async def severity( cast_to=cast(Type[Optional[IssueSeverityResponse]], ResultWrapper[IssueSeverityResponse]), ) + @typing_extensions.deprecated("deprecated") async def type( self, *, @@ -707,20 +718,30 @@ class IssuesResourceWithRawResponse: def __init__(self, issues: IssuesResource) -> None: self._issues = issues - self.list = to_raw_response_wrapper( - issues.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + issues.list # pyright: ignore[reportDeprecated], + ) ) - self.class_ = to_raw_response_wrapper( - issues.class_, + self.class_ = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + issues.class_ # pyright: ignore[reportDeprecated], + ) ) - self.dismiss = to_raw_response_wrapper( - issues.dismiss, + self.dismiss = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + issues.dismiss # pyright: ignore[reportDeprecated], + ) ) - self.severity = to_raw_response_wrapper( - issues.severity, + self.severity = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + issues.severity # pyright: ignore[reportDeprecated], + ) ) - self.type = to_raw_response_wrapper( - issues.type, + self.type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + issues.type # pyright: ignore[reportDeprecated], + ) ) @@ -728,20 +749,30 @@ class AsyncIssuesResourceWithRawResponse: def __init__(self, issues: AsyncIssuesResource) -> None: self._issues = issues - self.list = async_to_raw_response_wrapper( - issues.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + issues.list # pyright: ignore[reportDeprecated], + ) ) - self.class_ = async_to_raw_response_wrapper( - issues.class_, + self.class_ = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + issues.class_ # pyright: ignore[reportDeprecated], + ) ) - self.dismiss = async_to_raw_response_wrapper( - issues.dismiss, + self.dismiss = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + issues.dismiss # pyright: ignore[reportDeprecated], + ) ) - self.severity = async_to_raw_response_wrapper( - issues.severity, + self.severity = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + issues.severity # pyright: ignore[reportDeprecated], + ) ) - self.type = async_to_raw_response_wrapper( - issues.type, + self.type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + issues.type # pyright: ignore[reportDeprecated], + ) ) @@ -749,20 +780,30 @@ class IssuesResourceWithStreamingResponse: def __init__(self, issues: IssuesResource) -> None: self._issues = issues - self.list = to_streamed_response_wrapper( - issues.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + issues.list # pyright: ignore[reportDeprecated], + ) ) - self.class_ = to_streamed_response_wrapper( - issues.class_, + self.class_ = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + issues.class_ # pyright: ignore[reportDeprecated], + ) ) - self.dismiss = to_streamed_response_wrapper( - issues.dismiss, + self.dismiss = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + issues.dismiss # pyright: ignore[reportDeprecated], + ) ) - self.severity = to_streamed_response_wrapper( - issues.severity, + self.severity = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + issues.severity # pyright: ignore[reportDeprecated], + ) ) - self.type = to_streamed_response_wrapper( - issues.type, + self.type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + issues.type # pyright: ignore[reportDeprecated], + ) ) @@ -770,18 +811,28 @@ class AsyncIssuesResourceWithStreamingResponse: def __init__(self, issues: AsyncIssuesResource) -> None: self._issues = issues - self.list = async_to_streamed_response_wrapper( - issues.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + issues.list # pyright: ignore[reportDeprecated], + ) ) - self.class_ = async_to_streamed_response_wrapper( - issues.class_, + self.class_ = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + issues.class_ # pyright: ignore[reportDeprecated], + ) ) - self.dismiss = async_to_streamed_response_wrapper( - issues.dismiss, + self.dismiss = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + issues.dismiss # pyright: ignore[reportDeprecated], + ) ) - self.severity = async_to_streamed_response_wrapper( - issues.severity, + self.severity = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + issues.severity # pyright: ignore[reportDeprecated], + ) ) - self.type = async_to_streamed_response_wrapper( - issues.type, + self.type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + issues.type # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/kv/namespaces/keys.py b/src/cloudflare/resources/kv/namespaces/keys.py index c2a3fcc1aab..6b5b71f0bb4 100644 --- a/src/cloudflare/resources/kv/namespaces/keys.py +++ b/src/cloudflare/resources/kv/namespaces/keys.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, List, Type, Iterable, Optional, cast from typing_extensions import Literal @@ -115,6 +116,7 @@ def list( model=Key, ) + @typing_extensions.deprecated("Please use kv.namespaces.bulk_delete instead") def bulk_delete( self, namespace_id: str, @@ -163,6 +165,7 @@ def bulk_delete( cast_to=cast(Type[Optional[KeyBulkDeleteResponse]], ResultWrapper[KeyBulkDeleteResponse]), ) + @typing_extensions.deprecated("Please use kv.namespaces.bulk_get instead") def bulk_get( self, namespace_id: str, @@ -233,6 +236,7 @@ def bulk_get( ), ) + @typing_extensions.deprecated("Please use kv.namespaces.bulk_update instead") def bulk_update( self, namespace_id: str, @@ -372,6 +376,7 @@ def list( model=Key, ) + @typing_extensions.deprecated("Please use kv.namespaces.bulk_delete instead") async def bulk_delete( self, namespace_id: str, @@ -420,6 +425,7 @@ async def bulk_delete( cast_to=cast(Type[Optional[KeyBulkDeleteResponse]], ResultWrapper[KeyBulkDeleteResponse]), ) + @typing_extensions.deprecated("Please use kv.namespaces.bulk_get instead") async def bulk_get( self, namespace_id: str, @@ -490,6 +496,7 @@ async def bulk_get( ), ) + @typing_extensions.deprecated("Please use kv.namespaces.bulk_update instead") async def bulk_update( self, namespace_id: str, @@ -550,14 +557,20 @@ def __init__(self, keys: KeysResource) -> None: self.list = to_raw_response_wrapper( keys.list, ) - self.bulk_delete = to_raw_response_wrapper( - keys.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + keys.bulk_delete # pyright: ignore[reportDeprecated], + ) ) - self.bulk_get = to_raw_response_wrapper( - keys.bulk_get, + self.bulk_get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + keys.bulk_get # pyright: ignore[reportDeprecated], + ) ) - self.bulk_update = to_raw_response_wrapper( - keys.bulk_update, + self.bulk_update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + keys.bulk_update # pyright: ignore[reportDeprecated], + ) ) @@ -568,14 +581,20 @@ def __init__(self, keys: AsyncKeysResource) -> None: self.list = async_to_raw_response_wrapper( keys.list, ) - self.bulk_delete = async_to_raw_response_wrapper( - keys.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + keys.bulk_delete # pyright: ignore[reportDeprecated], + ) ) - self.bulk_get = async_to_raw_response_wrapper( - keys.bulk_get, + self.bulk_get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + keys.bulk_get # pyright: ignore[reportDeprecated], + ) ) - self.bulk_update = async_to_raw_response_wrapper( - keys.bulk_update, + self.bulk_update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + keys.bulk_update # pyright: ignore[reportDeprecated], + ) ) @@ -586,14 +605,20 @@ def __init__(self, keys: KeysResource) -> None: self.list = to_streamed_response_wrapper( keys.list, ) - self.bulk_delete = to_streamed_response_wrapper( - keys.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + keys.bulk_delete # pyright: ignore[reportDeprecated], + ) ) - self.bulk_get = to_streamed_response_wrapper( - keys.bulk_get, + self.bulk_get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + keys.bulk_get # pyright: ignore[reportDeprecated], + ) ) - self.bulk_update = to_streamed_response_wrapper( - keys.bulk_update, + self.bulk_update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + keys.bulk_update # pyright: ignore[reportDeprecated], + ) ) @@ -604,12 +629,18 @@ def __init__(self, keys: AsyncKeysResource) -> None: self.list = async_to_streamed_response_wrapper( keys.list, ) - self.bulk_delete = async_to_streamed_response_wrapper( - keys.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + keys.bulk_delete # pyright: ignore[reportDeprecated], + ) ) - self.bulk_get = async_to_streamed_response_wrapper( - keys.bulk_get, + self.bulk_get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + keys.bulk_get # pyright: ignore[reportDeprecated], + ) ) - self.bulk_update = async_to_streamed_response_wrapper( - keys.bulk_update, + self.bulk_update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + keys.bulk_update # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index 463915273a7..d033b2e28ab 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 Type, Optional, cast +from typing import Any, List, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -34,7 +34,13 @@ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property -from ....types.kv import namespace_list_params, namespace_create_params, namespace_update_params +from ....types.kv import ( + namespace_list_params, + namespace_create_params, + namespace_update_params, + namespace_bulk_get_params, + namespace_bulk_update_params, +) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( to_raw_response_wrapper, @@ -47,6 +53,9 @@ from ...._base_client import AsyncPaginator, make_request_options from ....types.kv.namespace import Namespace from ....types.kv.namespace_delete_response import NamespaceDeleteResponse +from ....types.kv.namespace_bulk_get_response import NamespaceBulkGetResponse +from ....types.kv.namespace_bulk_delete_response import NamespaceBulkDeleteResponse +from ....types.kv.namespace_bulk_update_response import NamespaceBulkUpdateResponse __all__ = ["NamespacesResource", "AsyncNamespacesResource"] @@ -281,6 +290,176 @@ def delete( cast_to=cast(Type[Optional[NamespaceDeleteResponse]], ResultWrapper[NamespaceDeleteResponse]), ) + def bulk_delete( + self, + namespace_id: str, + *, + account_id: str, + body: List[str], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[NamespaceBulkDeleteResponse]: + """Remove multiple KV pairs from the namespace. + + Body should be an array of up to + 10,000 keys to be removed. + + Args: + account_id: Identifier + + namespace_id: Namespace identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not namespace_id: + 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]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[NamespaceBulkDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[NamespaceBulkDeleteResponse]], ResultWrapper[NamespaceBulkDeleteResponse]), + ) + + def bulk_get( + self, + namespace_id: str, + *, + account_id: str, + keys: List[str], + type: Literal["text", "json"] | NotGiven = NOT_GIVEN, + with_metadata: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[NamespaceBulkGetResponse]: + """Get multiple 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. + + Args: + account_id: Identifier + + namespace_id: Namespace identifier tag. + + keys: Array of keys to retrieve (maximum 100) + + type: Whether to parse JSON values in the response + + with_metadata: Whether to include metadata 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not namespace_id: + raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") + return cast( + Optional[NamespaceBulkGetResponse], + self._post( + f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/get", + body=maybe_transform( + { + "keys": keys, + "type": type, + "with_metadata": with_metadata, + }, + namespace_bulk_get_params.NamespaceBulkGetParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[NamespaceBulkGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[NamespaceBulkGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def bulk_update( + self, + namespace_id: str, + *, + account_id: str, + body: Iterable[namespace_bulk_update_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[NamespaceBulkUpdateResponse]: + """Write multiple keys and values at once. + + Body should be an array of up to 10,000 + key-value pairs to be stored, along with optional expiration information. + Existing values and expirations will be overwritten. If neither `expiration` nor + `expiration_ttl` is specified, the key-value pair will never expire. If both are + set, `expiration_ttl` is used and `expiration` is ignored. The entire request + size must be 100 megabytes or less. + + Args: + account_id: Identifier + + namespace_id: Namespace identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not namespace_id: + raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") + return self._put( + f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk", + body=maybe_transform(body, Iterable[namespace_bulk_update_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[NamespaceBulkUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[NamespaceBulkUpdateResponse]], ResultWrapper[NamespaceBulkUpdateResponse]), + ) + def get( self, namespace_id: str, @@ -556,6 +735,176 @@ async def delete( cast_to=cast(Type[Optional[NamespaceDeleteResponse]], ResultWrapper[NamespaceDeleteResponse]), ) + async def bulk_delete( + self, + namespace_id: str, + *, + account_id: str, + body: List[str], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[NamespaceBulkDeleteResponse]: + """Remove multiple KV pairs from the namespace. + + Body should be an array of up to + 10,000 keys to be removed. + + Args: + account_id: Identifier + + namespace_id: Namespace identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not namespace_id: + 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]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[NamespaceBulkDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[NamespaceBulkDeleteResponse]], ResultWrapper[NamespaceBulkDeleteResponse]), + ) + + async def bulk_get( + self, + namespace_id: str, + *, + account_id: str, + keys: List[str], + type: Literal["text", "json"] | NotGiven = NOT_GIVEN, + with_metadata: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[NamespaceBulkGetResponse]: + """Get multiple 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. + + Args: + account_id: Identifier + + namespace_id: Namespace identifier tag. + + keys: Array of keys to retrieve (maximum 100) + + type: Whether to parse JSON values in the response + + with_metadata: Whether to include metadata 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not namespace_id: + raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") + return cast( + Optional[NamespaceBulkGetResponse], + await self._post( + f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/get", + body=await async_maybe_transform( + { + "keys": keys, + "type": type, + "with_metadata": with_metadata, + }, + namespace_bulk_get_params.NamespaceBulkGetParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[NamespaceBulkGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[NamespaceBulkGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def bulk_update( + self, + namespace_id: str, + *, + account_id: str, + body: Iterable[namespace_bulk_update_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[NamespaceBulkUpdateResponse]: + """Write multiple keys and values at once. + + Body should be an array of up to 10,000 + key-value pairs to be stored, along with optional expiration information. + Existing values and expirations will be overwritten. If neither `expiration` nor + `expiration_ttl` is specified, the key-value pair will never expire. If both are + set, `expiration_ttl` is used and `expiration` is ignored. The entire request + size must be 100 megabytes or less. + + Args: + account_id: Identifier + + namespace_id: Namespace identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not namespace_id: + raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") + return await self._put( + f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk", + body=await async_maybe_transform(body, Iterable[namespace_bulk_update_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[NamespaceBulkUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[NamespaceBulkUpdateResponse]], ResultWrapper[NamespaceBulkUpdateResponse]), + ) + async def get( self, namespace_id: str, @@ -617,6 +966,15 @@ def __init__(self, namespaces: NamespacesResource) -> None: self.delete = to_raw_response_wrapper( namespaces.delete, ) + self.bulk_delete = to_raw_response_wrapper( + namespaces.bulk_delete, + ) + self.bulk_get = to_raw_response_wrapper( + namespaces.bulk_get, + ) + self.bulk_update = to_raw_response_wrapper( + namespaces.bulk_update, + ) self.get = to_raw_response_wrapper( namespaces.get, ) @@ -650,6 +1008,15 @@ def __init__(self, namespaces: AsyncNamespacesResource) -> None: self.delete = async_to_raw_response_wrapper( namespaces.delete, ) + self.bulk_delete = async_to_raw_response_wrapper( + namespaces.bulk_delete, + ) + self.bulk_get = async_to_raw_response_wrapper( + namespaces.bulk_get, + ) + self.bulk_update = async_to_raw_response_wrapper( + namespaces.bulk_update, + ) self.get = async_to_raw_response_wrapper( namespaces.get, ) @@ -683,6 +1050,15 @@ def __init__(self, namespaces: NamespacesResource) -> None: self.delete = to_streamed_response_wrapper( namespaces.delete, ) + self.bulk_delete = to_streamed_response_wrapper( + namespaces.bulk_delete, + ) + self.bulk_get = to_streamed_response_wrapper( + namespaces.bulk_get, + ) + self.bulk_update = to_streamed_response_wrapper( + namespaces.bulk_update, + ) self.get = to_streamed_response_wrapper( namespaces.get, ) @@ -716,6 +1092,15 @@ def __init__(self, namespaces: AsyncNamespacesResource) -> None: self.delete = async_to_streamed_response_wrapper( namespaces.delete, ) + self.bulk_delete = async_to_streamed_response_wrapper( + namespaces.bulk_delete, + ) + self.bulk_get = async_to_streamed_response_wrapper( + namespaces.bulk_get, + ) + self.bulk_update = async_to_streamed_response_wrapper( + namespaces.bulk_update, + ) self.get = async_to_streamed_response_wrapper( namespaces.get, ) diff --git a/src/cloudflare/resources/load_balancers/searches.py b/src/cloudflare/resources/load_balancers/searches.py index 33f25038c18..346a0832936 100644 --- a/src/cloudflare/resources/load_balancers/searches.py +++ b/src/cloudflare/resources/load_balancers/searches.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -48,7 +50,8 @@ def list( account_id: str, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, - search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN, + query: str | NotGiven = NOT_GIVEN, + references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -62,6 +65,11 @@ def list( Args: account_id: Identifier + query: Search query term. + + references: The type of references to include. "\\**" to include both referral and referrer + references. "" to not include any reference information. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,7 +92,8 @@ def list( { "page": page, "per_page": per_page, - "search_params": search_params, + "query": query, + "references": references, }, search_list_params.SearchListParams, ), @@ -119,7 +128,8 @@ def list( account_id: str, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, - search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN, + query: str | NotGiven = NOT_GIVEN, + references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -133,6 +143,11 @@ def list( Args: account_id: Identifier + query: Search query term. + + references: The type of references to include. "\\**" to include both referral and referrer + references. "" to not include any reference information. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -155,7 +170,8 @@ def list( { "page": page, "per_page": per_page, - "search_params": search_params, + "query": query, + "references": references, }, search_list_params.SearchListParams, ), diff --git a/src/cloudflare/resources/logs/control/cmb/config.py b/src/cloudflare/resources/logs/control/cmb/config.py index 91b9737db41..7d18ee257da 100644 --- a/src/cloudflare/resources/logs/control/cmb/config.py +++ b/src/cloudflare/resources/logs/control/cmb/config.py @@ -48,6 +48,7 @@ def create( self, *, account_id: str, + allow_out_of_region_access: bool | NotGiven = NOT_GIVEN, regions: 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. @@ -62,6 +63,8 @@ def create( Args: account_id: Identifier. + allow_out_of_region_access: Allow out of region access + regions: Name of the region. extra_headers: Send extra headers @@ -76,7 +79,13 @@ 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}/logs/control/cmb/config", - body=maybe_transform({"regions": regions}, config_create_params.ConfigCreateParams), + body=maybe_transform( + { + "allow_out_of_region_access": allow_out_of_region_access, + "regions": regions, + }, + config_create_params.ConfigCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -190,6 +199,7 @@ async def create( self, *, account_id: str, + allow_out_of_region_access: bool | NotGiven = NOT_GIVEN, regions: 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. @@ -204,6 +214,8 @@ async def create( Args: account_id: Identifier. + allow_out_of_region_access: Allow out of region access + regions: Name of the region. extra_headers: Send extra headers @@ -218,7 +230,13 @@ 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}/logs/control/cmb/config", - body=await async_maybe_transform({"regions": regions}, config_create_params.ConfigCreateParams), + body=await async_maybe_transform( + { + "allow_out_of_region_access": allow_out_of_region_access, + "regions": regions, + }, + config_create_params.ConfigCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/magic_transit/connectors/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py index dc6f6f5102f..0af23684c7b 100644 --- a/src/cloudflare/resources/magic_transit/connectors/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py @@ -93,6 +93,8 @@ def update( Replace Connector Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -142,6 +144,8 @@ def list( List Connectors Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -182,6 +186,8 @@ def edit( Update Connector Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -232,6 +238,8 @@ def get( Fetch Connector Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -306,6 +314,8 @@ async def update( Replace Connector Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -355,6 +365,8 @@ def list( List Connectors Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -395,6 +407,8 @@ async def edit( Update Connector Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -445,6 +459,8 @@ async def get( Fetch Connector Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/magic_transit/connectors/events/events.py b/src/cloudflare/resources/magic_transit/connectors/events/events.py index 5a1fa26fafd..e549050a08e 100644 --- a/src/cloudflare/resources/magic_transit/connectors/events/events.py +++ b/src/cloudflare/resources/magic_transit/connectors/events/events.py @@ -61,7 +61,7 @@ def list( self, connector_id: str, *, - account_id: float, + account_id: str, from_: float, to: float, cursor: str | NotGiven = NOT_GIVEN, @@ -77,6 +77,8 @@ def list( List Events Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -85,6 +87,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return self._get( @@ -112,7 +116,7 @@ def get( self, event_n: float, *, - account_id: float, + account_id: str, connector_id: str, event_t: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -126,6 +130,8 @@ def get( Get Event Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -134,6 +140,8 @@ def get( 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._get( @@ -177,7 +185,7 @@ async def list( self, connector_id: str, *, - account_id: float, + account_id: str, from_: float, to: float, cursor: str | NotGiven = NOT_GIVEN, @@ -193,6 +201,8 @@ async def list( List Events Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -201,6 +211,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return await self._get( @@ -228,7 +240,7 @@ async def get( self, event_n: float, *, - account_id: float, + account_id: str, connector_id: str, event_t: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -242,6 +254,8 @@ async def get( Get Event Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,6 +264,8 @@ async def get( 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._get( diff --git a/src/cloudflare/resources/magic_transit/connectors/events/latest.py b/src/cloudflare/resources/magic_transit/connectors/events/latest.py index ac871d2a1db..4b3fa920a82 100644 --- a/src/cloudflare/resources/magic_transit/connectors/events/latest.py +++ b/src/cloudflare/resources/magic_transit/connectors/events/latest.py @@ -46,7 +46,7 @@ def list( self, connector_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -58,6 +58,8 @@ def list( Get latest Events Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -66,6 +68,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return self._get( @@ -105,7 +109,7 @@ async def list( self, connector_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -117,6 +121,8 @@ async def list( Get latest Events Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -125,6 +131,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return await self._get( diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py b/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py index fe612124b0f..3b55a6e40b6 100644 --- a/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py @@ -46,7 +46,7 @@ def list( self, connector_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -58,6 +58,8 @@ def list( Get latest Snapshots Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -66,6 +68,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return self._get( @@ -105,7 +109,7 @@ async def list( self, connector_id: str, *, - account_id: float, + account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -117,6 +121,8 @@ async def list( Get latest Snapshots Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -125,6 +131,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return await self._get( diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py b/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py index 3598fa3d14a..0d441ae8828 100644 --- a/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py @@ -61,7 +61,7 @@ def list( self, connector_id: str, *, - account_id: float, + account_id: str, from_: float, to: float, cursor: str | NotGiven = NOT_GIVEN, @@ -77,6 +77,8 @@ def list( List Snapshots Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -85,6 +87,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return self._get( @@ -112,7 +116,7 @@ def get( self, snapshot_t: float, *, - account_id: float, + account_id: str, connector_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -125,6 +129,8 @@ def get( Get Snapshot Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -133,6 +139,8 @@ def get( 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._get( @@ -176,7 +184,7 @@ async def list( self, connector_id: str, *, - account_id: float, + account_id: str, from_: float, to: float, cursor: str | NotGiven = NOT_GIVEN, @@ -192,6 +200,8 @@ async def list( List Snapshots Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -200,6 +210,8 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") return await self._get( @@ -227,7 +239,7 @@ async def get( self, snapshot_t: float, *, - account_id: float, + account_id: str, connector_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -240,6 +252,8 @@ async def get( Get Snapshot Args: + account_id: Account identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -248,6 +262,8 @@ async def get( 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._get( diff --git a/src/cloudflare/resources/network_interconnects/cnis.py b/src/cloudflare/resources/network_interconnects/cnis.py index 69beb3e21aa..3b3cb1c11bd 100644 --- a/src/cloudflare/resources/network_interconnects/cnis.py +++ b/src/cloudflare/resources/network_interconnects/cnis.py @@ -170,6 +170,7 @@ def list( 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -185,6 +186,8 @@ def list( slot: If specified, only show CNIs associated with the specified slot + tunnel_id: If specified, only show cnis associated with the specified tunnel id + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -207,6 +210,7 @@ def list( "cursor": cursor, "limit": limit, "slot": slot, + "tunnel_id": tunnel_id, }, cni_list_params.CNIListParams, ), @@ -436,6 +440,7 @@ async def list( 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -451,6 +456,8 @@ async def list( slot: If specified, only show CNIs associated with the specified slot + tunnel_id: If specified, only show cnis associated with the specified tunnel id + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -473,6 +480,7 @@ async def list( "cursor": cursor, "limit": limit, "slot": slot, + "tunnel_id": tunnel_id, }, cni_list_params.CNIListParams, ), diff --git a/src/cloudflare/resources/queues/messages.py b/src/cloudflare/resources/queues/messages.py index e9f0ba035fd..faad5789f8d 100644 --- a/src/cloudflare/resources/queues/messages.py +++ b/src/cloudflare/resources/queues/messages.py @@ -18,8 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import make_request_options from ...types.queues import message_ack_params, message_pull_params, message_push_params, message_bulk_push_params from ...types.queues.message_ack_response import MessageAckResponse from ...types.queues.message_pull_response import MessagePullResponse @@ -166,7 +165,7 @@ def pull( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[MessagePullResponse]: + ) -> Optional[MessagePullResponse]: """ Pull a batch of messages from a Queue @@ -192,9 +191,8 @@ def pull( 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( + return self._post( f"/accounts/{account_id}/queues/{queue_id}/messages/pull", - page=SyncSinglePage[MessagePullResponse], body=maybe_transform( { "batch_size": batch_size, @@ -203,10 +201,13 @@ def pull( message_pull_params.MessagePullParams, ), 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[MessagePullResponse]]._unwrapper, ), - model=MessagePullResponse, - method="post", + cast_to=cast(Type[Optional[MessagePullResponse]], ResultWrapper[MessagePullResponse]), ) @overload @@ -444,7 +445,7 @@ async def bulk_push( cast_to=MessageBulkPushResponse, ) - def pull( + async def pull( self, queue_id: str, *, @@ -457,7 +458,7 @@ def pull( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[MessagePullResponse, AsyncSinglePage[MessagePullResponse]]: + ) -> Optional[MessagePullResponse]: """ Pull a batch of messages from a Queue @@ -483,10 +484,9 @@ def pull( 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( + return await self._post( f"/accounts/{account_id}/queues/{queue_id}/messages/pull", - page=AsyncSinglePage[MessagePullResponse], - body=maybe_transform( + body=await async_maybe_transform( { "batch_size": batch_size, "visibility_timeout_ms": visibility_timeout_ms, @@ -494,10 +494,13 @@ def pull( message_pull_params.MessagePullParams, ), 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[MessagePullResponse]]._unwrapper, ), - model=MessagePullResponse, - method="post", + cast_to=cast(Type[Optional[MessagePullResponse]], ResultWrapper[MessagePullResponse]), ) @overload diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/top.py b/src/cloudflare/resources/radar/attacks/layer3/top/top.py index 525964fe3e2..8a901841d66 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/top.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 @@ -169,6 +170,7 @@ def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) + @typing_extensions.deprecated("deprecated") def industry( self, *, @@ -256,6 +258,7 @@ def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) + @typing_extensions.deprecated("deprecated") def vertical( self, *, @@ -477,6 +480,7 @@ async def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) + @typing_extensions.deprecated("deprecated") async def industry( self, *, @@ -564,6 +568,7 @@ async def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) + @typing_extensions.deprecated("deprecated") async def vertical( self, *, @@ -659,11 +664,15 @@ def __init__(self, top: TopResource) -> None: self.attacks = to_raw_response_wrapper( top.attacks, ) - self.industry = to_raw_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_raw_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -678,11 +687,15 @@ def __init__(self, top: AsyncTopResource) -> None: self.attacks = async_to_raw_response_wrapper( top.attacks, ) - self.industry = async_to_raw_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_raw_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -697,11 +710,15 @@ def __init__(self, top: TopResource) -> None: self.attacks = to_streamed_response_wrapper( top.attacks, ) - self.industry = to_streamed_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_streamed_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -716,11 +733,15 @@ def __init__(self, top: AsyncTopResource) -> None: self.attacks = async_to_streamed_response_wrapper( top.attacks, ) - self.industry = async_to_streamed_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_streamed_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/top.py b/src/cloudflare/resources/radar/attacks/layer7/top/top.py index 68da17c7335..30db6b97c5d 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/top.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 @@ -190,6 +191,7 @@ def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) + @typing_extensions.deprecated("deprecated") def industry( self, *, @@ -347,6 +349,7 @@ def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) + @typing_extensions.deprecated("deprecated") def vertical( self, *, @@ -651,6 +654,7 @@ async def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) + @typing_extensions.deprecated("deprecated") async def industry( self, *, @@ -808,6 +812,7 @@ async def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) + @typing_extensions.deprecated("deprecated") async def vertical( self, *, @@ -973,11 +978,15 @@ def __init__(self, top: TopResource) -> None: self.attacks = to_raw_response_wrapper( top.attacks, ) - self.industry = to_raw_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_raw_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -996,11 +1005,15 @@ def __init__(self, top: AsyncTopResource) -> None: self.attacks = async_to_raw_response_wrapper( top.attacks, ) - self.industry = async_to_raw_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_raw_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1019,11 +1032,15 @@ def __init__(self, top: TopResource) -> None: self.attacks = to_streamed_response_wrapper( top.attacks, ) - self.industry = to_streamed_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_streamed_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1042,11 +1059,15 @@ def __init__(self, top: AsyncTopResource) -> None: self.attacks = async_to_streamed_response_wrapper( top.attacks, ) - self.industry = async_to_streamed_response_wrapper( - top.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.industry # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_streamed_response_wrapper( - top.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.vertical # pyright: ignore[reportDeprecated], + ) ) @cached_property diff --git a/src/cloudflare/resources/radar/bgp/routes.py b/src/cloudflare/resources/radar/bgp/routes.py index ef4391bc730..b975345445f 100644 --- a/src/cloudflare/resources/radar/bgp/routes.py +++ b/src/cloudflare/resources/radar/bgp/routes.py @@ -243,8 +243,8 @@ def realtime( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteRealtimeResponse: """ - Retrieves realtime routes for prefixes using public realtime data collectors - (RouteViews and RIPE RIS). + Retrieves real-time BGP routes for a prefix, using public real-time data + collectors (RouteViews and RIPE RIS). Args: format: Format in which results will be returned. @@ -539,8 +539,8 @@ async def realtime( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteRealtimeResponse: """ - Retrieves realtime routes for prefixes using public realtime data collectors - (RouteViews and RIPE RIS). + Retrieves real-time BGP routes for a prefix, using public real-time data + collectors (RouteViews and RIPE RIS). Args: format: Format in which results will be returned. diff --git a/src/cloudflare/resources/radar/search.py b/src/cloudflare/resources/radar/search.py index af4affe3e3d..a1e32a7d272 100644 --- a/src/cloudflare/resources/radar/search.py +++ b/src/cloudflare/resources/radar/search.py @@ -49,9 +49,9 @@ def global_( self, *, query: str, - exclude: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] | NotGiven = NOT_GIVEN, + exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] | 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -133,9 +133,9 @@ async def global_( self, *, query: str, - exclude: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] | NotGiven = NOT_GIVEN, + exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] | 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/cloudflare/resources/schema_validation/schemas.py b/src/cloudflare/resources/schema_validation/schemas.py index 52cb3cc331e..a47974a15bb 100644 --- a/src/cloudflare/resources/schema_validation/schemas.py +++ b/src/cloudflare/resources/schema_validation/schemas.py @@ -57,7 +57,7 @@ def create( kind: Literal["openapi_v3"], name: str, source: str, - validation_enabled: bool | NotGiven = NOT_GIVEN, + validation_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, @@ -338,7 +338,7 @@ async def create( kind: Literal["openapi_v3"], name: str, source: str, - validation_enabled: bool | NotGiven = NOT_GIVEN, + validation_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, diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index cbcc3bf0080..a825774b4c9 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -279,6 +279,8 @@ def create( Args: account_id: Account ID. + country: Country to geo egress from + custom_headers: Set custom headers. screenshots_resolutions: Take multiple screenshots targeting different device types. @@ -837,6 +839,8 @@ async def create( Args: account_id: Account ID. + country: Country to geo egress from + custom_headers: Set custom headers. screenshots_resolutions: Take multiple screenshots targeting different device types. diff --git a/src/cloudflare/resources/user/billing/history.py b/src/cloudflare/resources/user/billing/history.py index 435fc562da8..44464d63dc9 100644 --- a/src/cloudflare/resources/user/billing/history.py +++ b/src/cloudflare/resources/user/billing/history.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Union from datetime import datetime from typing_extensions import Literal @@ -46,6 +47,7 @@ def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: """ return HistoryResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -130,6 +132,7 @@ def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: """ return AsyncHistoryResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -198,8 +201,10 @@ class HistoryResourceWithRawResponse: def __init__(self, history: HistoryResource) -> None: self._history = history - self.list = to_raw_response_wrapper( - history.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + history.list # pyright: ignore[reportDeprecated], + ) ) @@ -207,8 +212,10 @@ class AsyncHistoryResourceWithRawResponse: def __init__(self, history: AsyncHistoryResource) -> None: self._history = history - self.list = async_to_raw_response_wrapper( - history.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + history.list # pyright: ignore[reportDeprecated], + ) ) @@ -216,8 +223,10 @@ class HistoryResourceWithStreamingResponse: def __init__(self, history: HistoryResource) -> None: self._history = history - self.list = to_streamed_response_wrapper( - history.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + history.list # pyright: ignore[reportDeprecated], + ) ) @@ -225,6 +234,8 @@ class AsyncHistoryResourceWithStreamingResponse: def __init__(self, history: AsyncHistoryResource) -> None: self._history = history - self.list = async_to_streamed_response_wrapper( - history.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + history.list # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/user/billing/profile.py b/src/cloudflare/resources/user/billing/profile.py index c038442b8d1..cae0264f156 100644 --- a/src/cloudflare/resources/user/billing/profile.py +++ b/src/cloudflare/resources/user/billing/profile.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, cast import httpx @@ -42,6 +43,7 @@ def with_streaming_response(self) -> ProfileResourceWithStreamingResponse: """ return ProfileResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def get( self, *, @@ -86,6 +88,7 @@ def with_streaming_response(self) -> AsyncProfileResourceWithStreamingResponse: """ return AsyncProfileResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def get( self, *, @@ -114,8 +117,10 @@ class ProfileResourceWithRawResponse: def __init__(self, profile: ProfileResource) -> None: self._profile = profile - self.get = to_raw_response_wrapper( - profile.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + profile.get # pyright: ignore[reportDeprecated], + ) ) @@ -123,8 +128,10 @@ class AsyncProfileResourceWithRawResponse: def __init__(self, profile: AsyncProfileResource) -> None: self._profile = profile - self.get = async_to_raw_response_wrapper( - profile.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + profile.get # pyright: ignore[reportDeprecated], + ) ) @@ -132,8 +139,10 @@ class ProfileResourceWithStreamingResponse: def __init__(self, profile: ProfileResource) -> None: self._profile = profile - self.get = to_streamed_response_wrapper( - profile.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + profile.get # pyright: ignore[reportDeprecated], + ) ) @@ -141,6 +150,8 @@ class AsyncProfileResourceWithStreamingResponse: def __init__(self, profile: AsyncProfileResource) -> None: self._profile = profile - self.get = async_to_streamed_response_wrapper( - profile.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + profile.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/user/organizations.py b/src/cloudflare/resources/user/organizations.py index 888205b04e5..41fcbf9876b 100644 --- a/src/cloudflare/resources/user/organizations.py +++ b/src/cloudflare/resources/user/organizations.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast from typing_extensions import Literal @@ -47,6 +48,7 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: """ return OrganizationsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -114,6 +116,7 @@ def list( model=Organization, ) + @typing_extensions.deprecated("deprecated") def delete( self, organization_id: str, @@ -149,6 +152,7 @@ def delete( cast_to=OrganizationDeleteResponse, ) + @typing_extensions.deprecated("deprecated") def get( self, organization_id: str, @@ -209,6 +213,7 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp """ return AsyncOrganizationsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -276,6 +281,7 @@ def list( model=Organization, ) + @typing_extensions.deprecated("deprecated") async def delete( self, organization_id: str, @@ -311,6 +317,7 @@ async def delete( cast_to=OrganizationDeleteResponse, ) + @typing_extensions.deprecated("deprecated") async def get( self, organization_id: str, @@ -355,14 +362,20 @@ class OrganizationsResourceWithRawResponse: def __init__(self, organizations: OrganizationsResource) -> None: self._organizations = organizations - self.list = to_raw_response_wrapper( - organizations.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + organizations.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - organizations.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + organizations.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - organizations.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + organizations.get # pyright: ignore[reportDeprecated], + ) ) @@ -370,14 +383,20 @@ class AsyncOrganizationsResourceWithRawResponse: def __init__(self, organizations: AsyncOrganizationsResource) -> None: self._organizations = organizations - self.list = async_to_raw_response_wrapper( - organizations.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + organizations.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - organizations.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + organizations.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - organizations.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + organizations.get # pyright: ignore[reportDeprecated], + ) ) @@ -385,14 +404,20 @@ class OrganizationsResourceWithStreamingResponse: def __init__(self, organizations: OrganizationsResource) -> None: self._organizations = organizations - self.list = to_streamed_response_wrapper( - organizations.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + organizations.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - organizations.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + organizations.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - organizations.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + organizations.get # pyright: ignore[reportDeprecated], + ) ) @@ -400,12 +425,18 @@ class AsyncOrganizationsResourceWithStreamingResponse: def __init__(self, organizations: AsyncOrganizationsResource) -> None: self._organizations = organizations - self.list = async_to_streamed_response_wrapper( - organizations.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + organizations.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - organizations.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + organizations.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - organizations.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + organizations.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/user/user.py b/src/cloudflare/resources/user/user.py index 4620aef8362..961875a9428 100644 --- a/src/cloudflare/resources/user/user.py +++ b/src/cloudflare/resources/user/user.py @@ -67,6 +67,8 @@ BillingResourceWithStreamingResponse, AsyncBillingResourceWithStreamingResponse, ) +from ...types.user.user_get_response import UserGetResponse +from ...types.user.user_edit_response import UserEditResponse __all__ = ["UserResource", "AsyncUserResource"] @@ -129,7 +131,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[UserEditResponse]: """ Edit part of your user details. @@ -169,9 +171,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[UserEditResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[UserEditResponse]], ResultWrapper[UserEditResponse]), ) def get( @@ -183,7 +185,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[UserGetResponse]: """User Details""" return self._get( "/user", @@ -192,9 +194,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[UserGetResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[UserGetResponse]], ResultWrapper[UserGetResponse]), ) @@ -256,7 +258,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[UserEditResponse]: """ Edit part of your user details. @@ -296,9 +298,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[UserEditResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[UserEditResponse]], ResultWrapper[UserEditResponse]), ) async def get( @@ -310,7 +312,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[UserGetResponse]: """User Details""" return await self._get( "/user", @@ -319,9 +321,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[UserGetResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[UserGetResponse]], ResultWrapper[UserGetResponse]), ) diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index fc017f2f472..e4937fa83ae 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -205,6 +205,10 @@ 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 {})} return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), @@ -214,6 +218,7 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax='json', post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -449,6 +454,10 @@ 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 {})} return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), @@ -459,6 +468,7 @@ async def update( extra_body=extra_body, timeout=timeout, post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, + multipart_syntax='json', ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), ) 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 5b25797b7c1..6212535ade3 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 @@ -161,6 +161,10 @@ 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 {})} return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), @@ -170,6 +174,7 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax='json', post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -370,6 +375,10 @@ 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 {})} 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), @@ -379,6 +388,7 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax='json', post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), diff --git a/src/cloudflare/resources/workflows/instances/instances.py b/src/cloudflare/resources/workflows/instances/instances.py index 2d54b941318..1ba9e5e73f3 100644 --- a/src/cloudflare/resources/workflows/instances/instances.py +++ b/src/cloudflare/resources/workflows/instances/instances.py @@ -147,9 +147,9 @@ def list( List of workflow instances Args: - date_end: In ISO 8601 with no timezone offsets and in UTC. + date_end: Accepts ISO 8601 with no timezone offsets and in UTC. - date_start: In ISO 8601 with no timezone offsets and in UTC. + date_start: Accepts ISO 8601 with no timezone offsets and in UTC. extra_headers: Send extra headers @@ -370,9 +370,9 @@ def list( List of workflow instances Args: - date_end: In ISO 8601 with no timezone offsets and in UTC. + date_end: Accepts ISO 8601 with no timezone offsets and in UTC. - date_start: In ISO 8601 with no timezone offsets and in UTC. + date_start: Accepts ISO 8601 with no timezone offsets and in UTC. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/workflows/instances/status.py b/src/cloudflare/resources/workflows/instances/status.py index baaf108faa0..2d35e593106 100644 --- a/src/cloudflare/resources/workflows/instances/status.py +++ b/src/cloudflare/resources/workflows/instances/status.py @@ -63,7 +63,7 @@ def edit( Change status of instance Args: - status: Possible actions to apply to instance. + status: Apply action to instance. extra_headers: Send extra headers @@ -131,7 +131,7 @@ async def edit( Change status of instance Args: - status: Possible actions to apply to instance. + status: Apply action to instance. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/workflows/workflows.py b/src/cloudflare/resources/workflows/workflows.py index bd778ee5bb2..7a15ccc5b01 100644 --- a/src/cloudflare/resources/workflows/workflows.py +++ b/src/cloudflare/resources/workflows/workflows.py @@ -139,7 +139,7 @@ def list( List all Workflows Args: - search: Filter workflows by name. + search: Allows filtering workflows` name. extra_headers: Send extra headers @@ -349,7 +349,7 @@ def list( List all Workflows Args: - search: Filter workflows by name. + search: Allows filtering workflows` name. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zaraz/config.py b/src/cloudflare/resources/zaraz/config.py index 5a3813a72b7..42addd4d56c 100644 --- a/src/cloudflare/resources/zaraz/config.py +++ b/src/cloudflare/resources/zaraz/config.py @@ -69,7 +69,7 @@ def update( Updates Zaraz configuration for a zone. Args: - zone_id: Identifier + zone_id: Identifier. data_layer: Data layer compatibility mode enabled. @@ -150,7 +150,7 @@ def get( be included. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -220,7 +220,7 @@ async def update( Updates Zaraz configuration for a zone. Args: - zone_id: Identifier + zone_id: Identifier. data_layer: Data layer compatibility mode enabled. @@ -301,7 +301,7 @@ async def get( be included. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zaraz/default.py b/src/cloudflare/resources/zaraz/default.py index 753060c08b3..8b7c78f14c7 100644 --- a/src/cloudflare/resources/zaraz/default.py +++ b/src/cloudflare/resources/zaraz/default.py @@ -57,7 +57,7 @@ def get( Gets default Zaraz configuration for a zone. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -117,7 +117,7 @@ async def get( Gets default Zaraz configuration for a zone. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zaraz/export.py b/src/cloudflare/resources/zaraz/export.py index 3fb2d2dd239..845c76fa341 100644 --- a/src/cloudflare/resources/zaraz/export.py +++ b/src/cloudflare/resources/zaraz/export.py @@ -55,7 +55,7 @@ def get( included. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -112,7 +112,7 @@ async def get( included. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zaraz/history/configs.py b/src/cloudflare/resources/zaraz/history/configs.py index c75630ceeb9..60f3ce479fb 100644 --- a/src/cloudflare/resources/zaraz/history/configs.py +++ b/src/cloudflare/resources/zaraz/history/configs.py @@ -60,7 +60,7 @@ def get( Gets a history of published Zaraz configurations by ID(s) for a zone. Args: - zone_id: Identifier + zone_id: Identifier. ids: Comma separated list of Zaraz configuration IDs @@ -124,7 +124,7 @@ async def get( Gets a history of published Zaraz configurations by ID(s) for a zone. Args: - zone_id: Identifier + zone_id: Identifier. ids: Comma separated list of Zaraz configuration IDs diff --git a/src/cloudflare/resources/zaraz/history/history.py b/src/cloudflare/resources/zaraz/history/history.py index 258f92f3906..e89f681b1c0 100644 --- a/src/cloudflare/resources/zaraz/history/history.py +++ b/src/cloudflare/resources/zaraz/history/history.py @@ -75,7 +75,7 @@ def update( Restores a historical published Zaraz configuration by ID for a zone. Args: - zone_id: Identifier + zone_id: Identifier. body: ID of the Zaraz configuration to restore. @@ -121,7 +121,7 @@ def list( Lists a history of published Zaraz configuration records for a zone. Args: - zone_id: Identifier + zone_id: Identifier. limit: Maximum amount of results to list. Default value is 10. @@ -203,7 +203,7 @@ async def update( Restores a historical published Zaraz configuration by ID for a zone. Args: - zone_id: Identifier + zone_id: Identifier. body: ID of the Zaraz configuration to restore. @@ -249,7 +249,7 @@ def list( Lists a history of published Zaraz configuration records for a zone. Args: - zone_id: Identifier + zone_id: Identifier. limit: Maximum amount of results to list. Default value is 10. diff --git a/src/cloudflare/resources/zaraz/publish.py b/src/cloudflare/resources/zaraz/publish.py index b4c312103f8..7386f15a91d 100644 --- a/src/cloudflare/resources/zaraz/publish.py +++ b/src/cloudflare/resources/zaraz/publish.py @@ -60,7 +60,7 @@ def create( Publish current Zaraz preview configuration for a zone. Args: - zone_id: Identifier + zone_id: Identifier. body: Zaraz configuration description. @@ -124,7 +124,7 @@ async def create( Publish current Zaraz preview configuration for a zone. Args: - zone_id: Identifier + zone_id: Identifier. body: Zaraz configuration description. diff --git a/src/cloudflare/resources/zaraz/workflow.py b/src/cloudflare/resources/zaraz/workflow.py index ac6093c99a2..d9cfb22f000 100644 --- a/src/cloudflare/resources/zaraz/workflow.py +++ b/src/cloudflare/resources/zaraz/workflow.py @@ -57,7 +57,7 @@ def get( Gets Zaraz workflow for a zone. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -119,7 +119,7 @@ async def get( Gets Zaraz workflow for a zone. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zaraz/zaraz.py b/src/cloudflare/resources/zaraz/zaraz.py index 7da0625eef7..ee4084fccfb 100644 --- a/src/cloudflare/resources/zaraz/zaraz.py +++ b/src/cloudflare/resources/zaraz/zaraz.py @@ -132,7 +132,7 @@ def update( Updates Zaraz workflow for a zone. Args: - zone_id: Identifier + zone_id: Identifier. workflow: Zaraz workflow @@ -222,7 +222,7 @@ async def update( Updates Zaraz workflow for a zone. Args: - zone_id: Identifier + zone_id: Identifier. workflow: Zaraz workflow diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index a24ddcb2232..a9f48d3a14c 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Any, List, Type, Iterable, Optional, cast -from typing_extensions import overload +from typing_extensions import Literal, overload import httpx @@ -126,7 +126,7 @@ def create( self, *, domain: str, - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -280,7 +280,7 @@ def create( 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: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -337,7 +337,19 @@ def create( self, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -480,7 +492,19 @@ def create( self, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -622,7 +646,19 @@ def create( def create( self, *, - type: ApplicationType, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, @@ -856,7 +892,7 @@ def create( name: str | NotGiven = NOT_GIVEN, scim_config: application_create_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -945,7 +981,7 @@ def create( *, domain: str, target_criteria: Iterable[application_create_params.BrowserRdpApplicationTargetCriterion], - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -1087,7 +1123,7 @@ def create( self, *, domain: str | NotGiven = NOT_GIVEN, - type: str | ApplicationType | 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, @@ -1210,7 +1246,7 @@ def update( app_id: AppID, *, domain: str, - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -1367,7 +1403,7 @@ def update( 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: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1427,7 +1463,19 @@ def update( app_id: AppID, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -1573,7 +1621,19 @@ def update( app_id: AppID, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -1718,7 +1778,19 @@ def update( self, app_id: AppID, *, - type: ApplicationType, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, @@ -1961,7 +2033,7 @@ def update( name: str | NotGiven = NOT_GIVEN, scim_config: application_update_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2056,7 +2128,7 @@ def update( *, domain: str, target_criteria: Iterable[application_update_params.BrowserRdpApplicationTargetCriterion], - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -2201,7 +2273,7 @@ def update( app_id: AppID, *, domain: str | NotGiven = NOT_GIVEN, - type: str | ApplicationType | 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, @@ -2615,7 +2687,7 @@ async def create( self, *, domain: str, - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -2769,7 +2841,7 @@ async def create( 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: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2826,7 +2898,19 @@ async def create( self, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -2969,7 +3053,19 @@ async def create( self, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -3111,7 +3207,19 @@ async def create( async def create( self, *, - type: ApplicationType, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, @@ -3345,7 +3453,7 @@ async def create( name: str | NotGiven = NOT_GIVEN, scim_config: application_create_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3434,7 +3542,7 @@ async def create( *, domain: str, target_criteria: Iterable[application_create_params.BrowserRdpApplicationTargetCriterion], - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -3576,7 +3684,7 @@ async def create( self, *, domain: str | NotGiven = NOT_GIVEN, - type: str | ApplicationType | 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, @@ -3699,7 +3807,7 @@ async def update( app_id: AppID, *, domain: str, - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -3856,7 +3964,7 @@ async def update( 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: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3916,7 +4024,19 @@ async def update( app_id: AppID, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -4062,7 +4182,19 @@ async def update( app_id: AppID, *, domain: str, - type: str, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -4207,7 +4339,19 @@ async def update( self, app_id: AppID, *, - type: ApplicationType, + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, @@ -4450,7 +4594,7 @@ async def update( name: str | NotGiven = NOT_GIVEN, scim_config: application_update_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + type: ApplicationType | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4545,7 +4689,7 @@ async def update( *, domain: str, target_criteria: Iterable[application_update_params.BrowserRdpApplicationTargetCriterion], - type: str, + type: ApplicationType, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -4690,7 +4834,7 @@ async def update( app_id: AppID, *, domain: str | NotGiven = NOT_GIVEN, - type: str | ApplicationType | 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, diff --git a/src/cloudflare/resources/zero_trust/access/bookmarks.py b/src/cloudflare/resources/zero_trust/access/bookmarks.py index b97eb3c64e4..6d24de0a1c8 100644 --- a/src/cloudflare/resources/zero_trust/access/bookmarks.py +++ b/src/cloudflare/resources/zero_trust/access/bookmarks.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast import httpx @@ -46,6 +47,7 @@ def with_streaming_response(self) -> BookmarksResourceWithStreamingResponse: """ return BookmarksResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, bookmark_id: str, @@ -90,6 +92,7 @@ def create( cast_to=cast(Type[Optional[Bookmark]], ResultWrapper[Bookmark]), ) + @typing_extensions.deprecated("deprecated") def update( self, bookmark_id: str, @@ -134,6 +137,7 @@ def update( cast_to=cast(Type[Optional[Bookmark]], ResultWrapper[Bookmark]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -168,6 +172,7 @@ def list( model=Bookmark, ) + @typing_extensions.deprecated("deprecated") def delete( self, bookmark_id: str, @@ -210,6 +215,7 @@ def delete( cast_to=cast(Type[Optional[BookmarkDeleteResponse]], ResultWrapper[BookmarkDeleteResponse]), ) + @typing_extensions.deprecated("deprecated") def get( self, bookmark_id: str, @@ -273,6 +279,7 @@ def with_streaming_response(self) -> AsyncBookmarksResourceWithStreamingResponse """ return AsyncBookmarksResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, bookmark_id: str, @@ -317,6 +324,7 @@ async def create( cast_to=cast(Type[Optional[Bookmark]], ResultWrapper[Bookmark]), ) + @typing_extensions.deprecated("deprecated") async def update( self, bookmark_id: str, @@ -361,6 +369,7 @@ async def update( cast_to=cast(Type[Optional[Bookmark]], ResultWrapper[Bookmark]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -395,6 +404,7 @@ def list( model=Bookmark, ) + @typing_extensions.deprecated("deprecated") async def delete( self, bookmark_id: str, @@ -437,6 +447,7 @@ async def delete( cast_to=cast(Type[Optional[BookmarkDeleteResponse]], ResultWrapper[BookmarkDeleteResponse]), ) + @typing_extensions.deprecated("deprecated") async def get( self, bookmark_id: str, @@ -484,20 +495,30 @@ class BookmarksResourceWithRawResponse: def __init__(self, bookmarks: BookmarksResource) -> None: self._bookmarks = bookmarks - self.create = to_raw_response_wrapper( - bookmarks.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + bookmarks.create # pyright: ignore[reportDeprecated], + ) ) - self.update = to_raw_response_wrapper( - bookmarks.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + bookmarks.update # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - bookmarks.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + bookmarks.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - bookmarks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + bookmarks.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - bookmarks.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + bookmarks.get # pyright: ignore[reportDeprecated], + ) ) @@ -505,20 +526,30 @@ class AsyncBookmarksResourceWithRawResponse: def __init__(self, bookmarks: AsyncBookmarksResource) -> None: self._bookmarks = bookmarks - self.create = async_to_raw_response_wrapper( - bookmarks.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + bookmarks.create # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_raw_response_wrapper( - bookmarks.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + bookmarks.update # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - bookmarks.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + bookmarks.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - bookmarks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + bookmarks.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - bookmarks.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + bookmarks.get # pyright: ignore[reportDeprecated], + ) ) @@ -526,20 +557,30 @@ class BookmarksResourceWithStreamingResponse: def __init__(self, bookmarks: BookmarksResource) -> None: self._bookmarks = bookmarks - self.create = to_streamed_response_wrapper( - bookmarks.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + bookmarks.create # pyright: ignore[reportDeprecated], + ) ) - self.update = to_streamed_response_wrapper( - bookmarks.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + bookmarks.update # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - bookmarks.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + bookmarks.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - bookmarks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + bookmarks.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - bookmarks.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + bookmarks.get # pyright: ignore[reportDeprecated], + ) ) @@ -547,18 +588,28 @@ class AsyncBookmarksResourceWithStreamingResponse: def __init__(self, bookmarks: AsyncBookmarksResource) -> None: self._bookmarks = bookmarks - self.create = async_to_streamed_response_wrapper( - bookmarks.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + bookmarks.create # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_streamed_response_wrapper( - bookmarks.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + bookmarks.update # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_streamed_response_wrapper( - bookmarks.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + bookmarks.list # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - bookmarks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + bookmarks.delete # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - bookmarks.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + bookmarks.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index 54438851860..9777959d93f 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, Iterable, Optional, cast from datetime import datetime from typing_extensions import Literal @@ -26,6 +27,7 @@ target_create_params, target_update_params, target_bulk_update_params, + target_bulk_delete_v2_params, ) from .....types.zero_trust.access.infrastructure.target_get_response import TargetGetResponse from .....types.zero_trust.access.infrastructure.target_list_response import TargetListResponse @@ -343,6 +345,7 @@ def delete( cast_to=NoneType, ) + @typing_extensions.deprecated("deprecated") def bulk_delete( self, *, @@ -379,6 +382,46 @@ def bulk_delete( cast_to=NoneType, ) + def bulk_delete_v2( + self, + *, + account_id: str, + target_ids: List[str], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Removes one or more targets. + + Args: + account_id: Account identifier + + target_ids: List of target IDs to bulk delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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}/infrastructure/targets/batch_delete", + body=maybe_transform({"target_ids": target_ids}, target_bulk_delete_v2_params.TargetBulkDeleteV2Params), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + def bulk_update( self, *, @@ -770,6 +813,7 @@ async def delete( cast_to=NoneType, ) + @typing_extensions.deprecated("deprecated") async def bulk_delete( self, *, @@ -806,6 +850,48 @@ async def bulk_delete( cast_to=NoneType, ) + async def bulk_delete_v2( + self, + *, + account_id: str, + target_ids: List[str], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Removes one or more targets. + + Args: + account_id: Account identifier + + target_ids: List of target IDs to bulk delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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}/infrastructure/targets/batch_delete", + body=await async_maybe_transform( + {"target_ids": target_ids}, target_bulk_delete_v2_params.TargetBulkDeleteV2Params + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + def bulk_update( self, *, @@ -906,8 +992,13 @@ def __init__(self, targets: TargetsResource) -> None: self.delete = to_raw_response_wrapper( targets.delete, ) - self.bulk_delete = to_raw_response_wrapper( - targets.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + targets.bulk_delete # pyright: ignore[reportDeprecated], + ) + ) + self.bulk_delete_v2 = to_raw_response_wrapper( + targets.bulk_delete_v2, ) self.bulk_update = to_raw_response_wrapper( targets.bulk_update, @@ -933,8 +1024,13 @@ def __init__(self, targets: AsyncTargetsResource) -> None: self.delete = async_to_raw_response_wrapper( targets.delete, ) - self.bulk_delete = async_to_raw_response_wrapper( - targets.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + targets.bulk_delete # pyright: ignore[reportDeprecated], + ) + ) + self.bulk_delete_v2 = async_to_raw_response_wrapper( + targets.bulk_delete_v2, ) self.bulk_update = async_to_raw_response_wrapper( targets.bulk_update, @@ -960,8 +1056,13 @@ def __init__(self, targets: TargetsResource) -> None: self.delete = to_streamed_response_wrapper( targets.delete, ) - self.bulk_delete = to_streamed_response_wrapper( - targets.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + targets.bulk_delete # pyright: ignore[reportDeprecated], + ) + ) + self.bulk_delete_v2 = to_streamed_response_wrapper( + targets.bulk_delete_v2, ) self.bulk_update = to_streamed_response_wrapper( targets.bulk_update, @@ -987,8 +1088,13 @@ def __init__(self, targets: AsyncTargetsResource) -> None: self.delete = async_to_streamed_response_wrapper( targets.delete, ) - self.bulk_delete = async_to_streamed_response_wrapper( - targets.bulk_delete, + self.bulk_delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + targets.bulk_delete # pyright: ignore[reportDeprecated], + ) + ) + self.bulk_delete_v2 = async_to_streamed_response_wrapper( + targets.bulk_delete_v2, ) self.bulk_update = async_to_streamed_response_wrapper( targets.bulk_update, diff --git a/src/cloudflare/resources/zero_trust/devices/__init__.py b/src/cloudflare/resources/zero_trust/devices/__init__.py index 81e637a0281..b3bd5980ce4 100644 --- a/src/cloudflare/resources/zero_trust/devices/__init__.py +++ b/src/cloudflare/resources/zero_trust/devices/__init__.py @@ -56,6 +56,14 @@ UnrevokeResourceWithStreamingResponse, AsyncUnrevokeResourceWithStreamingResponse, ) +from .dex_tests import ( + DEXTestsResource, + AsyncDEXTestsResource, + DEXTestsResourceWithRawResponse, + AsyncDEXTestsResourceWithRawResponse, + DEXTestsResourceWithStreamingResponse, + AsyncDEXTestsResourceWithStreamingResponse, +) from .resilience import ( ResilienceResource, AsyncResilienceResource, @@ -102,6 +110,12 @@ "AsyncRegistrationsResourceWithRawResponse", "RegistrationsResourceWithStreamingResponse", "AsyncRegistrationsResourceWithStreamingResponse", + "DEXTestsResource", + "AsyncDEXTestsResource", + "DEXTestsResourceWithRawResponse", + "AsyncDEXTestsResourceWithRawResponse", + "DEXTestsResourceWithStreamingResponse", + "AsyncDEXTestsResourceWithStreamingResponse", "NetworksResource", "AsyncNetworksResource", "NetworksResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index 4b64981dfba..f0a289fbea0 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast import httpx @@ -40,6 +41,14 @@ AsyncUnrevokeResourceWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .dex_tests import ( + DEXTestsResource, + AsyncDEXTestsResource, + DEXTestsResourceWithRawResponse, + AsyncDEXTestsResourceWithRawResponse, + DEXTestsResourceWithStreamingResponse, + AsyncDEXTestsResourceWithStreamingResponse, +) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -118,6 +127,10 @@ def resilience(self) -> ResilienceResource: def registrations(self) -> RegistrationsResource: return RegistrationsResource(self._client) + @cached_property + def dex_tests(self) -> DEXTestsResource: + return DEXTestsResource(self._client) + @cached_property def networks(self) -> NetworksResource: return NetworksResource(self._client) @@ -169,6 +182,7 @@ def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: """ return DevicesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -180,8 +194,11 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSinglePage[Device]: - """ - List WARP registrations. + """List WARP devices. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled for the account. **Deprecated**: please use one of the following endpoints instead: @@ -208,6 +225,7 @@ def list( model=Device, ) + @typing_extensions.deprecated("deprecated") def get( self, device_id: str, @@ -220,8 +238,11 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[DeviceGetResponse]: - """ - Fetches a single WARP registration. + """Fetches a single WARP device. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled for the account. **Deprecated**: please use one of the following endpoints instead: @@ -270,6 +291,10 @@ def resilience(self) -> AsyncResilienceResource: def registrations(self) -> AsyncRegistrationsResource: return AsyncRegistrationsResource(self._client) + @cached_property + def dex_tests(self) -> AsyncDEXTestsResource: + return AsyncDEXTestsResource(self._client) + @cached_property def networks(self) -> AsyncNetworksResource: return AsyncNetworksResource(self._client) @@ -321,6 +346,7 @@ def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: """ return AsyncDevicesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -332,8 +358,11 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Device, AsyncSinglePage[Device]]: - """ - List WARP registrations. + """List WARP devices. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled for the account. **Deprecated**: please use one of the following endpoints instead: @@ -360,6 +389,7 @@ def list( model=Device, ) + @typing_extensions.deprecated("deprecated") async def get( self, device_id: str, @@ -372,8 +402,11 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[DeviceGetResponse]: - """ - Fetches a single WARP registration. + """Fetches a single WARP device. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled for the account. **Deprecated**: please use one of the following endpoints instead: @@ -413,11 +446,15 @@ class DevicesResourceWithRawResponse: def __init__(self, devices: DevicesResource) -> None: self._devices = devices - self.list = to_raw_response_wrapper( - devices.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + devices.list # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - devices.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + devices.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -432,6 +469,10 @@ def resilience(self) -> ResilienceResourceWithRawResponse: def registrations(self) -> RegistrationsResourceWithRawResponse: return RegistrationsResourceWithRawResponse(self._devices.registrations) + @cached_property + def dex_tests(self) -> DEXTestsResourceWithRawResponse: + return DEXTestsResourceWithRawResponse(self._devices.dex_tests) + @cached_property def networks(self) -> NetworksResourceWithRawResponse: return NetworksResourceWithRawResponse(self._devices.networks) @@ -469,11 +510,15 @@ class AsyncDevicesResourceWithRawResponse: def __init__(self, devices: AsyncDevicesResource) -> None: self._devices = devices - self.list = async_to_raw_response_wrapper( - devices.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + devices.list # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - devices.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + devices.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -488,6 +533,10 @@ def resilience(self) -> AsyncResilienceResourceWithRawResponse: def registrations(self) -> AsyncRegistrationsResourceWithRawResponse: return AsyncRegistrationsResourceWithRawResponse(self._devices.registrations) + @cached_property + def dex_tests(self) -> AsyncDEXTestsResourceWithRawResponse: + return AsyncDEXTestsResourceWithRawResponse(self._devices.dex_tests) + @cached_property def networks(self) -> AsyncNetworksResourceWithRawResponse: return AsyncNetworksResourceWithRawResponse(self._devices.networks) @@ -525,11 +574,15 @@ class DevicesResourceWithStreamingResponse: def __init__(self, devices: DevicesResource) -> None: self._devices = devices - self.list = to_streamed_response_wrapper( - devices.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + devices.list # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - devices.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + devices.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -544,6 +597,10 @@ def resilience(self) -> ResilienceResourceWithStreamingResponse: def registrations(self) -> RegistrationsResourceWithStreamingResponse: return RegistrationsResourceWithStreamingResponse(self._devices.registrations) + @cached_property + def dex_tests(self) -> DEXTestsResourceWithStreamingResponse: + return DEXTestsResourceWithStreamingResponse(self._devices.dex_tests) + @cached_property def networks(self) -> NetworksResourceWithStreamingResponse: return NetworksResourceWithStreamingResponse(self._devices.networks) @@ -581,11 +638,15 @@ class AsyncDevicesResourceWithStreamingResponse: def __init__(self, devices: AsyncDevicesResource) -> None: self._devices = devices - self.list = async_to_streamed_response_wrapper( - devices.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + devices.list # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - devices.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + devices.get # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -600,6 +661,10 @@ def resilience(self) -> AsyncResilienceResourceWithStreamingResponse: def registrations(self) -> AsyncRegistrationsResourceWithStreamingResponse: return AsyncRegistrationsResourceWithStreamingResponse(self._devices.registrations) + @cached_property + def dex_tests(self) -> AsyncDEXTestsResourceWithStreamingResponse: + return AsyncDEXTestsResourceWithStreamingResponse(self._devices.dex_tests) + @cached_property def networks(self) -> AsyncNetworksResourceWithStreamingResponse: return AsyncNetworksResourceWithStreamingResponse(self._devices.networks) diff --git a/src/cloudflare/resources/zero_trust/devices/devices_.py b/src/cloudflare/resources/zero_trust/devices/devices_.py index 02587e6fab3..82113483ab9 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices_.py +++ b/src/cloudflare/resources/zero_trust/devices/devices_.py @@ -230,7 +230,7 @@ def revoke( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - Revokes all registrations associated with the specified device. + Revokes all WARP registrations associated with the specified device. Args: extra_headers: Send extra headers @@ -461,7 +461,7 @@ async def revoke( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - Revokes all registrations associated with the specified device. + Revokes all WARP registrations associated with the specified device. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/devices/dex_tests.py b/src/cloudflare/resources/zero_trust/devices/dex_tests.py new file mode 100644 index 00000000000..241e238dee1 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/devices/dex_tests.py @@ -0,0 +1,681 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import 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 ( + 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.devices import dex_test_create_params, dex_test_update_params +from ....types.zero_trust.devices.dex_test_get_response import DEXTestGetResponse +from ....types.zero_trust.devices.dex_test_list_response import DEXTestListResponse +from ....types.zero_trust.devices.dex_test_create_response import DEXTestCreateResponse +from ....types.zero_trust.devices.dex_test_delete_response import DEXTestDeleteResponse +from ....types.zero_trust.devices.dex_test_update_response import DEXTestUpdateResponse + +__all__ = ["DEXTestsResource", "AsyncDEXTestsResource"] + + +class DEXTestsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DEXTestsResourceWithRawResponse: + """ + 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 DEXTestsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DEXTestsResourceWithStreamingResponse: + """ + 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 DEXTestsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + data: dex_test_create_params.Data, + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[DEXTestCreateResponse]: + """ + Create a DEX test. + + Args: + data: The configuration object which contains the details for the WARP client to + conduct the test. + + enabled: Determines whether or not the test is active. + + interval: How often the test will run. + + name: The name of the DEX test. Must be unique. + + description: Additional details about the test. + + target_policies: DEX rules targeted by this test + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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}/dex/devices/dex_tests", + body=maybe_transform( + { + "data": data, + "enabled": enabled, + "interval": interval, + "name": name, + "description": description, + "target_policies": target_policies, + "targeted": targeted, + }, + dex_test_create_params.DEXTestCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestCreateResponse]], ResultWrapper[DEXTestCreateResponse]), + ) + + def update( + self, + dex_test_id: str, + *, + account_id: str, + data: dex_test_update_params.Data, + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[DEXTestUpdateResponse]: + """ + Update a DEX test. + + Args: + dex_test_id: API Resource UUID tag. + + data: The configuration object which contains the details for the WARP client to + conduct the test. + + enabled: Determines whether or not the test is active. + + interval: How often the test will run. + + name: The name of the DEX test. Must be unique. + + description: Additional details about the test. + + target_policies: DEX rules targeted by this test + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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 dex_test_id: + raise ValueError(f"Expected a non-empty value for `dex_test_id` but received {dex_test_id!r}") + return self._put( + f"/accounts/{account_id}/dex/devices/dex_tests/{dex_test_id}", + body=maybe_transform( + { + "data": data, + "enabled": enabled, + "interval": interval, + "name": name, + "description": description, + "target_policies": target_policies, + "targeted": targeted, + }, + dex_test_update_params.DEXTestUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestUpdateResponse]], ResultWrapper[DEXTestUpdateResponse]), + ) + + 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[DEXTestListResponse]: + """ + Fetch all DEX tests. + + 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}/dex/devices/dex_tests", + page=SyncSinglePage[DEXTestListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=DEXTestListResponse, + ) + + def delete( + self, + dex_test_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[DEXTestDeleteResponse]: + """Delete a Device DEX test. + + Returns the remaining device dex tests for the + account. + + Args: + dex_test_id: API Resource UUID tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not dex_test_id: + raise ValueError(f"Expected a non-empty value for `dex_test_id` but received {dex_test_id!r}") + return self._delete( + f"/accounts/{account_id}/dex/devices/dex_tests/{dex_test_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestDeleteResponse]], ResultWrapper[DEXTestDeleteResponse]), + ) + + def get( + self, + dex_test_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[DEXTestGetResponse]: + """ + Fetch a single DEX test. + + Args: + dex_test_id: The unique identifier for the test. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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 dex_test_id: + raise ValueError(f"Expected a non-empty value for `dex_test_id` but received {dex_test_id!r}") + return self._get( + f"/accounts/{account_id}/dex/devices/dex_tests/{dex_test_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestGetResponse]], ResultWrapper[DEXTestGetResponse]), + ) + + +class AsyncDEXTestsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDEXTestsResourceWithRawResponse: + """ + 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 AsyncDEXTestsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDEXTestsResourceWithStreamingResponse: + """ + 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 AsyncDEXTestsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + data: dex_test_create_params.Data, + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[DEXTestCreateResponse]: + """ + Create a DEX test. + + Args: + data: The configuration object which contains the details for the WARP client to + conduct the test. + + enabled: Determines whether or not the test is active. + + interval: How often the test will run. + + name: The name of the DEX test. Must be unique. + + description: Additional details about the test. + + target_policies: DEX rules targeted by this test + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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}/dex/devices/dex_tests", + body=await async_maybe_transform( + { + "data": data, + "enabled": enabled, + "interval": interval, + "name": name, + "description": description, + "target_policies": target_policies, + "targeted": targeted, + }, + dex_test_create_params.DEXTestCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestCreateResponse]], ResultWrapper[DEXTestCreateResponse]), + ) + + async def update( + self, + dex_test_id: str, + *, + account_id: str, + data: dex_test_update_params.Data, + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[DEXTestUpdateResponse]: + """ + Update a DEX test. + + Args: + dex_test_id: API Resource UUID tag. + + data: The configuration object which contains the details for the WARP client to + conduct the test. + + enabled: Determines whether or not the test is active. + + interval: How often the test will run. + + name: The name of the DEX test. Must be unique. + + description: Additional details about the test. + + target_policies: DEX rules targeted by this test + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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 dex_test_id: + raise ValueError(f"Expected a non-empty value for `dex_test_id` but received {dex_test_id!r}") + return await self._put( + f"/accounts/{account_id}/dex/devices/dex_tests/{dex_test_id}", + body=await async_maybe_transform( + { + "data": data, + "enabled": enabled, + "interval": interval, + "name": name, + "description": description, + "target_policies": target_policies, + "targeted": targeted, + }, + dex_test_update_params.DEXTestUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestUpdateResponse]], ResultWrapper[DEXTestUpdateResponse]), + ) + + 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[DEXTestListResponse, AsyncSinglePage[DEXTestListResponse]]: + """ + Fetch all DEX tests. + + 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}/dex/devices/dex_tests", + page=AsyncSinglePage[DEXTestListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=DEXTestListResponse, + ) + + async def delete( + self, + dex_test_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[DEXTestDeleteResponse]: + """Delete a Device DEX test. + + Returns the remaining device dex tests for the + account. + + Args: + dex_test_id: API Resource UUID tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not dex_test_id: + raise ValueError(f"Expected a non-empty value for `dex_test_id` but received {dex_test_id!r}") + return await self._delete( + f"/accounts/{account_id}/dex/devices/dex_tests/{dex_test_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestDeleteResponse]], ResultWrapper[DEXTestDeleteResponse]), + ) + + async def get( + self, + dex_test_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[DEXTestGetResponse]: + """ + Fetch a single DEX test. + + Args: + dex_test_id: The unique identifier for the test. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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 dex_test_id: + raise ValueError(f"Expected a non-empty value for `dex_test_id` but received {dex_test_id!r}") + return await self._get( + f"/accounts/{account_id}/dex/devices/dex_tests/{dex_test_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DEXTestGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DEXTestGetResponse]], ResultWrapper[DEXTestGetResponse]), + ) + + +class DEXTestsResourceWithRawResponse: + def __init__(self, dex_tests: DEXTestsResource) -> None: + self._dex_tests = dex_tests + + self.create = to_raw_response_wrapper( + dex_tests.create, + ) + self.update = to_raw_response_wrapper( + dex_tests.update, + ) + self.list = to_raw_response_wrapper( + dex_tests.list, + ) + self.delete = to_raw_response_wrapper( + dex_tests.delete, + ) + self.get = to_raw_response_wrapper( + dex_tests.get, + ) + + +class AsyncDEXTestsResourceWithRawResponse: + def __init__(self, dex_tests: AsyncDEXTestsResource) -> None: + self._dex_tests = dex_tests + + self.create = async_to_raw_response_wrapper( + dex_tests.create, + ) + self.update = async_to_raw_response_wrapper( + dex_tests.update, + ) + self.list = async_to_raw_response_wrapper( + dex_tests.list, + ) + self.delete = async_to_raw_response_wrapper( + dex_tests.delete, + ) + self.get = async_to_raw_response_wrapper( + dex_tests.get, + ) + + +class DEXTestsResourceWithStreamingResponse: + def __init__(self, dex_tests: DEXTestsResource) -> None: + self._dex_tests = dex_tests + + self.create = to_streamed_response_wrapper( + dex_tests.create, + ) + self.update = to_streamed_response_wrapper( + dex_tests.update, + ) + self.list = to_streamed_response_wrapper( + dex_tests.list, + ) + self.delete = to_streamed_response_wrapper( + dex_tests.delete, + ) + self.get = to_streamed_response_wrapper( + dex_tests.get, + ) + + +class AsyncDEXTestsResourceWithStreamingResponse: + def __init__(self, dex_tests: AsyncDEXTestsResource) -> None: + self._dex_tests = dex_tests + + self.create = async_to_streamed_response_wrapper( + dex_tests.create, + ) + self.update = async_to_streamed_response_wrapper( + dex_tests.update, + ) + self.list = async_to_streamed_response_wrapper( + dex_tests.list, + ) + self.delete = async_to_streamed_response_wrapper( + dex_tests.delete, + ) + self.get = async_to_streamed_response_wrapper( + dex_tests.get, + ) diff --git a/src/cloudflare/resources/zero_trust/devices/override_codes.py b/src/cloudflare/resources/zero_trust/devices/override_codes.py index b59754c8ecf..7f4e45e7339 100644 --- a/src/cloudflare/resources/zero_trust/devices/override_codes.py +++ b/src/cloudflare/resources/zero_trust/devices/override_codes.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, cast import httpx @@ -43,6 +44,7 @@ def with_streaming_response(self) -> OverrideCodesResourceWithStreamingResponse: """ return OverrideCodesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, device_id: str, @@ -55,12 +57,13 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncSinglePage[object]: - """Fetches a one-time use admin override code for a registration. + """Fetches a one-time use admin override code for a device. - This relies on - the **Admin Override** setting being enabled in your device configuration. - - **Deprecated:** please use GET + This relies on the + **Admin Override** setting being enabled in your device configuration. Not + supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled for the account. **Deprecated:** please use GET /accounts/{account_id}/devices/registrations/{registration_id}/override_codes instead. @@ -152,6 +155,7 @@ def with_streaming_response(self) -> AsyncOverrideCodesResourceWithStreamingResp """ return AsyncOverrideCodesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, device_id: str, @@ -164,12 +168,13 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[object, AsyncSinglePage[object]]: - """Fetches a one-time use admin override code for a registration. + """Fetches a one-time use admin override code for a device. - This relies on - the **Admin Override** setting being enabled in your device configuration. - - **Deprecated:** please use GET + This relies on the + **Admin Override** setting being enabled in your device configuration. Not + supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled for the account. **Deprecated:** please use GET /accounts/{account_id}/devices/registrations/{registration_id}/override_codes instead. @@ -245,8 +250,10 @@ class OverrideCodesResourceWithRawResponse: def __init__(self, override_codes: OverrideCodesResource) -> None: self._override_codes = override_codes - self.list = to_raw_response_wrapper( - override_codes.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + override_codes.list # pyright: ignore[reportDeprecated], + ) ) self.get = to_raw_response_wrapper( override_codes.get, @@ -257,8 +264,10 @@ class AsyncOverrideCodesResourceWithRawResponse: def __init__(self, override_codes: AsyncOverrideCodesResource) -> None: self._override_codes = override_codes - self.list = async_to_raw_response_wrapper( - override_codes.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + override_codes.list # pyright: ignore[reportDeprecated], + ) ) self.get = async_to_raw_response_wrapper( override_codes.get, @@ -269,8 +278,10 @@ class OverrideCodesResourceWithStreamingResponse: def __init__(self, override_codes: OverrideCodesResource) -> None: self._override_codes = override_codes - self.list = to_streamed_response_wrapper( - override_codes.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + override_codes.list # pyright: ignore[reportDeprecated], + ) ) self.get = to_streamed_response_wrapper( override_codes.get, @@ -281,8 +292,10 @@ class AsyncOverrideCodesResourceWithStreamingResponse: def __init__(self, override_codes: AsyncOverrideCodesResource) -> None: self._override_codes = override_codes - self.list = async_to_streamed_response_wrapper( - override_codes.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + override_codes.list # pyright: ignore[reportDeprecated], + ) ) self.get = async_to_streamed_response_wrapper( override_codes.get, diff --git a/src/cloudflare/resources/zero_trust/devices/registrations.py b/src/cloudflare/resources/zero_trust/devices/registrations.py index ec7c90d4a0b..7e129cc380d 100644 --- a/src/cloudflare/resources/zero_trust/devices/registrations.py +++ b/src/cloudflare/resources/zero_trust/devices/registrations.py @@ -76,7 +76,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncCursorPagination[RegistrationListResponse]: """ - List WARP registrations. + Lists WARP registrations. Args: id: Filter by registration ID. @@ -388,7 +388,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[RegistrationListResponse, AsyncCursorPagination[RegistrationListResponse]]: """ - List WARP registrations. + Lists WARP registrations. Args: id: Filter by registration ID. diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index f26bb5f1a49..8cbceb332c1 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, List, Optional, cast import httpx @@ -43,6 +44,7 @@ def with_streaming_response(self) -> RevokeResourceWithStreamingResponse: """ return RevokeResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, *, @@ -55,8 +57,11 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[RevokeCreateResponse]: - """ - Revokes a list of registrations. + """Revokes a list of devices. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled. **Deprecated**: please use POST /accounts/{account_id}/devices/registrations/revoke instead. @@ -113,6 +118,7 @@ def with_streaming_response(self) -> AsyncRevokeResourceWithStreamingResponse: """ return AsyncRevokeResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, *, @@ -125,8 +131,11 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[RevokeCreateResponse]: - """ - Revokes a list of registrations. + """Revokes a list of devices. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled. **Deprecated**: please use POST /accounts/{account_id}/devices/registrations/revoke instead. @@ -167,8 +176,10 @@ class RevokeResourceWithRawResponse: def __init__(self, revoke: RevokeResource) -> None: self._revoke = revoke - self.create = to_raw_response_wrapper( - revoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + revoke.create # pyright: ignore[reportDeprecated], + ) ) @@ -176,8 +187,10 @@ class AsyncRevokeResourceWithRawResponse: def __init__(self, revoke: AsyncRevokeResource) -> None: self._revoke = revoke - self.create = async_to_raw_response_wrapper( - revoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + revoke.create # pyright: ignore[reportDeprecated], + ) ) @@ -185,8 +198,10 @@ class RevokeResourceWithStreamingResponse: def __init__(self, revoke: RevokeResource) -> None: self._revoke = revoke - self.create = to_streamed_response_wrapper( - revoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + revoke.create # pyright: ignore[reportDeprecated], + ) ) @@ -194,6 +209,8 @@ class AsyncRevokeResourceWithStreamingResponse: def __init__(self, revoke: AsyncRevokeResource) -> None: self._revoke = revoke - self.create = async_to_streamed_response_wrapper( - revoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + 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 61affe7dd93..e8a1c865dcd 100644 --- a/src/cloudflare/resources/zero_trust/devices/settings.py +++ b/src/cloudflare/resources/zero_trust/devices/settings.py @@ -107,6 +107,43 @@ def update( cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), ) + def delete( + 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[DeviceSettings]: + """ + Resets the current device settings for a Zero Trust 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._delete( + f"/accounts/{account_id}/devices/settings", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DeviceSettings]]._unwrapper, + ), + cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), + ) + def edit( self, *, @@ -291,6 +328,43 @@ async def update( cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), ) + async def delete( + 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[DeviceSettings]: + """ + Resets the current device settings for a Zero Trust 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 await self._delete( + f"/accounts/{account_id}/devices/settings", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DeviceSettings]]._unwrapper, + ), + cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), + ) + async def edit( self, *, @@ -399,6 +473,9 @@ def __init__(self, settings: SettingsResource) -> None: self.update = to_raw_response_wrapper( settings.update, ) + self.delete = to_raw_response_wrapper( + settings.delete, + ) self.edit = to_raw_response_wrapper( settings.edit, ) @@ -414,6 +491,9 @@ def __init__(self, settings: AsyncSettingsResource) -> None: self.update = async_to_raw_response_wrapper( settings.update, ) + self.delete = async_to_raw_response_wrapper( + settings.delete, + ) self.edit = async_to_raw_response_wrapper( settings.edit, ) @@ -429,6 +509,9 @@ def __init__(self, settings: SettingsResource) -> None: self.update = to_streamed_response_wrapper( settings.update, ) + self.delete = to_streamed_response_wrapper( + settings.delete, + ) self.edit = to_streamed_response_wrapper( settings.edit, ) @@ -444,6 +527,9 @@ def __init__(self, settings: AsyncSettingsResource) -> None: self.update = async_to_streamed_response_wrapper( settings.update, ) + self.delete = async_to_streamed_response_wrapper( + settings.delete, + ) self.edit = async_to_streamed_response_wrapper( settings.edit, ) diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index 053c4952721..70236c85538 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Any, List, Optional, cast import httpx @@ -43,6 +44,7 @@ def with_streaming_response(self) -> UnrevokeResourceWithStreamingResponse: """ return UnrevokeResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, *, @@ -55,8 +57,11 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UnrevokeCreateResponse]: - """ - Unrevokes a list of registrations. + """Unrevokes a list of devices. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled. **Deprecated**: please use POST /accounts/{account_id}/devices/registrations/unrevoke instead. @@ -113,6 +118,7 @@ def with_streaming_response(self) -> AsyncUnrevokeResourceWithStreamingResponse: """ return AsyncUnrevokeResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, *, @@ -125,8 +131,11 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UnrevokeCreateResponse]: - """ - Unrevokes a list of registrations. + """Unrevokes a list of devices. + + Not supported when + [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) + is enabled. **Deprecated**: please use POST /accounts/{account_id}/devices/registrations/unrevoke instead. @@ -167,8 +176,10 @@ class UnrevokeResourceWithRawResponse: def __init__(self, unrevoke: UnrevokeResource) -> None: self._unrevoke = unrevoke - self.create = to_raw_response_wrapper( - unrevoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + unrevoke.create # pyright: ignore[reportDeprecated], + ) ) @@ -176,8 +187,10 @@ class AsyncUnrevokeResourceWithRawResponse: def __init__(self, unrevoke: AsyncUnrevokeResource) -> None: self._unrevoke = unrevoke - self.create = async_to_raw_response_wrapper( - unrevoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + unrevoke.create # pyright: ignore[reportDeprecated], + ) ) @@ -185,8 +198,10 @@ class UnrevokeResourceWithStreamingResponse: def __init__(self, unrevoke: UnrevokeResource) -> None: self._unrevoke = unrevoke - self.create = to_streamed_response_wrapper( - unrevoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + unrevoke.create # pyright: ignore[reportDeprecated], + ) ) @@ -194,6 +209,8 @@ class AsyncUnrevokeResourceWithStreamingResponse: def __init__(self, unrevoke: AsyncUnrevokeResource) -> None: self._unrevoke = unrevoke - self.create = async_to_streamed_response_wrapper( - unrevoke.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + unrevoke.create # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/zero_trust/dex/__init__.py b/src/cloudflare/resources/zero_trust/dex/__init__.py index defe96da107..c088f4cb408 100644 --- a/src/cloudflare/resources/zero_trust/dex/__init__.py +++ b/src/cloudflare/resources/zero_trust/dex/__init__.py @@ -56,6 +56,14 @@ TracerouteTestsResourceWithStreamingResponse, AsyncTracerouteTestsResourceWithStreamingResponse, ) +from .warp_change_events import ( + WARPChangeEventsResource, + AsyncWARPChangeEventsResource, + WARPChangeEventsResourceWithRawResponse, + AsyncWARPChangeEventsResourceWithRawResponse, + WARPChangeEventsResourceWithStreamingResponse, + AsyncWARPChangeEventsResourceWithStreamingResponse, +) from .traceroute_test_results import ( TracerouteTestResultsResource, AsyncTracerouteTestResultsResource, @@ -66,6 +74,12 @@ ) __all__ = [ + "WARPChangeEventsResource", + "AsyncWARPChangeEventsResource", + "WARPChangeEventsResourceWithRawResponse", + "AsyncWARPChangeEventsResourceWithRawResponse", + "WARPChangeEventsResourceWithStreamingResponse", + "AsyncWARPChangeEventsResourceWithStreamingResponse", "CommandsResource", "AsyncCommandsResource", "CommandsResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dex/dex.py b/src/cloudflare/resources/zero_trust/dex/dex.py index 85b344d3fbb..ae354ec6334 100644 --- a/src/cloudflare/resources/zero_trust/dex/dex.py +++ b/src/cloudflare/resources/zero_trust/dex/dex.py @@ -36,6 +36,14 @@ CommandsResourceWithStreamingResponse, AsyncCommandsResourceWithStreamingResponse, ) +from .warp_change_events import ( + WARPChangeEventsResource, + AsyncWARPChangeEventsResource, + WARPChangeEventsResourceWithRawResponse, + AsyncWARPChangeEventsResourceWithRawResponse, + WARPChangeEventsResourceWithStreamingResponse, + AsyncWARPChangeEventsResourceWithStreamingResponse, +) from .http_tests.http_tests import ( HTTPTestsResource, AsyncHTTPTestsResource, @@ -65,6 +73,10 @@ class DEXResource(SyncAPIResource): + @cached_property + def warp_change_events(self) -> WARPChangeEventsResource: + return WARPChangeEventsResource(self._client) + @cached_property def commands(self) -> CommandsResource: return CommandsResource(self._client) @@ -114,6 +126,10 @@ def with_streaming_response(self) -> DEXResourceWithStreamingResponse: class AsyncDEXResource(AsyncAPIResource): + @cached_property + def warp_change_events(self) -> AsyncWARPChangeEventsResource: + return AsyncWARPChangeEventsResource(self._client) + @cached_property def commands(self) -> AsyncCommandsResource: return AsyncCommandsResource(self._client) @@ -166,6 +182,10 @@ class DEXResourceWithRawResponse: def __init__(self, dex: DEXResource) -> None: self._dex = dex + @cached_property + def warp_change_events(self) -> WARPChangeEventsResourceWithRawResponse: + return WARPChangeEventsResourceWithRawResponse(self._dex.warp_change_events) + @cached_property def commands(self) -> CommandsResourceWithRawResponse: return CommandsResourceWithRawResponse(self._dex.commands) @@ -199,6 +219,10 @@ class AsyncDEXResourceWithRawResponse: def __init__(self, dex: AsyncDEXResource) -> None: self._dex = dex + @cached_property + def warp_change_events(self) -> AsyncWARPChangeEventsResourceWithRawResponse: + return AsyncWARPChangeEventsResourceWithRawResponse(self._dex.warp_change_events) + @cached_property def commands(self) -> AsyncCommandsResourceWithRawResponse: return AsyncCommandsResourceWithRawResponse(self._dex.commands) @@ -232,6 +256,10 @@ class DEXResourceWithStreamingResponse: def __init__(self, dex: DEXResource) -> None: self._dex = dex + @cached_property + def warp_change_events(self) -> WARPChangeEventsResourceWithStreamingResponse: + return WARPChangeEventsResourceWithStreamingResponse(self._dex.warp_change_events) + @cached_property def commands(self) -> CommandsResourceWithStreamingResponse: return CommandsResourceWithStreamingResponse(self._dex.commands) @@ -265,6 +293,10 @@ class AsyncDEXResourceWithStreamingResponse: def __init__(self, dex: AsyncDEXResource) -> None: self._dex = dex + @cached_property + def warp_change_events(self) -> AsyncWARPChangeEventsResourceWithStreamingResponse: + return AsyncWARPChangeEventsResourceWithStreamingResponse(self._dex.warp_change_events) + @cached_property def commands(self) -> AsyncCommandsResourceWithStreamingResponse: return AsyncCommandsResourceWithStreamingResponse(self._dex.commands) diff --git a/src/cloudflare/resources/zero_trust/dex/warp_change_events.py b/src/cloudflare/resources/zero_trust/dex/warp_change_events.py new file mode 100644 index 00000000000..4a8f654af05 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dex/warp_change_events.py @@ -0,0 +1,261 @@ +# 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 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.zero_trust.dex import warp_change_event_get_params +from ....types.zero_trust.dex.warp_change_event_get_response import WARPChangeEventGetResponse + +__all__ = ["WARPChangeEventsResource", "AsyncWARPChangeEventsResource"] + + +class WARPChangeEventsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> WARPChangeEventsResourceWithRawResponse: + """ + 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 WARPChangeEventsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> WARPChangeEventsResourceWithStreamingResponse: + """ + 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 WARPChangeEventsResourceWithStreamingResponse(self) + + def get( + self, + *, + account_id: str, + from_: str, + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[WARPChangeEventGetResponse]: + """ + List WARP configuration and enablement toggle change events by device. + + Args: + from_: Start time for the query in ISO (RFC3339 - ISO 8601) format + + page: Page number of paginated results + + per_page: Number of items per page + + to: End time for the query in ISO (RFC3339 - ISO 8601) format + + account_name: Filter events by account name. + + config_name: Filter events by WARP configuration name changed from or to. Applicable to + type='config' events only. + + sort_order: Sort response by event timestamp. + + toggle: Filter events by type toggle value. Applicable to type='toggle' events only. + + type: Filter events by type 'config' or 'toggle' + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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}/dex/warp-change-events", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "from_": from_, + "page": page, + "per_page": per_page, + "to": to, + "account_name": account_name, + "config_name": config_name, + "sort_order": sort_order, + "toggle": toggle, + "type": type, + }, + warp_change_event_get_params.WARPChangeEventGetParams, + ), + post_parser=ResultWrapper[Optional[WARPChangeEventGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[WARPChangeEventGetResponse]], ResultWrapper[WARPChangeEventGetResponse]), + ) + + +class AsyncWARPChangeEventsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncWARPChangeEventsResourceWithRawResponse: + """ + 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 AsyncWARPChangeEventsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncWARPChangeEventsResourceWithStreamingResponse: + """ + 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 AsyncWARPChangeEventsResourceWithStreamingResponse(self) + + async def get( + self, + *, + account_id: str, + from_: str, + 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, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[WARPChangeEventGetResponse]: + """ + List WARP configuration and enablement toggle change events by device. + + Args: + from_: Start time for the query in ISO (RFC3339 - ISO 8601) format + + page: Page number of paginated results + + per_page: Number of items per page + + to: End time for the query in ISO (RFC3339 - ISO 8601) format + + account_name: Filter events by account name. + + config_name: Filter events by WARP configuration name changed from or to. Applicable to + type='config' events only. + + sort_order: Sort response by event timestamp. + + toggle: Filter events by type toggle value. Applicable to type='toggle' events only. + + type: Filter events by type 'config' or 'toggle' + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the 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}/dex/warp-change-events", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "from_": from_, + "page": page, + "per_page": per_page, + "to": to, + "account_name": account_name, + "config_name": config_name, + "sort_order": sort_order, + "toggle": toggle, + "type": type, + }, + warp_change_event_get_params.WARPChangeEventGetParams, + ), + post_parser=ResultWrapper[Optional[WARPChangeEventGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[WARPChangeEventGetResponse]], ResultWrapper[WARPChangeEventGetResponse]), + ) + + +class WARPChangeEventsResourceWithRawResponse: + def __init__(self, warp_change_events: WARPChangeEventsResource) -> None: + self._warp_change_events = warp_change_events + + self.get = to_raw_response_wrapper( + warp_change_events.get, + ) + + +class AsyncWARPChangeEventsResourceWithRawResponse: + def __init__(self, warp_change_events: AsyncWARPChangeEventsResource) -> None: + self._warp_change_events = warp_change_events + + self.get = async_to_raw_response_wrapper( + warp_change_events.get, + ) + + +class WARPChangeEventsResourceWithStreamingResponse: + def __init__(self, warp_change_events: WARPChangeEventsResource) -> None: + self._warp_change_events = warp_change_events + + self.get = to_streamed_response_wrapper( + warp_change_events.get, + ) + + +class AsyncWARPChangeEventsResourceWithStreamingResponse: + def __init__(self, warp_change_events: AsyncWARPChangeEventsResource) -> None: + self._warp_change_events = warp_change_events + + self.get = async_to_streamed_response_wrapper( + warp_change_events.get, + ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index 27b19b28a7c..9f78c302803 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -3,12 +3,11 @@ from __future__ import annotations from typing import Any, Type, Iterable, Optional, cast -from typing_extensions import overload import httpx from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import required_args, maybe_transform, async_maybe_transform +from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -22,7 +21,6 @@ from .....types.zero_trust.dlp.profile import Profile from .....types.zero_trust.dlp.profiles import custom_create_params, custom_update_params from .....types.zero_trust.dlp.context_awareness_param import ContextAwarenessParam -from .....types.zero_trust.dlp.profiles.custom_create_response import CustomCreateResponse __all__ = ["CustomResource", "AsyncCustomResource"] @@ -47,39 +45,11 @@ def with_streaming_response(self) -> CustomResourceWithStreamingResponse: """ return CustomResourceWithStreamingResponse(self) - @overload def create( self, *, account_id: str, - profiles: Iterable[custom_create_params.Variant0Profile], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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 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 - """ - ... - - @overload - def create( - self, - *, - account_id: str, - entries: Iterable[custom_create_params.DLPNewCustomProfileEntry], + entries: Iterable[custom_create_params.Entry], name: str, ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: int | NotGiven = NOT_GIVEN, @@ -87,14 +57,14 @@ def create( context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, ocr_enabled: bool | NotGiven = NOT_GIVEN, - shared_entries: Iterable[custom_create_params.DLPNewCustomProfileSharedEntry] | NotGiven = NOT_GIVEN, + shared_entries: Iterable[custom_create_params.SharedEntry] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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]: + ) -> Optional[Profile]: """ Creates a DLP custom profile. @@ -117,39 +87,14 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "profiles"], ["account_id", "entries", "name"]) - def create( - self, - *, - account_id: str, - profiles: Iterable[custom_create_params.Variant0Profile] | NotGiven = NOT_GIVEN, - entries: Iterable[custom_create_params.DLPNewCustomProfileEntry] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - 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.DLPNewCustomProfileSharedEntry] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[CustomCreateResponse], + Optional[Profile], self._post( f"/accounts/{account_id}/dlp/profiles/custom", body=maybe_transform( { - "profiles": profiles, "entries": entries, "name": name, "ai_context_enabled": ai_context_enabled, @@ -167,10 +112,10 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomCreateResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -359,39 +304,11 @@ def with_streaming_response(self) -> AsyncCustomResourceWithStreamingResponse: """ return AsyncCustomResourceWithStreamingResponse(self) - @overload async def create( self, *, account_id: str, - profiles: Iterable[custom_create_params.Variant0Profile], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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 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 - """ - ... - - @overload - async def create( - self, - *, - account_id: str, - entries: Iterable[custom_create_params.DLPNewCustomProfileEntry], + entries: Iterable[custom_create_params.Entry], name: str, ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: int | NotGiven = NOT_GIVEN, @@ -399,14 +316,14 @@ async def create( context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, ocr_enabled: bool | NotGiven = NOT_GIVEN, - shared_entries: Iterable[custom_create_params.DLPNewCustomProfileSharedEntry] | NotGiven = NOT_GIVEN, + shared_entries: Iterable[custom_create_params.SharedEntry] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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]: + ) -> Optional[Profile]: """ Creates a DLP custom profile. @@ -429,39 +346,14 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "profiles"], ["account_id", "entries", "name"]) - async def create( - self, - *, - account_id: str, - profiles: Iterable[custom_create_params.Variant0Profile] | NotGiven = NOT_GIVEN, - entries: Iterable[custom_create_params.DLPNewCustomProfileEntry] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - 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.DLPNewCustomProfileSharedEntry] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[CustomCreateResponse], + Optional[Profile], await self._post( f"/accounts/{account_id}/dlp/profiles/custom", body=await async_maybe_transform( { - "profiles": profiles, "entries": entries, "name": name, "ai_context_enabled": ai_context_enabled, @@ -479,10 +371,10 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomCreateResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py index fa8064f9111..9eafd67697f 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py @@ -50,11 +50,11 @@ def update( profile_id: str, *, account_id: str, - entries: Iterable[predefined_update_params.Entry], 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -89,11 +89,11 @@ def update( f"/accounts/{account_id}/dlp/profiles/predefined/{profile_id}", body=maybe_transform( { - "entries": entries, "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_update_params.PredefinedUpdateParams, @@ -182,11 +182,11 @@ async def update( profile_id: str, *, account_id: str, - entries: Iterable[predefined_update_params.Entry], 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -221,11 +221,11 @@ async def update( f"/accounts/{account_id}/dlp/profiles/predefined/{profile_id}", body=await async_maybe_transform( { - "entries": entries, "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_update_params.PredefinedUpdateParams, 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 102f0a4ae2b..1f4baf61b58 100644 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Optional import httpx @@ -41,6 +42,7 @@ def with_streaming_response(self) -> CustomCertificateResourceWithStreamingRespo """ return CustomCertificateResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def get( self, *, @@ -95,6 +97,7 @@ def with_streaming_response(self) -> AsyncCustomCertificateResourceWithStreaming """ return AsyncCustomCertificateResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def get( self, *, @@ -133,8 +136,10 @@ class CustomCertificateResourceWithRawResponse: def __init__(self, custom_certificate: CustomCertificateResource) -> None: self._custom_certificate = custom_certificate - self.get = to_raw_response_wrapper( - custom_certificate.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + custom_certificate.get # pyright: ignore[reportDeprecated], + ) ) @@ -142,8 +147,10 @@ class AsyncCustomCertificateResourceWithRawResponse: def __init__(self, custom_certificate: AsyncCustomCertificateResource) -> None: self._custom_certificate = custom_certificate - self.get = async_to_raw_response_wrapper( - custom_certificate.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + custom_certificate.get # pyright: ignore[reportDeprecated], + ) ) @@ -151,8 +158,10 @@ class CustomCertificateResourceWithStreamingResponse: def __init__(self, custom_certificate: CustomCertificateResource) -> None: self._custom_certificate = custom_certificate - self.get = to_streamed_response_wrapper( - custom_certificate.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + custom_certificate.get # pyright: ignore[reportDeprecated], + ) ) @@ -160,6 +169,8 @@ class AsyncCustomCertificateResourceWithStreamingResponse: def __init__(self, custom_certificate: AsyncCustomCertificateResource) -> None: self._custom_certificate = custom_certificate - self.get = async_to_streamed_response_wrapper( - custom_certificate.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + custom_certificate.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index 056a98d1352..62967f56cd0 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -267,7 +267,7 @@ def edit( list_id: str, *, account_id: str, - append: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, + append: Iterable[list_edit_params.Append] | NotGiven = NOT_GIVEN, remove: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -282,7 +282,7 @@ def edit( Args: list_id: API Resource UUID tag. - append: The items in the list. + append: items to add to the list. remove: A list of the item values you want to remove. @@ -591,7 +591,7 @@ async def edit( list_id: str, *, account_id: str, - append: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, + append: Iterable[list_edit_params.Append] | NotGiven = NOT_GIVEN, remove: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -606,7 +606,7 @@ async def edit( Args: list_id: API Resource UUID tag. - append: The items in the list. + append: items to add to the list. remove: A list of the item values you want to remove. diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index 0ee978b712f..a535df03399 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, cast from typing_extensions import Literal @@ -45,6 +46,9 @@ def with_streaming_response(self) -> NetworksResourceWithStreamingResponse: """ return NetworksResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs." + ) def create( self, ip_network_encoded: str, @@ -108,6 +112,9 @@ def create( cast_to=cast(Type[Route], ResultWrapper[Route]), ) + @typing_extensions.deprecated( + "This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs." + ) def delete( self, ip_network_encoded: str, @@ -177,6 +184,9 @@ def delete( cast_to=cast(Type[Route], ResultWrapper[Route]), ) + @typing_extensions.deprecated( + "This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs." + ) def edit( self, ip_network_encoded: str, @@ -244,6 +254,9 @@ def with_streaming_response(self) -> AsyncNetworksResourceWithStreamingResponse: """ return AsyncNetworksResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs." + ) async def create( self, ip_network_encoded: str, @@ -307,6 +320,9 @@ async def create( cast_to=cast(Type[Route], ResultWrapper[Route]), ) + @typing_extensions.deprecated( + "This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs." + ) async def delete( self, ip_network_encoded: str, @@ -376,6 +392,9 @@ async def delete( cast_to=cast(Type[Route], ResultWrapper[Route]), ) + @typing_extensions.deprecated( + "This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs." + ) async def edit( self, ip_network_encoded: str, @@ -427,14 +446,20 @@ class NetworksResourceWithRawResponse: def __init__(self, networks: NetworksResource) -> None: self._networks = networks - self.create = to_raw_response_wrapper( - networks.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + networks.create # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - networks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + networks.delete # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_raw_response_wrapper( - networks.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + networks.edit # pyright: ignore[reportDeprecated], + ) ) @@ -442,14 +467,20 @@ class AsyncNetworksResourceWithRawResponse: def __init__(self, networks: AsyncNetworksResource) -> None: self._networks = networks - self.create = async_to_raw_response_wrapper( - networks.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + networks.create # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - networks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + networks.delete # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_raw_response_wrapper( - networks.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + networks.edit # pyright: ignore[reportDeprecated], + ) ) @@ -457,14 +488,20 @@ class NetworksResourceWithStreamingResponse: def __init__(self, networks: NetworksResource) -> None: self._networks = networks - self.create = to_streamed_response_wrapper( - networks.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + networks.create # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - networks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + networks.delete # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_streamed_response_wrapper( - networks.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + networks.edit # pyright: ignore[reportDeprecated], + ) ) @@ -472,12 +509,18 @@ class AsyncNetworksResourceWithStreamingResponse: def __init__(self, networks: AsyncNetworksResource) -> None: self._networks = networks - self.create = async_to_streamed_response_wrapper( - networks.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + networks.create # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - networks.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + networks.delete # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_streamed_response_wrapper( - networks.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + networks.edit # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py index 4fe59cd389e..c05f27103f1 100644 --- a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py +++ b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py @@ -56,6 +56,7 @@ def create( name: str, comment: str | NotGiven = NOT_GIVEN, is_default: bool | NotGiven = NOT_GIVEN, + is_default_network: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -75,6 +76,8 @@ def create( is_default: If `true`, this virtual network is the default for the account. + is_default_network: If `true`, this virtual network is the default for the account. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -92,6 +95,7 @@ def create( "name": name, "comment": comment, "is_default": is_default, + "is_default_network": is_default_network, }, virtual_network_create_params.VirtualNetworkCreateParams, ), @@ -344,6 +348,7 @@ async def create( name: str, comment: str | NotGiven = NOT_GIVEN, is_default: bool | NotGiven = NOT_GIVEN, + is_default_network: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -363,6 +368,8 @@ async def create( is_default: If `true`, this virtual network is the default for the account. + is_default_network: If `true`, this virtual network is the default for the account. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -380,6 +387,7 @@ async def create( "name": name, "comment": comment, "is_default": is_default, + "is_default_network": is_default_network, }, virtual_network_create_params.VirtualNetworkCreateParams, ), diff --git a/src/cloudflare/resources/zones/__init__.py b/src/cloudflare/resources/zones/__init__.py index cbe662019bf..54ff508e151 100644 --- a/src/cloudflare/resources/zones/__init__.py +++ b/src/cloudflare/resources/zones/__init__.py @@ -40,14 +40,6 @@ RatePlansResourceWithStreamingResponse, AsyncRatePlansResourceWithStreamingResponse, ) -from .subscriptions import ( - SubscriptionsResource, - AsyncSubscriptionsResource, - SubscriptionsResourceWithRawResponse, - AsyncSubscriptionsResourceWithRawResponse, - SubscriptionsResourceWithStreamingResponse, - AsyncSubscriptionsResourceWithStreamingResponse, -) from .activation_check import ( ActivationCheckResource, AsyncActivationCheckResource, @@ -90,12 +82,6 @@ "AsyncHoldsResourceWithRawResponse", "HoldsResourceWithStreamingResponse", "AsyncHoldsResourceWithStreamingResponse", - "SubscriptionsResource", - "AsyncSubscriptionsResource", - "SubscriptionsResourceWithRawResponse", - "AsyncSubscriptionsResourceWithRawResponse", - "SubscriptionsResourceWithStreamingResponse", - "AsyncSubscriptionsResourceWithStreamingResponse", "PlansResource", "AsyncPlansResource", "PlansResourceWithRawResponse", diff --git a/src/cloudflare/resources/zones/subscriptions.py b/src/cloudflare/resources/zones/subscriptions.py deleted file mode 100644 index e6852a48aef..00000000000 --- a/src/cloudflare/resources/zones/subscriptions.py +++ /dev/null @@ -1,446 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Any, 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 ..._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.zones import subscription_create_params, subscription_update_params -from ..._base_client import make_request_options -from ...types.shared_params.rate_plan import RatePlan -from ...types.zones.subscription_get_response import SubscriptionGetResponse -from ...types.zones.subscription_create_response import SubscriptionCreateResponse -from ...types.zones.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, - identifier: str, - *, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionCreateResponse: - """ - Create a zone subscription, either plan or add-ons. - - Args: - identifier: Subscription identifier tag. - - frequency: How often the subscription is renewed automatically. - - rate_plan: The rate plan applied to 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 identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionCreateResponse, - self._post( - f"/zones/{identifier}/subscription", - body=maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionCreateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def update( - self, - identifier: str, - *, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionUpdateResponse: - """ - Updates zone subscriptions, either plan or add-ons. - - Args: - identifier: Subscription identifier tag. - - frequency: How often the subscription is renewed automatically. - - rate_plan: The rate plan applied to 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 identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionUpdateResponse, - self._put( - f"/zones/{identifier}/subscription", - body=maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def get( - self, - identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionGetResponse: - """ - Lists zone subscription details. - - Args: - identifier: Subscription identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionGetResponse, - self._get( - f"/zones/{identifier}/subscription", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[SubscriptionGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionGetResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -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, - identifier: str, - *, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionCreateResponse: - """ - Create a zone subscription, either plan or add-ons. - - Args: - identifier: Subscription identifier tag. - - frequency: How often the subscription is renewed automatically. - - rate_plan: The rate plan applied to 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 identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionCreateResponse, - await self._post( - f"/zones/{identifier}/subscription", - body=await async_maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionCreateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def update( - self, - identifier: str, - *, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionUpdateResponse: - """ - Updates zone subscriptions, either plan or add-ons. - - Args: - identifier: Subscription identifier tag. - - frequency: How often the subscription is renewed automatically. - - rate_plan: The rate plan applied to 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 identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionUpdateResponse, - await self._put( - f"/zones/{identifier}/subscription", - body=await async_maybe_transform( - { - "frequency": frequency, - "rate_plan": rate_plan, - }, - 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[SubscriptionUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def get( - self, - identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionGetResponse: - """ - Lists zone subscription details. - - Args: - identifier: Subscription identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionGetResponse, - await self._get( - f"/zones/{identifier}/subscription", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[SubscriptionGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionGetResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -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.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.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.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.get = async_to_streamed_response_wrapper( - subscriptions.get, - ) diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index a4f7766173c..e49acb06fa5 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -52,14 +52,6 @@ from ..._wrappers import ResultWrapper from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...types.zones import zone_edit_params, zone_list_params, zone_create_params -from .subscriptions import ( - SubscriptionsResource, - AsyncSubscriptionsResource, - SubscriptionsResourceWithRawResponse, - AsyncSubscriptionsResourceWithRawResponse, - SubscriptionsResourceWithStreamingResponse, - AsyncSubscriptionsResourceWithStreamingResponse, -) from ..._base_client import AsyncPaginator, make_request_options from .activation_check import ( ActivationCheckResource, @@ -101,10 +93,6 @@ def custom_nameservers(self) -> CustomNameserversResource: def holds(self) -> HoldsResource: return HoldsResource(self._client) - @cached_property - def subscriptions(self) -> SubscriptionsResource: - return SubscriptionsResource(self._client) - @cached_property def plans(self) -> PlansResource: return PlansResource(self._client) @@ -149,7 +137,7 @@ def create( Create Zone Args: - name: The domain name + name: The domain name. type: A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. @@ -228,7 +216,7 @@ def list( per_page: Number of zones per page. - status: A zone status + status: Specify a zone status to filter by. extra_headers: Send extra headers @@ -421,10 +409,6 @@ def custom_nameservers(self) -> AsyncCustomNameserversResource: def holds(self) -> AsyncHoldsResource: return AsyncHoldsResource(self._client) - @cached_property - def subscriptions(self) -> AsyncSubscriptionsResource: - return AsyncSubscriptionsResource(self._client) - @cached_property def plans(self) -> AsyncPlansResource: return AsyncPlansResource(self._client) @@ -469,7 +453,7 @@ async def create( Create Zone Args: - name: The domain name + name: The domain name. type: A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. @@ -548,7 +532,7 @@ def list( per_page: Number of zones per page. - status: A zone status + status: Specify a zone status to filter by. extra_headers: Send extra headers @@ -760,10 +744,6 @@ def custom_nameservers(self) -> CustomNameserversResourceWithRawResponse: def holds(self) -> HoldsResourceWithRawResponse: return HoldsResourceWithRawResponse(self._zones.holds) - @cached_property - def subscriptions(self) -> SubscriptionsResourceWithRawResponse: - return SubscriptionsResourceWithRawResponse(self._zones.subscriptions) - @cached_property def plans(self) -> PlansResourceWithRawResponse: return PlansResourceWithRawResponse(self._zones.plans) @@ -809,10 +789,6 @@ def custom_nameservers(self) -> AsyncCustomNameserversResourceWithRawResponse: def holds(self) -> AsyncHoldsResourceWithRawResponse: return AsyncHoldsResourceWithRawResponse(self._zones.holds) - @cached_property - def subscriptions(self) -> AsyncSubscriptionsResourceWithRawResponse: - return AsyncSubscriptionsResourceWithRawResponse(self._zones.subscriptions) - @cached_property def plans(self) -> AsyncPlansResourceWithRawResponse: return AsyncPlansResourceWithRawResponse(self._zones.plans) @@ -858,10 +834,6 @@ def custom_nameservers(self) -> CustomNameserversResourceWithStreamingResponse: def holds(self) -> HoldsResourceWithStreamingResponse: return HoldsResourceWithStreamingResponse(self._zones.holds) - @cached_property - def subscriptions(self) -> SubscriptionsResourceWithStreamingResponse: - return SubscriptionsResourceWithStreamingResponse(self._zones.subscriptions) - @cached_property def plans(self) -> PlansResourceWithStreamingResponse: return PlansResourceWithStreamingResponse(self._zones.plans) @@ -907,10 +879,6 @@ def custom_nameservers(self) -> AsyncCustomNameserversResourceWithStreamingRespo def holds(self) -> AsyncHoldsResourceWithStreamingResponse: return AsyncHoldsResourceWithStreamingResponse(self._zones.holds) - @cached_property - def subscriptions(self) -> AsyncSubscriptionsResourceWithStreamingResponse: - return AsyncSubscriptionsResourceWithStreamingResponse(self._zones.subscriptions) - @cached_property def plans(self) -> AsyncPlansResourceWithStreamingResponse: return AsyncPlansResourceWithStreamingResponse(self._zones.plans) diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index 7185ea93d97..142051f805b 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -21,6 +21,4 @@ from .account_delete_response import AccountDeleteResponse as AccountDeleteResponse from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams -from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse from .subscription_delete_response import SubscriptionDeleteResponse as SubscriptionDeleteResponse -from .subscription_update_response import SubscriptionUpdateResponse as SubscriptionUpdateResponse diff --git a/src/cloudflare/types/accounts/account_update_params.py b/src/cloudflare/types/accounts/account_update_params.py index 8351bda688d..a5432fe7d70 100644 --- a/src/cloudflare/types/accounts/account_update_params.py +++ b/src/cloudflare/types/accounts/account_update_params.py @@ -11,6 +11,9 @@ class AccountUpdateParams(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" + id: Required[str] + """Identifier""" + name: Required[str] """Account name""" diff --git a/src/cloudflare/types/accounts/logs/audit_list_params.py b/src/cloudflare/types/accounts/logs/audit_list_params.py index 0d0bd685341..f5189cf45f4 100644 --- a/src/cloudflare/types/accounts/logs/audit_list_params.py +++ b/src/cloudflare/types/accounts/logs/audit_list_params.py @@ -2,13 +2,36 @@ from __future__ import annotations -from typing import Union +from typing import List, Union, Iterable from datetime import date from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo -__all__ = ["AuditListParams"] +__all__ = [ + "AuditListParams", + "AccountName", + "ActionResult", + "ActionType", + "ActorContext", + "ActorEmail", + "ActorID", + "ActorIPAddress", + "ActorTokenID", + "ActorTokenName", + "ActorType", + "AuditLogID", + "RawCfRayID", + "RawMethod", + "RawStatusCode", + "RawURI", + "ResourceID", + "ResourceProduct", + "ResourceScope", + "ResourceType", + "ZoneID", + "ZoneName", +] class AuditListParams(TypedDict, total=False): @@ -16,49 +39,40 @@ class AuditListParams(TypedDict, total=False): """The unique id that identifies the account.""" before: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """ - Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and before the specified date. + """Limits the returned results to logs older than the specified date. + + This can be a date string 2019-04-30 (interpreted in UTC) or an absolute + timestamp that conforms to RFC3339. """ since: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """ - Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and after the specified date. + """Limits the returned results to logs newer than the specified date. + + This can be a date string 2019-04-30 (interpreted in UTC) or an absolute + timestamp that conforms to RFC3339. """ - account_name: str - """Filters by the account name.""" + account_name: AccountName - action_result: Literal["success", "failure"] - """Whether the action was successful or not.""" + action_result: ActionResult - action_type: Literal["create", "delete", "view", "update"] - """Filters by the action type.""" + action_type: ActionType - actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] - """Filters by the actor context.""" + actor_context: ActorContext - actor_email: str - """Filters by the actor's email address.""" + actor_email: ActorEmail - actor_id: str - """Filters by the actor ID. This can be either the Account ID or User ID.""" + actor_id: ActorID - actor_ip_address: str - """The IP address where the action was initiated.""" + actor_ip_address: ActorIPAddress - actor_token_id: str - """Filters by the API token ID when the actor context is an api_token or oauth.""" + actor_token_id: ActorTokenID - actor_token_name: str - """Filters by the API token name when the actor context is an api_token or oauth.""" + actor_token_name: ActorTokenName - actor_type: Literal["cloudflare_admin", "account", "user"] - """Filters by the actor type.""" + actor_type: ActorType - audit_log_id: str - """Finds a specific log by its ID.""" + audit_log_id: AuditLogID cursor: str """The cursor is an opaque token used to paginate through large sets of records. @@ -78,38 +92,295 @@ class AuditListParams(TypedDict, total=False): there are more than the limit. """ - raw_cf_rayid: Annotated[str, PropertyInfo(alias="raw_cf_ray_id")] - """Filters by the response CF Ray ID.""" + raw_cf_rayid: Annotated[RawCfRayID, PropertyInfo(alias="raw_cf_ray_id")] - raw_method: str - """The HTTP method for the API call.""" + raw_method: RawMethod - raw_status_code: int - """The response status code that was returned.""" + raw_status_code: RawStatusCode - raw_uri: str - """Filters by the request URI.""" + raw_uri: RawURI - resource_id: str - """Filters by the resource ID.""" + resource_id: ResourceID - resource_product: str - """ - Filters audit logs by the Cloudflare product associated with the changed - resource. - """ + resource_product: ResourceProduct + + resource_scope: ResourceScope + + resource_type: ResourceType + + zone_id: ZoneID + + zone_name: ZoneName + + +_AccountNameReservedKeywords = TypedDict( + "_AccountNameReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class AccountName(_AccountNameReservedKeywords, total=False): + pass + + +_ActionResultReservedKeywords = TypedDict( + "_ActionResultReservedKeywords", + { + "not": List[Literal["success", "failure"]], + }, + total=False, +) + + +class ActionResult(_ActionResultReservedKeywords, total=False): + pass + + +_ActionTypeReservedKeywords = TypedDict( + "_ActionTypeReservedKeywords", + { + "not": List[Literal["create", "delete", "view", "update"]], + }, + total=False, +) + + +class ActionType(_ActionTypeReservedKeywords, total=False): + pass + + +_ActorContextReservedKeywords = TypedDict( + "_ActorContextReservedKeywords", + { + "not": List[Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"]], + }, + total=False, +) + + +class ActorContext(_ActorContextReservedKeywords, total=False): + pass + + +_ActorEmailReservedKeywords = TypedDict( + "_ActorEmailReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ActorEmail(_ActorEmailReservedKeywords, total=False): + pass + + +_ActorIDReservedKeywords = TypedDict( + "_ActorIDReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ActorID(_ActorIDReservedKeywords, total=False): + pass + + +_ActorIPAddressReservedKeywords = TypedDict( + "_ActorIPAddressReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ActorIPAddress(_ActorIPAddressReservedKeywords, total=False): + pass + + +_ActorTokenIDReservedKeywords = TypedDict( + "_ActorTokenIDReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ActorTokenID(_ActorTokenIDReservedKeywords, total=False): + pass + + +_ActorTokenNameReservedKeywords = TypedDict( + "_ActorTokenNameReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ActorTokenName(_ActorTokenNameReservedKeywords, total=False): + pass + + +_ActorTypeReservedKeywords = TypedDict( + "_ActorTypeReservedKeywords", + { + "not": List[Literal["account", "cloudflare_admin", "system", "user"]], + }, + total=False, +) + + +class ActorType(_ActorTypeReservedKeywords, total=False): + pass + + +_AuditLogIDReservedKeywords = TypedDict( + "_AuditLogIDReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class AuditLogID(_AuditLogIDReservedKeywords, total=False): + pass + + +_RawCfRayIDReservedKeywords = TypedDict( + "_RawCfRayIDReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class RawCfRayID(_RawCfRayIDReservedKeywords, total=False): + pass + + +_RawMethodReservedKeywords = TypedDict( + "_RawMethodReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class RawMethod(_RawMethodReservedKeywords, total=False): + pass + + +_RawStatusCodeReservedKeywords = TypedDict( + "_RawStatusCodeReservedKeywords", + { + "not": Iterable[int], + }, + total=False, +) + + +class RawStatusCode(_RawStatusCodeReservedKeywords, total=False): + pass + + +_RawURIReservedKeywords = TypedDict( + "_RawURIReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class RawURI(_RawURIReservedKeywords, total=False): + pass + + +_ResourceIDReservedKeywords = TypedDict( + "_ResourceIDReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ResourceID(_ResourceIDReservedKeywords, total=False): + pass + + +_ResourceProductReservedKeywords = TypedDict( + "_ResourceProductReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ResourceProduct(_ResourceProductReservedKeywords, total=False): + pass + + +_ResourceScopeReservedKeywords = TypedDict( + "_ResourceScopeReservedKeywords", + { + "not": List[Literal["accounts", "user", "zones"]], + }, + total=False, +) + + +class ResourceScope(_ResourceScopeReservedKeywords, total=False): + pass + + +_ResourceTypeReservedKeywords = TypedDict( + "_ResourceTypeReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ResourceType(_ResourceTypeReservedKeywords, total=False): + pass + + +_ZoneIDReservedKeywords = TypedDict( + "_ZoneIDReservedKeywords", + { + "not": List[str], + }, + total=False, +) + + +class ZoneID(_ZoneIDReservedKeywords, total=False): + pass - resource_scope: Literal["accounts", "user", "zones"] - """ - Filters by the resource scope, specifying whether the resource is associated - with an user, an account, or a zone. - """ - resource_type: str - """Filters audit logs based on the unique type of resource changed by the action.""" +_ZoneNameReservedKeywords = TypedDict( + "_ZoneNameReservedKeywords", + { + "not": List[str], + }, + total=False, +) - zone_id: str - """Filters by the zone ID.""" - zone_name: str - """Filters by the zone name associated with the change.""" +class ZoneName(_ZoneNameReservedKeywords, total=False): + pass diff --git a/src/cloudflare/types/accounts/subscription_create_response.py b/src/cloudflare/types/accounts/subscription_create_response.py deleted file mode 100644 index 5ba8b499d96..00000000000 --- a/src/cloudflare/types/accounts/subscription_create_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -__all__ = ["SubscriptionCreateResponse"] - -SubscriptionCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/accounts/subscription_update_response.py b/src/cloudflare/types/accounts/subscription_update_response.py deleted file mode 100644 index 71628cdb370..00000000000 --- a/src/cloudflare/types/accounts/subscription_update_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -__all__ = ["SubscriptionUpdateResponse"] - -SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/addressing/address_map_create_response.py b/src/cloudflare/types/addressing/address_map_create_response.py index 08303310e4e..ac50d140e86 100644 --- a/src/cloudflare/types/addressing/address_map_create_response.py +++ b/src/cloudflare/types/addressing/address_map_create_response.py @@ -4,16 +4,10 @@ from datetime import datetime from .kind import Kind +from ..ips.ips import IPs from ..._models import BaseModel -__all__ = ["AddressMapCreateResponse", "IP", "Membership"] - - -class IP(BaseModel): - created_at: Optional[datetime] = None - - ip: Optional[str] = None - """An IPv4 or IPv6 address.""" +__all__ = ["AddressMapCreateResponse", "Membership"] class Membership(BaseModel): @@ -69,7 +63,7 @@ class AddressMapCreateResponse(BaseModel): map is enabled. """ - ips: Optional[List[IP]] = None + ips: Optional[IPs] = None """The set of IPs on the Address Map.""" memberships: Optional[List[Membership]] = None diff --git a/src/cloudflare/types/addressing/address_map_get_response.py b/src/cloudflare/types/addressing/address_map_get_response.py index 2eda9977d94..aa6a1c2233c 100644 --- a/src/cloudflare/types/addressing/address_map_get_response.py +++ b/src/cloudflare/types/addressing/address_map_get_response.py @@ -4,16 +4,10 @@ from datetime import datetime from .kind import Kind +from ..ips.ips import IPs from ..._models import BaseModel -__all__ = ["AddressMapGetResponse", "IP", "Membership"] - - -class IP(BaseModel): - created_at: Optional[datetime] = None - - ip: Optional[str] = None - """An IPv4 or IPv6 address.""" +__all__ = ["AddressMapGetResponse", "Membership"] class Membership(BaseModel): @@ -69,7 +63,7 @@ class AddressMapGetResponse(BaseModel): map is enabled. """ - ips: Optional[List[IP]] = None + ips: Optional[IPs] = None """The set of IPs on the Address Map.""" memberships: Optional[List[Membership]] = None diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py index c2646505ef3..098c0dc717e 100644 --- a/src/cloudflare/types/ai/ai_run_params.py +++ b/src/cloudflare/types/ai/ai_run_params.py @@ -24,10 +24,10 @@ "MessagesToolUnionMember0", "MessagesToolUnionMember0Parameters", "MessagesToolUnionMember0ParametersProperties", - "MessagesToolUnionMember1", - "MessagesToolUnionMember1Function", - "MessagesToolUnionMember1FunctionParameters", - "MessagesToolUnionMember1FunctionParametersProperties", + "MessagesToolFunction", + "MessagesToolFunctionFunction", + "MessagesToolFunctionFunctionParameters", + "MessagesToolFunctionFunctionParametersProperties", "Translation", "Summarization", "ImageToText", @@ -331,7 +331,7 @@ class MessagesToolUnionMember0(TypedDict, total=False): """Schema defining the parameters accepted by the tool.""" -class MessagesToolUnionMember1FunctionParametersProperties(TypedDict, total=False): +class MessagesToolFunctionFunctionParametersProperties(TypedDict, total=False): description: Required[str] """A description of the expected parameter.""" @@ -339,8 +339,8 @@ class MessagesToolUnionMember1FunctionParametersProperties(TypedDict, total=Fals """The data type of the parameter.""" -class MessagesToolUnionMember1FunctionParameters(TypedDict, total=False): - properties: Required[Dict[str, MessagesToolUnionMember1FunctionParametersProperties]] +class MessagesToolFunctionFunctionParameters(TypedDict, total=False): + properties: Required[Dict[str, MessagesToolFunctionFunctionParametersProperties]] """Definitions of each parameter.""" type: Required[str] @@ -350,26 +350,26 @@ class MessagesToolUnionMember1FunctionParameters(TypedDict, total=False): """List of required parameter names.""" -class MessagesToolUnionMember1Function(TypedDict, total=False): +class MessagesToolFunctionFunction(TypedDict, total=False): description: Required[str] """A brief description of what the function does.""" name: Required[str] """The name of the function.""" - parameters: Required[MessagesToolUnionMember1FunctionParameters] + parameters: Required[MessagesToolFunctionFunctionParameters] """Schema defining the parameters accepted by the function.""" -class MessagesToolUnionMember1(TypedDict, total=False): - function: Required[MessagesToolUnionMember1Function] +class MessagesToolFunction(TypedDict, total=False): + function: Required[MessagesToolFunctionFunction] """Details of the function tool.""" type: Required[str] """Specifies the type of tool (e.g., 'function').""" -MessagesTool: TypeAlias = Union[MessagesToolUnionMember0, MessagesToolUnionMember1] +MessagesTool: TypeAlias = Union[MessagesToolUnionMember0, MessagesToolFunction] class Translation(TypedDict, total=False): diff --git a/src/cloudflare/types/cloud_connector/rule_list_response.py b/src/cloudflare/types/cloud_connector/rule_list_response.py index 059d139b74b..1f67c74828b 100644 --- a/src/cloudflare/types/cloud_connector/rule_list_response.py +++ b/src/cloudflare/types/cloud_connector/rule_list_response.py @@ -25,5 +25,5 @@ class RuleListResponse(BaseModel): parameters: Optional[Parameters] = None """Parameters of Cloud Connector Rule""" - provider: Optional[Literal["aws_s3", "r2", "gcp_storage", "azure_storage"]] = None + provider: Optional[Literal["aws_s3", "cloudflare_r2", "gcp_storage", "azure_storage"]] = None """Cloud Provider type""" diff --git a/src/cloudflare/types/cloud_connector/rule_update_params.py b/src/cloudflare/types/cloud_connector/rule_update_params.py index 733663d8b30..430523d4987 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_params.py +++ b/src/cloudflare/types/cloud_connector/rule_update_params.py @@ -32,5 +32,5 @@ class Rule(TypedDict, total=False): parameters: RuleParameters """Parameters of Cloud Connector Rule""" - provider: Literal["aws_s3", "r2", "gcp_storage", "azure_storage"] + provider: Literal["aws_s3", "cloudflare_r2", "gcp_storage", "azure_storage"] """Cloud Provider type""" diff --git a/src/cloudflare/types/cloud_connector/rule_update_response.py b/src/cloudflare/types/cloud_connector/rule_update_response.py index 2830970723a..fa4cc31b65d 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_response.py +++ b/src/cloudflare/types/cloud_connector/rule_update_response.py @@ -25,5 +25,5 @@ class RuleUpdateResponse(BaseModel): parameters: Optional[Parameters] = None """Parameters of Cloud Connector Rule""" - provider: Optional[Literal["aws_s3", "r2", "gcp_storage", "azure_storage"]] = None + provider: Optional[Literal["aws_s3", "cloudflare_r2", "gcp_storage", "azure_storage"]] = None """Cloud Provider type""" diff --git a/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py b/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py index 8bc8562593d..366b219d1b6 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py @@ -12,7 +12,7 @@ class ThreatEventBulkCreateParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" data: Required[Iterable[Data]] diff --git a/src/cloudflare/types/cloudforce_one/threat_event_create_params.py b/src/cloudflare/types/cloudforce_one/threat_event_create_params.py index 35173d061e0..225d471ad0b 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_create_params.py @@ -12,7 +12,7 @@ class ThreatEventCreateParams(TypedDict, total=False): - path_account_id: Required[Annotated[float, PropertyInfo(alias="account_id")]] + path_account_id: Required[Annotated[str, PropertyInfo(alias="account_id")]] """Account ID.""" attacker: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py index 87e4cb48c22..1878da8e9e5 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py @@ -12,7 +12,7 @@ class ThreatEventEditParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" attacker: str diff --git a/src/cloudflare/types/cloudforce_one/threat_event_list_params.py b/src/cloudflare/types/cloudforce_one/threat_event_list_params.py index 7367a17ef11..bf5c8933e7b 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_list_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_list_params.py @@ -11,7 +11,7 @@ class ThreatEventListParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" dataset_id: Annotated[List[str], PropertyInfo(alias="datasetId")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py index 9b3653a1d01..e16505b938b 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py @@ -11,7 +11,7 @@ class CategoryCreateParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" kill_chain: Required[Annotated[float, PropertyInfo(alias="killChain")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py index 00b376f8b7d..8299b8d8c14 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py @@ -11,7 +11,7 @@ class CategoryEditParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" kill_chain: Annotated[float, PropertyInfo(alias="killChain")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py index a2446cb8d79..dfeaa66e4c5 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py @@ -10,7 +10,7 @@ class DatasetCreateParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" is_public: Required[Annotated[bool, PropertyInfo(alias="isPublic")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py index 8ecacdd2161..105e8e30834 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py @@ -10,7 +10,7 @@ class DatasetEditParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" is_public: Required[Annotated[bool, PropertyInfo(alias="isPublic")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/datasets/__init__.py b/src/cloudflare/types/cloudforce_one/threat_events/datasets/__init__.py new file mode 100644 index 00000000000..090c4642eea --- /dev/null +++ b/src/cloudflare/types/cloudforce_one/threat_events/datasets/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .health_get_response import HealthGetResponse as HealthGetResponse diff --git a/src/cloudflare/types/cloudforce_one/threat_events/datasets/health_get_response.py b/src/cloudflare/types/cloudforce_one/threat_events/datasets/health_get_response.py new file mode 100644 index 00000000000..cde38aad4db --- /dev/null +++ b/src/cloudflare/types/cloudforce_one/threat_events/datasets/health_get_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ....._models import BaseModel + +__all__ = ["HealthGetResponse", "Items"] + + +class Items(BaseModel): + type: str + + +class HealthGetResponse(BaseModel): + items: Items + + type: str diff --git a/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py index bab2ee5ff2a..c4c503b7db5 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py @@ -9,7 +9,7 @@ class EventTagCreateParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" tags: Required[List[str]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py index ba5b759355d..bcb266c36be 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py @@ -8,7 +8,7 @@ class InsightCreateParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" content: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py index 53d8a727c84..5fd3dc33226 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py @@ -8,7 +8,7 @@ class InsightEditParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" event_id: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py index 6a980705780..c1a14dd1a1a 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py @@ -8,7 +8,7 @@ class RawEditParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" event_id: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py index d5d1b9b5e75..5177d6fd290 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py @@ -8,7 +8,7 @@ class TagCreateParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] """Account ID.""" name: Required[str] diff --git a/src/cloudflare/types/d1/database_import_params.py b/src/cloudflare/types/d1/database_import_params.py index 222295abdd8..63afb92175e 100644 --- a/src/cloudflare/types/d1/database_import_params.py +++ b/src/cloudflare/types/d1/database_import_params.py @@ -5,10 +5,10 @@ from typing import Union from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["DatabaseImportParams", "Variant0", "Variant1", "Variant2"] +__all__ = ["DatabaseImportParams", "Init", "Ingest", "Poll"] -class Variant0(TypedDict, total=False): +class Init(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" @@ -23,7 +23,7 @@ class Variant0(TypedDict, total=False): """ -class Variant1(TypedDict, total=False): +class Ingest(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" @@ -40,7 +40,7 @@ class Variant1(TypedDict, total=False): """The filename you have successfully uploaded.""" -class Variant2(TypedDict, total=False): +class Poll(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" @@ -51,4 +51,4 @@ class Variant2(TypedDict, total=False): """This identifies the currently-running import, checking its status.""" -DatabaseImportParams: TypeAlias = Union[Variant0, Variant1, Variant2] +DatabaseImportParams: TypeAlias = Union[Init, Ingest, Poll] diff --git a/src/cloudflare/types/dns/__init__.py b/src/cloudflare/types/dns/__init__.py index 3009711464f..dcc6ce69c18 100644 --- a/src/cloudflare/types/dns/__init__.py +++ b/src/cloudflare/types/dns/__init__.py @@ -23,7 +23,6 @@ from .cname_record import CNAMERecord as CNAMERecord from .https_record import HTTPSRecord as HTTPSRecord from .naptr_record import NAPTRRecord as NAPTRRecord -from .record_param import RecordParam as RecordParam from .sshfp_record import SSHFPRecord as SSHFPRecord from .dnskey_record import DNSKEYRecord as DNSKEYRecord from .smimea_record import SMIMEARecord as SMIMEARecord diff --git a/src/cloudflare/types/dns/a_record.py b/src/cloudflare/types/dns/a_record.py index 45e3bc709a2..2dd809edd25 100644 --- a/src/cloudflare/types/dns/a_record.py +++ b/src/cloudflare/types/dns/a_record.py @@ -29,6 +29,12 @@ class Settings(BaseModel): class ARecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["A"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -38,9 +44,6 @@ class ARecord(BaseModel): content: Optional[str] = None """A valid IPv4 address.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -59,6 +62,3 @@ class ARecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["A"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/a_record_param.py b/src/cloudflare/types/dns/a_record_param.py index 181939fa954..60ceae7a5eb 100644 --- a/src/cloudflare/types/dns/a_record_param.py +++ b/src/cloudflare/types/dns/a_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -30,6 +30,12 @@ class Settings(TypedDict, total=False): class ARecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["A"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -39,9 +45,6 @@ class ARecordParam(TypedDict, total=False): content: str """A valid IPv4 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -60,6 +63,3 @@ class ARecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["A"] - """Record type.""" diff --git a/src/cloudflare/types/dns/aaaa_record.py b/src/cloudflare/types/dns/aaaa_record.py index a9b929e4f9f..ee1099da332 100644 --- a/src/cloudflare/types/dns/aaaa_record.py +++ b/src/cloudflare/types/dns/aaaa_record.py @@ -29,6 +29,12 @@ class Settings(BaseModel): class AAAARecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["AAAA"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -38,9 +44,6 @@ class AAAARecord(BaseModel): content: Optional[str] = None """A valid IPv6 address.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -59,6 +62,3 @@ class AAAARecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["AAAA"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/aaaa_record_param.py b/src/cloudflare/types/dns/aaaa_record_param.py index d305b76b8f0..f9cea4e61a9 100644 --- a/src/cloudflare/types/dns/aaaa_record_param.py +++ b/src/cloudflare/types/dns/aaaa_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -30,6 +30,12 @@ class Settings(TypedDict, total=False): class AAAARecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -39,9 +45,6 @@ class AAAARecordParam(TypedDict, total=False): content: str """A valid IPv6 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -60,6 +63,3 @@ class AAAARecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["AAAA"] - """Record type.""" diff --git a/src/cloudflare/types/dns/analytics/report_get_params.py b/src/cloudflare/types/dns/analytics/report_get_params.py index 12caad200d7..aba9c385ba9 100644 --- a/src/cloudflare/types/dns/analytics/report_get_params.py +++ b/src/cloudflare/types/dns/analytics/report_get_params.py @@ -13,7 +13,7 @@ class ReportGetParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" dimensions: str """A comma-separated list of dimensions to group results by.""" diff --git a/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py b/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py index 12ef8217a02..c4cd5738dea 100644 --- a/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py +++ b/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py @@ -13,7 +13,7 @@ class BytimeGetParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" dimensions: str """A comma-separated list of dimensions to group results by.""" diff --git a/src/cloudflare/types/dns/batch_patch_param.py b/src/cloudflare/types/dns/batch_patch_param.py index 65ea595cf1c..ce96ef8edce 100644 --- a/src/cloudflare/types/dns/batch_patch_param.py +++ b/src/cloudflare/types/dns/batch_patch_param.py @@ -30,92 +30,57 @@ __all__ = [ "BatchPatchParam", - "A", - "AAAA", - "CAA", - "CERT", - "CNAME", - "DNSKEY", - "DS", - "HTTPS", - "LOC", - "MX", - "NAPTR", - "NS", - "Openpgpkey", - "OpenpgpkeySettings", - "PTR", - "SMIMEA", - "SRV", - "SSHFP", - "SVCB", - "TLSA", - "TXT", - "URI", + "ARecord", + "AAAARecord", + "CNAMERecord", + "MXRecord", + "NSRecord", + "OpenpgpkeyRecord", + "OpenpgpkeyRecordSettings", + "PTRRecord", + "TXTRecord", + "CAARecord", + "CERTRecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "NAPTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "URIRecord", ] -class A(ARecordParam, total=False): +class ARecord(ARecordParam, total=False): id: Required[str] """Identifier.""" -class AAAA(AAAARecordParam, total=False): +class AAAARecord(AAAARecordParam, total=False): id: Required[str] """Identifier.""" -class CAA(CAARecordParam, total=False): +class CNAMERecord(CNAMERecordParam, total=False): id: Required[str] """Identifier.""" -class CERT(CERTRecordParam, total=False): +class MXRecord(MXRecordParam, total=False): id: Required[str] """Identifier.""" -class CNAME(CNAMERecordParam, total=False): +class NSRecord(NSRecordParam, total=False): id: Required[str] """Identifier.""" -class DNSKEY(DNSKEYRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class DS(DSRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class HTTPS(HTTPSRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class LOC(LOCRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class MX(MXRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class NAPTR(NAPTRRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class NS(NSRecordParam, total=False): - id: Required[str] - """Identifier.""" - - -class OpenpgpkeySettings(TypedDict, total=False): +class OpenpgpkeyRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -133,10 +98,16 @@ class OpenpgpkeySettings(TypedDict, total=False): """ -class Openpgpkey(TypedDict, total=False): +class OpenpgpkeyRecord(TypedDict, total=False): id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -146,16 +117,13 @@ class Openpgpkey(TypedDict, total=False): content: str """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of Cloudflare. """ - settings: OpenpgpkeySettings + settings: OpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -168,70 +136,102 @@ class Openpgpkey(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["OPENPGPKEY"] - """Record type.""" + +class PTRRecord(PTRRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class TXTRecord(TXTRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class CAARecord(CAARecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class CERTRecord(CERTRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class DNSKEYRecord(DNSKEYRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class DSRecord(DSRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class HTTPSRecord(HTTPSRecordParam, total=False): + id: Required[str] + """Identifier.""" -class PTR(PTRRecordParam, total=False): +class LOCRecord(LOCRecordParam, total=False): id: Required[str] """Identifier.""" -class SMIMEA(SMIMEARecordParam, total=False): +class NAPTRRecord(NAPTRRecordParam, total=False): id: Required[str] """Identifier.""" -class SRV(SRVRecordParam, total=False): +class SMIMEARecord(SMIMEARecordParam, total=False): id: Required[str] """Identifier.""" -class SSHFP(SSHFPRecordParam, total=False): +class SRVRecord(SRVRecordParam, total=False): id: Required[str] """Identifier.""" -class SVCB(SVCBRecordParam, total=False): +class SSHFPRecord(SSHFPRecordParam, total=False): id: Required[str] """Identifier.""" -class TLSA(TLSARecordParam, total=False): +class SVCBRecord(SVCBRecordParam, total=False): id: Required[str] """Identifier.""" -class TXT(TXTRecordParam, total=False): +class TLSARecord(TLSARecordParam, total=False): id: Required[str] """Identifier.""" -class URI(URIRecordParam, total=False): +class URIRecord(URIRecordParam, total=False): id: Required[str] """Identifier.""" BatchPatchParam: TypeAlias = Union[ - A, - AAAA, - CAA, - CERT, - CNAME, - DNSKEY, - DS, - HTTPS, - LOC, - MX, - NAPTR, - NS, - Openpgpkey, - PTR, - SMIMEA, - SRV, - SSHFP, - SVCB, - TLSA, - TXT, - URI, + ARecord, + AAAARecord, + CNAMERecord, + MXRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + TXTRecord, + CAARecord, + CERTRecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + NAPTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + URIRecord, ] diff --git a/src/cloudflare/types/dns/batch_put_param.py b/src/cloudflare/types/dns/batch_put_param.py index e478b8e41ff..b747c350cfe 100644 --- a/src/cloudflare/types/dns/batch_put_param.py +++ b/src/cloudflare/types/dns/batch_put_param.py @@ -30,92 +30,57 @@ __all__ = [ "BatchPutParam", - "A", - "AAAA", - "CAA", - "CERT", - "CNAME", - "DNSKEY", - "DS", - "HTTPS", - "LOC", - "MX", - "NAPTR", - "NS", - "Openpgpkey", - "OpenpgpkeySettings", - "PTR", - "SMIMEA", - "SRV", - "SSHFP", - "SVCB", - "TLSA", - "TXT", - "URI", + "ARecord", + "AAAARecord", + "CNAMERecord", + "MXRecord", + "NSRecord", + "OpenpgpkeyRecord", + "OpenpgpkeyRecordSettings", + "PTRRecord", + "TXTRecord", + "CAARecord", + "CERTRecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "NAPTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "URIRecord", ] -class A(ARecordParam, total=False): - id: str +class ARecord(ARecordParam, total=False): + id: Required[str] """Identifier.""" -class AAAA(AAAARecordParam, total=False): - id: str +class AAAARecord(AAAARecordParam, total=False): + id: Required[str] """Identifier.""" -class CAA(CAARecordParam, total=False): - id: str +class CNAMERecord(CNAMERecordParam, total=False): + id: Required[str] """Identifier.""" -class CERT(CERTRecordParam, total=False): - id: str +class MXRecord(MXRecordParam, total=False): + id: Required[str] """Identifier.""" -class CNAME(CNAMERecordParam, total=False): - id: str +class NSRecord(NSRecordParam, total=False): + id: Required[str] """Identifier.""" -class DNSKEY(DNSKEYRecordParam, total=False): - id: str - """Identifier.""" - - -class DS(DSRecordParam, total=False): - id: str - """Identifier.""" - - -class HTTPS(HTTPSRecordParam, total=False): - id: str - """Identifier.""" - - -class LOC(LOCRecordParam, total=False): - id: str - """Identifier.""" - - -class MX(MXRecordParam, total=False): - id: str - """Identifier.""" - - -class NAPTR(NAPTRRecordParam, total=False): - id: str - """Identifier.""" - - -class NS(NSRecordParam, total=False): - id: str - """Identifier.""" - - -class OpenpgpkeySettings(TypedDict, total=False): +class OpenpgpkeyRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -133,9 +98,9 @@ class OpenpgpkeySettings(TypedDict, total=False): """ -class Openpgpkey(TypedDict, total=False): - content: Required[str] - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" +class OpenpgpkeyRecord(TypedDict, total=False): + id: Required[str] + """Identifier.""" name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" @@ -143,22 +108,22 @@ class Openpgpkey(TypedDict, total=False): type: Required[Literal["OPENPGPKEY"]] """Record type.""" - id: str - """Identifier.""" - comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + proxied: bool """ Whether the record is receiving the performance and security benefits of Cloudflare. """ - settings: OpenpgpkeySettings + settings: OpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -172,66 +137,101 @@ class Openpgpkey(TypedDict, total=False): """ -class PTR(PTRRecordParam, total=False): - id: str +class PTRRecord(PTRRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class TXTRecord(TXTRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class CAARecord(CAARecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class CERTRecord(CERTRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class DNSKEYRecord(DNSKEYRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class DSRecord(DSRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class HTTPSRecord(HTTPSRecordParam, total=False): + id: Required[str] + """Identifier.""" + + +class LOCRecord(LOCRecordParam, total=False): + id: Required[str] """Identifier.""" -class SMIMEA(SMIMEARecordParam, total=False): - id: str +class NAPTRRecord(NAPTRRecordParam, total=False): + id: Required[str] """Identifier.""" -class SRV(SRVRecordParam, total=False): - id: str +class SMIMEARecord(SMIMEARecordParam, total=False): + id: Required[str] """Identifier.""" -class SSHFP(SSHFPRecordParam, total=False): - id: str +class SRVRecord(SRVRecordParam, total=False): + id: Required[str] """Identifier.""" -class SVCB(SVCBRecordParam, total=False): - id: str +class SSHFPRecord(SSHFPRecordParam, total=False): + id: Required[str] """Identifier.""" -class TLSA(TLSARecordParam, total=False): - id: str +class SVCBRecord(SVCBRecordParam, total=False): + id: Required[str] """Identifier.""" -class TXT(TXTRecordParam, total=False): - id: str +class TLSARecord(TLSARecordParam, total=False): + id: Required[str] """Identifier.""" -class URI(URIRecordParam, total=False): - id: str +class URIRecord(URIRecordParam, total=False): + id: Required[str] """Identifier.""" BatchPutParam: TypeAlias = Union[ - A, - AAAA, - CAA, - CERT, - CNAME, - DNSKEY, - DS, - HTTPS, - LOC, - MX, - NAPTR, - NS, - Openpgpkey, - PTR, - SMIMEA, - SRV, - SSHFP, - SVCB, - TLSA, - TXT, - URI, + ARecord, + AAAARecord, + CNAMERecord, + MXRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + TXTRecord, + CAARecord, + CERTRecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + NAPTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + URIRecord, ] diff --git a/src/cloudflare/types/dns/caa_record.py b/src/cloudflare/types/dns/caa_record.py index c4635a7d010..1ef5bd859c2 100644 --- a/src/cloudflare/types/dns/caa_record.py +++ b/src/cloudflare/types/dns/caa_record.py @@ -40,6 +40,12 @@ class Settings(BaseModel): class CAARecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["CAA"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -52,9 +58,6 @@ class CAARecord(BaseModel): data: Optional[Data] = None """Components of a CAA record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -73,6 +76,3 @@ class CAARecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["CAA"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/caa_record_param.py b/src/cloudflare/types/dns/caa_record_param.py index b33a737dcfd..b93e29827b2 100644 --- a/src/cloudflare/types/dns/caa_record_param.py +++ b/src/cloudflare/types/dns/caa_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -41,6 +41,12 @@ class Settings(TypedDict, total=False): class CAARecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -50,9 +56,6 @@ class CAARecordParam(TypedDict, total=False): data: Data """Components of a CAA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -71,6 +74,3 @@ class CAARecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["CAA"] - """Record type.""" diff --git a/src/cloudflare/types/dns/cert_record.py b/src/cloudflare/types/dns/cert_record.py index 158b93608aa..65b16674b18 100644 --- a/src/cloudflare/types/dns/cert_record.py +++ b/src/cloudflare/types/dns/cert_record.py @@ -43,6 +43,12 @@ class Settings(BaseModel): class CERTRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["CERT"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -55,9 +61,6 @@ class CERTRecord(BaseModel): data: Optional[Data] = None """Components of a CERT record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -76,6 +79,3 @@ class CERTRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["CERT"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/cert_record_param.py b/src/cloudflare/types/dns/cert_record_param.py index 139c4c13d84..45693c6dca0 100644 --- a/src/cloudflare/types/dns/cert_record_param.py +++ b/src/cloudflare/types/dns/cert_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -44,6 +44,12 @@ class Settings(TypedDict, total=False): class CERTRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -53,9 +59,6 @@ class CERTRecordParam(TypedDict, total=False): data: Data """Components of a CERT record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -74,6 +77,3 @@ class CERTRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["CERT"] - """Record type.""" diff --git a/src/cloudflare/types/dns/cname_record.py b/src/cloudflare/types/dns/cname_record.py index acbb165c725..127dda55f61 100644 --- a/src/cloudflare/types/dns/cname_record.py +++ b/src/cloudflare/types/dns/cname_record.py @@ -37,6 +37,12 @@ class Settings(BaseModel): class CNAMERecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["CNAME"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,9 +52,6 @@ class CNAMERecord(BaseModel): content: Optional[str] = None """A valid hostname. Must not match the record's name.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -67,6 +70,3 @@ class CNAMERecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["CNAME"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/cname_record_param.py b/src/cloudflare/types/dns/cname_record_param.py index 122daccc16c..8802ee8312d 100644 --- a/src/cloudflare/types/dns/cname_record_param.py +++ b/src/cloudflare/types/dns/cname_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -38,6 +38,12 @@ class Settings(TypedDict, total=False): class CNAMERecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CNAME"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -47,9 +53,6 @@ class CNAMERecordParam(TypedDict, total=False): content: str """A valid hostname. Must not match the record's name.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -68,6 +71,3 @@ class CNAMERecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["CNAME"] - """Record type.""" diff --git a/src/cloudflare/types/dns/dnskey_record.py b/src/cloudflare/types/dns/dnskey_record.py index b7ab534a265..bcb7831cc97 100644 --- a/src/cloudflare/types/dns/dnskey_record.py +++ b/src/cloudflare/types/dns/dnskey_record.py @@ -43,6 +43,12 @@ class Settings(BaseModel): class DNSKEYRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["DNSKEY"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -55,9 +61,6 @@ class DNSKEYRecord(BaseModel): data: Optional[Data] = None """Components of a DNSKEY record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -76,6 +79,3 @@ class DNSKEYRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["DNSKEY"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/dnskey_record_param.py b/src/cloudflare/types/dns/dnskey_record_param.py index 87784bd7f8c..9476e6ac47b 100644 --- a/src/cloudflare/types/dns/dnskey_record_param.py +++ b/src/cloudflare/types/dns/dnskey_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -44,6 +44,12 @@ class Settings(TypedDict, total=False): class DNSKEYRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DNSKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -53,9 +59,6 @@ class DNSKEYRecordParam(TypedDict, total=False): data: Data """Components of a DNSKEY record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -74,6 +77,3 @@ class DNSKEYRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["DNSKEY"] - """Record type.""" diff --git a/src/cloudflare/types/dns/ds_record.py b/src/cloudflare/types/dns/ds_record.py index 7a6f2b87cfc..3af34140392 100644 --- a/src/cloudflare/types/dns/ds_record.py +++ b/src/cloudflare/types/dns/ds_record.py @@ -43,6 +43,12 @@ class Settings(BaseModel): class DSRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["DS"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -55,9 +61,6 @@ class DSRecord(BaseModel): data: Optional[Data] = None """Components of a DS record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -76,6 +79,3 @@ class DSRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["DS"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/ds_record_param.py b/src/cloudflare/types/dns/ds_record_param.py index b37b3e538b2..d696be3fa31 100644 --- a/src/cloudflare/types/dns/ds_record_param.py +++ b/src/cloudflare/types/dns/ds_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -44,6 +44,12 @@ class Settings(TypedDict, total=False): class DSRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -53,9 +59,6 @@ class DSRecordParam(TypedDict, total=False): data: Data """Components of a DS record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -74,6 +77,3 @@ class DSRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["DS"] - """Record type.""" diff --git a/src/cloudflare/types/dns/https_record.py b/src/cloudflare/types/dns/https_record.py index 9080fc0d2ca..80b38c42901 100644 --- a/src/cloudflare/types/dns/https_record.py +++ b/src/cloudflare/types/dns/https_record.py @@ -40,6 +40,12 @@ class Settings(BaseModel): class HTTPSRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["HTTPS"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -52,9 +58,6 @@ class HTTPSRecord(BaseModel): data: Optional[Data] = None """Components of a HTTPS record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -73,6 +76,3 @@ class HTTPSRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["HTTPS"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/https_record_param.py b/src/cloudflare/types/dns/https_record_param.py index 510e57ae626..5636ae61c23 100644 --- a/src/cloudflare/types/dns/https_record_param.py +++ b/src/cloudflare/types/dns/https_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -41,6 +41,12 @@ class Settings(TypedDict, total=False): class HTTPSRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -50,9 +56,6 @@ class HTTPSRecordParam(TypedDict, total=False): data: Data """Components of a HTTPS record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -71,6 +74,3 @@ class HTTPSRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["HTTPS"] - """Record type.""" diff --git a/src/cloudflare/types/dns/loc_record.py b/src/cloudflare/types/dns/loc_record.py index 6fdf091618b..e485095d218 100644 --- a/src/cloudflare/types/dns/loc_record.py +++ b/src/cloudflare/types/dns/loc_record.py @@ -67,6 +67,12 @@ class Settings(BaseModel): class LOCRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["LOC"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -79,9 +85,6 @@ class LOCRecord(BaseModel): data: Optional[Data] = None """Components of a LOC record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -100,6 +103,3 @@ class LOCRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["LOC"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/loc_record_param.py b/src/cloudflare/types/dns/loc_record_param.py index 55ec03b2297..00cb4b5225f 100644 --- a/src/cloudflare/types/dns/loc_record_param.py +++ b/src/cloudflare/types/dns/loc_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -68,6 +68,12 @@ class Settings(TypedDict, total=False): class LOCRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -77,9 +83,6 @@ class LOCRecordParam(TypedDict, total=False): data: Data """Components of a LOC record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -98,6 +101,3 @@ class LOCRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["LOC"] - """Record type.""" diff --git a/src/cloudflare/types/dns/mx_record.py b/src/cloudflare/types/dns/mx_record.py index 4d3a7dd1874..a27e72470f9 100644 --- a/src/cloudflare/types/dns/mx_record.py +++ b/src/cloudflare/types/dns/mx_record.py @@ -29,6 +29,12 @@ class Settings(BaseModel): class MXRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["MX"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -38,9 +44,6 @@ class MXRecord(BaseModel): content: Optional[str] = None """A valid mail server hostname.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: Optional[float] = None """Required for MX, SRV and URI records; unused by other record types. @@ -65,6 +68,3 @@ class MXRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["MX"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/mx_record_param.py b/src/cloudflare/types/dns/mx_record_param.py index e38ea7456ca..e3e17499870 100644 --- a/src/cloudflare/types/dns/mx_record_param.py +++ b/src/cloudflare/types/dns/mx_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -30,6 +30,12 @@ class Settings(TypedDict, total=False): class MXRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["MX"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -39,9 +45,6 @@ class MXRecordParam(TypedDict, total=False): content: str """A valid mail server hostname.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: float """Required for MX, SRV and URI records; unused by other record types. @@ -66,6 +69,3 @@ class MXRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["MX"] - """Record type.""" diff --git a/src/cloudflare/types/dns/naptr_record.py b/src/cloudflare/types/dns/naptr_record.py index b2fe91864bf..1fe64354fac 100644 --- a/src/cloudflare/types/dns/naptr_record.py +++ b/src/cloudflare/types/dns/naptr_record.py @@ -49,6 +49,12 @@ class Settings(BaseModel): class NAPTRRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["NAPTR"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -61,9 +67,6 @@ class NAPTRRecord(BaseModel): data: Optional[Data] = None """Components of a NAPTR record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -82,6 +85,3 @@ class NAPTRRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["NAPTR"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/naptr_record_param.py b/src/cloudflare/types/dns/naptr_record_param.py index 25b91ed4f29..906b491c288 100644 --- a/src/cloudflare/types/dns/naptr_record_param.py +++ b/src/cloudflare/types/dns/naptr_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -50,6 +50,12 @@ class Settings(TypedDict, total=False): class NAPTRRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -59,9 +65,6 @@ class NAPTRRecordParam(TypedDict, total=False): data: Data """Components of a NAPTR record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -80,6 +83,3 @@ class NAPTRRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["NAPTR"] - """Record type.""" diff --git a/src/cloudflare/types/dns/ns_record.py b/src/cloudflare/types/dns/ns_record.py index 78ac6fe4049..db4c0bce8f3 100644 --- a/src/cloudflare/types/dns/ns_record.py +++ b/src/cloudflare/types/dns/ns_record.py @@ -29,6 +29,12 @@ class Settings(BaseModel): class NSRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["NS"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -38,9 +44,6 @@ class NSRecord(BaseModel): content: Optional[str] = None """A valid name server host name.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -59,6 +62,3 @@ class NSRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["NS"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/ns_record_param.py b/src/cloudflare/types/dns/ns_record_param.py index eabb69eedd4..8233112b1c8 100644 --- a/src/cloudflare/types/dns/ns_record_param.py +++ b/src/cloudflare/types/dns/ns_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -30,6 +30,12 @@ class Settings(TypedDict, total=False): class NSRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -39,9 +45,6 @@ class NSRecordParam(TypedDict, total=False): content: str """A valid name server host name.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -60,6 +63,3 @@ class NSRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["NS"] - """Record type.""" diff --git a/src/cloudflare/types/dns/ptr_record.py b/src/cloudflare/types/dns/ptr_record.py index c392256cbbc..ceafad5c9ad 100644 --- a/src/cloudflare/types/dns/ptr_record.py +++ b/src/cloudflare/types/dns/ptr_record.py @@ -29,6 +29,12 @@ class Settings(BaseModel): class PTRRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["PTR"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -38,9 +44,6 @@ class PTRRecord(BaseModel): content: Optional[str] = None """Domain name pointing to the address.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -59,6 +62,3 @@ class PTRRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["PTR"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/ptr_record_param.py b/src/cloudflare/types/dns/ptr_record_param.py index 82d92c301fd..d5fbca6b7b7 100644 --- a/src/cloudflare/types/dns/ptr_record_param.py +++ b/src/cloudflare/types/dns/ptr_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -30,6 +30,12 @@ class Settings(TypedDict, total=False): class PTRRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -39,9 +45,6 @@ class PTRRecordParam(TypedDict, total=False): content: str """Domain name pointing to the address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -60,6 +63,3 @@ class PTRRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["PTR"] - """Record type.""" diff --git a/src/cloudflare/types/dns/record_batch_params.py b/src/cloudflare/types/dns/record_batch_params.py index 0be535daa5a..1bfa0dac5c2 100644 --- a/src/cloudflare/types/dns/record_batch_params.py +++ b/src/cloudflare/types/dns/record_batch_params.py @@ -2,14 +2,41 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .record_param import RecordParam +from .ttl_param import TTLParam +from .record_tags import RecordTags +from .a_record_param import ARecordParam from .batch_put_param import BatchPutParam +from .ds_record_param import DSRecordParam +from .mx_record_param import MXRecordParam +from .ns_record_param import NSRecordParam +from .caa_record_param import CAARecordParam +from .loc_record_param import LOCRecordParam +from .ptr_record_param import PTRRecordParam +from .srv_record_param import SRVRecordParam +from .txt_record_param import TXTRecordParam +from .uri_record_param import URIRecordParam +from .aaaa_record_param import AAAARecordParam from .batch_patch_param import BatchPatchParam +from .cert_record_param import CERTRecordParam +from .svcb_record_param import SVCBRecordParam +from .tlsa_record_param import TLSARecordParam +from .cname_record_param import CNAMERecordParam +from .https_record_param import HTTPSRecordParam +from .naptr_record_param import NAPTRRecordParam +from .sshfp_record_param import SSHFPRecordParam +from .dnskey_record_param import DNSKEYRecordParam +from .smimea_record_param import SMIMEARecordParam -__all__ = ["RecordBatchParams", "Delete"] +__all__ = [ + "RecordBatchParams", + "Delete", + "Post", + "PostDNSRecordsOpenpgpkeyRecord", + "PostDNSRecordsOpenpgpkeyRecordSettings", +] class RecordBatchParams(TypedDict, total=False): @@ -20,7 +47,7 @@ class RecordBatchParams(TypedDict, total=False): patches: Iterable[BatchPatchParam] - posts: Iterable[RecordParam] + posts: Iterable[Post] puts: Iterable[BatchPutParam] @@ -28,3 +55,82 @@ class RecordBatchParams(TypedDict, total=False): class Delete(TypedDict, total=False): id: Required[str] """Identifier.""" + + +class PostDNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class PostDNSRecordsOpenpgpkeyRecord(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + settings: PostDNSRecordsOpenpgpkeyRecordSettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +Post: TypeAlias = Union[ + ARecordParam, + AAAARecordParam, + CNAMERecordParam, + MXRecordParam, + NSRecordParam, + PostDNSRecordsOpenpgpkeyRecord, + PTRRecordParam, + TXTRecordParam, + CAARecordParam, + CERTRecordParam, + DNSKEYRecordParam, + DSRecordParam, + HTTPSRecordParam, + LOCRecordParam, + NAPTRRecordParam, + SMIMEARecordParam, + SRVRecordParam, + SSHFPRecordParam, + SVCBRecordParam, + TLSARecordParam, + URIRecordParam, +] diff --git a/src/cloudflare/types/dns/record_create_params.py b/src/cloudflare/types/dns/record_create_params.py index 2ed5fcc8a33..64648001011 100644 --- a/src/cloudflare/types/dns/record_create_params.py +++ b/src/cloudflare/types/dns/record_create_params.py @@ -14,14 +14,24 @@ "ARecordSettings", "AAAARecord", "AAAARecordSettings", + "CNAMERecord", + "CNAMERecordSettings", + "MXRecord", + "MXRecordSettings", + "NSRecord", + "NSRecordSettings", + "DNSRecordsOpenpgpkeyRecord", + "DNSRecordsOpenpgpkeyRecordSettings", + "PTRRecord", + "PTRRecordSettings", + "TXTRecord", + "TXTRecordSettings", "CAARecord", "CAARecordData", "CAARecordSettings", "CERTRecord", "CERTRecordData", "CERTRecordSettings", - "CNAMERecord", - "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", "DNSKEYRecordSettings", @@ -34,17 +44,9 @@ "LOCRecord", "LOCRecordData", "LOCRecordSettings", - "MXRecord", - "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", "NAPTRRecordSettings", - "NSRecord", - "NSRecordSettings", - "DNSRecordsOpenpgpkeyRecord", - "DNSRecordsOpenpgpkeyRecordSettings", - "PTRRecord", - "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", "SMIMEARecordSettings", @@ -60,8 +62,6 @@ "TLSARecord", "TLSARecordData", "TLSARecordSettings", - "TXTRecord", - "TXTRecordSettings", "URIRecord", "URIRecordData", "URIRecordSettings", @@ -72,6 +72,12 @@ class ARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["A"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -81,9 +87,6 @@ class ARecord(TypedDict, total=False): content: str """A valid IPv4 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -103,9 +106,6 @@ class ARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["A"] - """Record type.""" - class ARecordSettings(TypedDict, total=False): ipv4_only: bool @@ -129,6 +129,12 @@ class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -138,9 +144,6 @@ class AAAARecord(TypedDict, total=False): content: str """A valid IPv6 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -160,9 +163,6 @@ class AAAARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["AAAA"] - """Record type.""" - class AAAARecordSettings(TypedDict, total=False): ipv4_only: bool @@ -182,21 +182,24 @@ class AAAARecordSettings(TypedDict, total=False): """ -class CAARecord(TypedDict, total=False): +class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CNAME"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: CAARecordData - """Components of a CAA record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + content: str + """A valid hostname. Must not match the record's name.""" proxied: bool """ @@ -204,7 +207,7 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ - settings: CAARecordSettings + settings: CNAMERecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -217,22 +220,16 @@ class CAARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CAA"] - """Record type.""" - - -class CAARecordData(TypedDict, total=False): - flags: float - """Flags for the CAA record.""" - - tag: str - """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" - - value: str - """Value of the record. This field's semantics depend on the chosen tag.""" +class CNAMERecordSettings(TypedDict, total=False): + flatten_cname: bool + """ + If enabled, causes the CNAME record to be resolved externally and the resulting + address records (e.g., A and AAAA) to be returned instead of the CNAME record + itself. This setting is unavailable for proxied records, since they are always + flattened. + """ -class CAARecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -250,21 +247,30 @@ class CAARecordSettings(TypedDict, total=False): """ -class CERTRecord(TypedDict, total=False): +class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["MX"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: CERTRecordData - """Components of a CERT record.""" + content: str + """A valid mail server hostname.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ proxied: bool """ @@ -272,7 +278,7 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ - settings: CERTRecordSettings + settings: MXRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -285,25 +291,8 @@ class CERTRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CERT"] - """Record type.""" - - -class CERTRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" - certificate: str - """Certificate.""" - - key_tag: float - """Key Tag.""" - - type: float - """Type.""" - - -class CERTRecordSettings(TypedDict, total=False): +class MXRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -321,10 +310,16 @@ class CERTRecordSettings(TypedDict, total=False): """ -class CNAMERecord(TypedDict, total=False): +class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -332,10 +327,7 @@ class CNAMERecord(TypedDict, total=False): """ content: str - """A valid hostname. Must not match the record's name.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + """A valid name server host name.""" proxied: bool """ @@ -343,7 +335,7 @@ class CNAMERecord(TypedDict, total=False): Cloudflare. """ - settings: CNAMERecordSettings + settings: NSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -356,19 +348,8 @@ class CNAMERecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CNAME"] - """Record type.""" - - -class CNAMERecordSettings(TypedDict, total=False): - flatten_cname: bool - """ - If enabled, causes the CNAME record to be resolved externally and the resulting - address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always - flattened. - """ +class NSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -386,21 +367,24 @@ class CNAMERecordSettings(TypedDict, total=False): """ -class DNSKEYRecord(TypedDict, total=False): +class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: DNSKEYRecordData - """Components of a DNSKEY record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" proxied: bool """ @@ -408,7 +392,7 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSKEYRecordSettings + settings: DNSRecordsOpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -421,25 +405,65 @@ class DNSKEYRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["DNSKEY"] + +class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class PTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] """Record type.""" + comment: str + """Comments or notes about the DNS record. -class DNSKEYRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" + This field has no effect on DNS responses. + """ - flags: float - """Flags.""" + content: str + """Domain name pointing to the address.""" - protocol: float - """Protocol.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - public_key: str - """Public Key.""" + settings: PTRRecordSettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. -class DNSKEYRecordSettings(TypedDict, total=False): + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +class PTRRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -457,21 +481,32 @@ class DNSKEYRecordSettings(TypedDict, total=False): """ -class DSRecord(TypedDict, total=False): +class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: DSRecordData - """Components of a DS record.""" + content: str + """Text content for the record. - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + The content must consist of quoted "character strings" (RFC 1035), each with a + length of up to 255 bytes. Strings exceeding this allowed maximum length are + automatically split. + + Learn more at + . + """ proxied: bool """ @@ -479,7 +514,7 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ - settings: DSRecordSettings + settings: TXTRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -492,25 +527,8 @@ class DSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["DS"] - """Record type.""" - -class DSRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" - - digest: str - """Digest.""" - - digest_type: float - """Digest Type.""" - - key_tag: float - """Key Tag.""" - - -class DSRecordSettings(TypedDict, total=False): +class TXTRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -528,21 +546,24 @@ class DSRecordSettings(TypedDict, total=False): """ -class HTTPSRecord(TypedDict, total=False): +class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: HTTPSRecordData - """Components of a HTTPS record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: CAARecordData + """Components of a CAA record.""" proxied: bool """ @@ -550,7 +571,7 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ - settings: HTTPSRecordSettings + settings: CAARecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -563,22 +584,19 @@ class HTTPSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["HTTPS"] - """Record type.""" - -class HTTPSRecordData(TypedDict, total=False): - priority: float - """priority.""" +class CAARecordData(TypedDict, total=False): + flags: float + """Flags for the CAA record.""" - target: str - """target.""" + tag: str + """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" value: str - """value.""" + """Value of the record. This field's semantics depend on the chosen tag.""" -class HTTPSRecordSettings(TypedDict, total=False): +class CAARecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -596,21 +614,24 @@ class HTTPSRecordSettings(TypedDict, total=False): """ -class LOCRecord(TypedDict, total=False): +class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: LOCRecordData - """Components of a LOC record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: CERTRecordData + """Components of a CERT record.""" proxied: bool """ @@ -618,7 +639,7 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ - settings: LOCRecordSettings + settings: CERTRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -631,49 +652,22 @@ class LOCRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["LOC"] - """Record type.""" - - -class LOCRecordData(TypedDict, total=False): - altitude: float - """Altitude of location in meters.""" - lat_degrees: float - """Degrees of latitude.""" - - lat_direction: Literal["N", "S"] - """Latitude direction.""" - - lat_minutes: float - """Minutes of latitude.""" - - lat_seconds: float - """Seconds of latitude.""" - - long_degrees: float - """Degrees of longitude.""" - - long_direction: Literal["E", "W"] - """Longitude direction.""" - - long_minutes: float - """Minutes of longitude.""" - - long_seconds: float - """Seconds of longitude.""" +class CERTRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - precision_horz: float - """Horizontal precision of location.""" + certificate: str + """Certificate.""" - precision_vert: float - """Vertical precision of location.""" + key_tag: float + """Key Tag.""" - size: float - """Size of location in meters.""" + type: float + """Type.""" -class LOCRecordSettings(TypedDict, total=False): +class CERTRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -691,27 +685,24 @@ class LOCRecordSettings(TypedDict, total=False): """ -class MXRecord(TypedDict, total=False): +class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DNSKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A valid mail server hostname.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - priority: float - """Required for MX, SRV and URI records; unused by other record types. - - Records with lower priorities are preferred. - """ + data: DNSKEYRecordData + """Components of a DNSKEY record.""" proxied: bool """ @@ -719,7 +710,7 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ - settings: MXRecordSettings + settings: DNSKEYRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -732,11 +723,22 @@ class MXRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["MX"] - """Record type.""" +class DNSKEYRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" -class MXRecordSettings(TypedDict, total=False): + flags: float + """Flags.""" + + protocol: float + """Protocol.""" + + public_key: str + """Public Key.""" + + +class DNSKEYRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -754,21 +756,24 @@ class MXRecordSettings(TypedDict, total=False): """ -class NAPTRRecord(TypedDict, total=False): +class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: NAPTRRecordData - """Components of a NAPTR record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: DSRecordData + """Components of a DS record.""" proxied: bool """ @@ -776,7 +781,7 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ - settings: NAPTRRecordSettings + settings: DSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -787,33 +792,24 @@ class NAPTRRecord(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["NAPTR"] - """Record type.""" - - -class NAPTRRecordData(TypedDict, total=False): - flags: str - """Flags.""" + """ - order: float - """Order.""" - preference: float - """Preference.""" +class DSRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - regex: str - """Regex.""" + digest: str + """Digest.""" - replacement: str - """Replacement.""" + digest_type: float + """Digest Type.""" - service: str - """Service.""" + key_tag: float + """Key Tag.""" -class NAPTRRecordSettings(TypedDict, total=False): +class DSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -831,21 +827,24 @@ class NAPTRRecordSettings(TypedDict, total=False): """ -class NSRecord(TypedDict, total=False): +class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A valid name server host name.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: HTTPSRecordData + """Components of a HTTPS record.""" proxied: bool """ @@ -853,7 +852,7 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ - settings: NSRecordSettings + settings: HTTPSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -866,11 +865,19 @@ class NSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["NS"] - """Record type.""" +class HTTPSRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" -class NSRecordSettings(TypedDict, total=False): + value: str + """value.""" + + +class HTTPSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -888,21 +895,24 @@ class NSRecordSettings(TypedDict, total=False): """ -class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): +class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: LOCRecordData + """Components of a LOC record.""" proxied: bool """ @@ -910,7 +920,7 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings + settings: LOCRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -923,11 +933,46 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["OPENPGPKEY"] - """Record type.""" +class LOCRecordData(TypedDict, total=False): + altitude: float + """Altitude of location in meters.""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + lat_degrees: float + """Degrees of latitude.""" + + lat_direction: Literal["N", "S"] + """Latitude direction.""" + + lat_minutes: float + """Minutes of latitude.""" + + lat_seconds: float + """Seconds of latitude.""" + + long_degrees: float + """Degrees of longitude.""" + + long_direction: Literal["E", "W"] + """Longitude direction.""" + + long_minutes: float + """Minutes of longitude.""" + + long_seconds: float + """Seconds of longitude.""" + + precision_horz: float + """Horizontal precision of location.""" + + precision_vert: float + """Vertical precision of location.""" + + size: float + """Size of location in meters.""" + + +class LOCRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -945,21 +990,24 @@ class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): """ -class PTRRecord(TypedDict, total=False): +class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """Domain name pointing to the address.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: NAPTRRecordData + """Components of a NAPTR record.""" proxied: bool """ @@ -967,7 +1015,7 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ - settings: PTRRecordSettings + settings: NAPTRRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -980,11 +1028,28 @@ class PTRRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["PTR"] - """Record type.""" +class NAPTRRecordData(TypedDict, total=False): + flags: str + """Flags.""" + + order: float + """Order.""" + + preference: float + """Preference.""" -class PTRRecordSettings(TypedDict, total=False): + regex: str + """Regex.""" + + replacement: str + """Replacement.""" + + service: str + """Service.""" + + +class NAPTRRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -1006,6 +1071,12 @@ class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1015,9 +1086,6 @@ class SMIMEARecord(TypedDict, total=False): data: SMIMEARecordData """Components of a SMIMEA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1037,9 +1105,6 @@ class SMIMEARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SMIMEA"] - """Record type.""" - class SMIMEARecordData(TypedDict, total=False): certificate: str @@ -1077,6 +1142,12 @@ class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SRV"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1086,9 +1157,6 @@ class SRVRecord(TypedDict, total=False): data: SRVRecordData """Components of a SRV record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1108,9 +1176,6 @@ class SRVRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SRV"] - """Record type.""" - class SRVRecordData(TypedDict, total=False): port: float @@ -1151,6 +1216,12 @@ class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1160,9 +1231,6 @@ class SSHFPRecord(TypedDict, total=False): data: SSHFPRecordData """Components of a SSHFP record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1182,9 +1250,6 @@ class SSHFPRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SSHFP"] - """Record type.""" - class SSHFPRecordData(TypedDict, total=False): algorithm: float @@ -1219,6 +1284,12 @@ class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1228,9 +1299,6 @@ class SVCBRecord(TypedDict, total=False): data: SVCBRecordData """Components of a SVCB record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1250,9 +1318,6 @@ class SVCBRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SVCB"] - """Record type.""" - class SVCBRecordData(TypedDict, total=False): priority: float @@ -1287,6 +1352,12 @@ class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1296,9 +1367,6 @@ class TLSARecord(TypedDict, total=False): data: TLSARecordData """Components of a TLSA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1318,9 +1386,6 @@ class TLSARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["TLSA"] - """Record type.""" - class TLSARecordData(TypedDict, total=False): certificate: str @@ -1354,75 +1419,16 @@ class TLSARecordSettings(TypedDict, total=False): """ -class TXTRecord(TypedDict, total=False): +class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """Text content for the record. - - The content must consist of quoted "character strings" (RFC 1035), each with a - length of up to 255 bytes. Strings exceeding this allowed maximum length are - automatically split. - - Learn more at - . - """ - - name: str + name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: TXTRecordSettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS 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: Literal["TXT"] + type: Required[Literal["URI"]] """Record type.""" - -class TXTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class URIRecord(TypedDict, total=False): - zone_id: Required[str] - """Identifier.""" - comment: str """Comments or notes about the DNS record. @@ -1432,9 +1438,6 @@ class URIRecord(TypedDict, total=False): data: URIRecordData """Components of a URI record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: float """Required for MX, SRV and URI records; unused by other record types. @@ -1460,9 +1463,6 @@ class URIRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["URI"] - """Record type.""" - class URIRecordData(TypedDict, total=False): target: str @@ -1493,23 +1493,23 @@ class URIRecordSettings(TypedDict, total=False): RecordCreateParams: TypeAlias = Union[ ARecord, AAAARecord, + CNAMERecord, + MXRecord, + NSRecord, + DNSRecordsOpenpgpkeyRecord, + PTRRecord, + TXTRecord, CAARecord, CERTRecord, - CNAMERecord, DNSKEYRecord, DSRecord, HTTPSRecord, LOCRecord, - MXRecord, NAPTRRecord, - NSRecord, - DNSRecordsOpenpgpkeyRecord, - PTRRecord, SMIMEARecord, SRVRecord, SSHFPRecord, SVCBRecord, TLSARecord, - TXTRecord, URIRecord, ] diff --git a/src/cloudflare/types/dns/record_edit_params.py b/src/cloudflare/types/dns/record_edit_params.py index 52fad70d5e1..4fe64d7b17c 100644 --- a/src/cloudflare/types/dns/record_edit_params.py +++ b/src/cloudflare/types/dns/record_edit_params.py @@ -14,14 +14,24 @@ "ARecordSettings", "AAAARecord", "AAAARecordSettings", + "CNAMERecord", + "CNAMERecordSettings", + "MXRecord", + "MXRecordSettings", + "NSRecord", + "NSRecordSettings", + "DNSRecordsOpenpgpkeyRecord", + "DNSRecordsOpenpgpkeyRecordSettings", + "PTRRecord", + "PTRRecordSettings", + "TXTRecord", + "TXTRecordSettings", "CAARecord", "CAARecordData", "CAARecordSettings", "CERTRecord", "CERTRecordData", "CERTRecordSettings", - "CNAMERecord", - "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", "DNSKEYRecordSettings", @@ -34,17 +44,9 @@ "LOCRecord", "LOCRecordData", "LOCRecordSettings", - "MXRecord", - "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", "NAPTRRecordSettings", - "NSRecord", - "NSRecordSettings", - "DNSRecordsOpenpgpkeyRecord", - "DNSRecordsOpenpgpkeyRecordSettings", - "PTRRecord", - "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", "SMIMEARecordSettings", @@ -60,8 +62,6 @@ "TLSARecord", "TLSARecordData", "TLSARecordSettings", - "TXTRecord", - "TXTRecordSettings", "URIRecord", "URIRecordData", "URIRecordSettings", @@ -72,6 +72,12 @@ class ARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["A"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -81,9 +87,6 @@ class ARecord(TypedDict, total=False): content: str """A valid IPv4 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -103,9 +106,6 @@ class ARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["A"] - """Record type.""" - class ARecordSettings(TypedDict, total=False): ipv4_only: bool @@ -129,6 +129,12 @@ class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -138,9 +144,6 @@ class AAAARecord(TypedDict, total=False): content: str """A valid IPv6 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -160,9 +163,6 @@ class AAAARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["AAAA"] - """Record type.""" - class AAAARecordSettings(TypedDict, total=False): ipv4_only: bool @@ -182,21 +182,24 @@ class AAAARecordSettings(TypedDict, total=False): """ -class CAARecord(TypedDict, total=False): +class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CNAME"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: CAARecordData - """Components of a CAA record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + content: str + """A valid hostname. Must not match the record's name.""" proxied: bool """ @@ -204,7 +207,7 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ - settings: CAARecordSettings + settings: CNAMERecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -217,22 +220,16 @@ class CAARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CAA"] - """Record type.""" - - -class CAARecordData(TypedDict, total=False): - flags: float - """Flags for the CAA record.""" - - tag: str - """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" - - value: str - """Value of the record. This field's semantics depend on the chosen tag.""" +class CNAMERecordSettings(TypedDict, total=False): + flatten_cname: bool + """ + If enabled, causes the CNAME record to be resolved externally and the resulting + address records (e.g., A and AAAA) to be returned instead of the CNAME record + itself. This setting is unavailable for proxied records, since they are always + flattened. + """ -class CAARecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -250,21 +247,30 @@ class CAARecordSettings(TypedDict, total=False): """ -class CERTRecord(TypedDict, total=False): +class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["MX"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: CERTRecordData - """Components of a CERT record.""" + content: str + """A valid mail server hostname.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ proxied: bool """ @@ -272,7 +278,7 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ - settings: CERTRecordSettings + settings: MXRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -285,25 +291,8 @@ class CERTRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CERT"] - """Record type.""" - - -class CERTRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" - certificate: str - """Certificate.""" - - key_tag: float - """Key Tag.""" - - type: float - """Type.""" - - -class CERTRecordSettings(TypedDict, total=False): +class MXRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -321,10 +310,16 @@ class CERTRecordSettings(TypedDict, total=False): """ -class CNAMERecord(TypedDict, total=False): +class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -332,10 +327,7 @@ class CNAMERecord(TypedDict, total=False): """ content: str - """A valid hostname. Must not match the record's name.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + """A valid name server host name.""" proxied: bool """ @@ -343,7 +335,7 @@ class CNAMERecord(TypedDict, total=False): Cloudflare. """ - settings: CNAMERecordSettings + settings: NSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -356,19 +348,8 @@ class CNAMERecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CNAME"] - """Record type.""" - - -class CNAMERecordSettings(TypedDict, total=False): - flatten_cname: bool - """ - If enabled, causes the CNAME record to be resolved externally and the resulting - address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always - flattened. - """ +class NSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -386,21 +367,24 @@ class CNAMERecordSettings(TypedDict, total=False): """ -class DNSKEYRecord(TypedDict, total=False): +class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: DNSKEYRecordData - """Components of a DNSKEY record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" proxied: bool """ @@ -408,7 +392,7 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSKEYRecordSettings + settings: DNSRecordsOpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -421,25 +405,65 @@ class DNSKEYRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["DNSKEY"] + +class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class PTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] """Record type.""" + comment: str + """Comments or notes about the DNS record. -class DNSKEYRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" + This field has no effect on DNS responses. + """ - flags: float - """Flags.""" + content: str + """Domain name pointing to the address.""" - protocol: float - """Protocol.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - public_key: str - """Public Key.""" + settings: PTRRecordSettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. -class DNSKEYRecordSettings(TypedDict, total=False): + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +class PTRRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -457,21 +481,32 @@ class DNSKEYRecordSettings(TypedDict, total=False): """ -class DSRecord(TypedDict, total=False): +class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: DSRecordData - """Components of a DS record.""" + content: str + """Text content for the record. - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + The content must consist of quoted "character strings" (RFC 1035), each with a + length of up to 255 bytes. Strings exceeding this allowed maximum length are + automatically split. + + Learn more at + . + """ proxied: bool """ @@ -479,7 +514,7 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ - settings: DSRecordSettings + settings: TXTRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -492,25 +527,8 @@ class DSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["DS"] - """Record type.""" - -class DSRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" - - digest: str - """Digest.""" - - digest_type: float - """Digest Type.""" - - key_tag: float - """Key Tag.""" - - -class DSRecordSettings(TypedDict, total=False): +class TXTRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -528,21 +546,24 @@ class DSRecordSettings(TypedDict, total=False): """ -class HTTPSRecord(TypedDict, total=False): +class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: HTTPSRecordData - """Components of a HTTPS record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: CAARecordData + """Components of a CAA record.""" proxied: bool """ @@ -550,7 +571,7 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ - settings: HTTPSRecordSettings + settings: CAARecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -563,22 +584,19 @@ class HTTPSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["HTTPS"] - """Record type.""" - -class HTTPSRecordData(TypedDict, total=False): - priority: float - """priority.""" +class CAARecordData(TypedDict, total=False): + flags: float + """Flags for the CAA record.""" - target: str - """target.""" + tag: str + """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" value: str - """value.""" + """Value of the record. This field's semantics depend on the chosen tag.""" -class HTTPSRecordSettings(TypedDict, total=False): +class CAARecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -596,21 +614,24 @@ class HTTPSRecordSettings(TypedDict, total=False): """ -class LOCRecord(TypedDict, total=False): +class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: LOCRecordData - """Components of a LOC record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: CERTRecordData + """Components of a CERT record.""" proxied: bool """ @@ -618,7 +639,7 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ - settings: LOCRecordSettings + settings: CERTRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -631,49 +652,22 @@ class LOCRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["LOC"] - """Record type.""" - - -class LOCRecordData(TypedDict, total=False): - altitude: float - """Altitude of location in meters.""" - lat_degrees: float - """Degrees of latitude.""" - - lat_direction: Literal["N", "S"] - """Latitude direction.""" - - lat_minutes: float - """Minutes of latitude.""" - - lat_seconds: float - """Seconds of latitude.""" - - long_degrees: float - """Degrees of longitude.""" - - long_direction: Literal["E", "W"] - """Longitude direction.""" - - long_minutes: float - """Minutes of longitude.""" - - long_seconds: float - """Seconds of longitude.""" +class CERTRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - precision_horz: float - """Horizontal precision of location.""" + certificate: str + """Certificate.""" - precision_vert: float - """Vertical precision of location.""" + key_tag: float + """Key Tag.""" - size: float - """Size of location in meters.""" + type: float + """Type.""" -class LOCRecordSettings(TypedDict, total=False): +class CERTRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -691,27 +685,24 @@ class LOCRecordSettings(TypedDict, total=False): """ -class MXRecord(TypedDict, total=False): +class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DNSKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A valid mail server hostname.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - priority: float - """Required for MX, SRV and URI records; unused by other record types. - - Records with lower priorities are preferred. - """ + data: DNSKEYRecordData + """Components of a DNSKEY record.""" proxied: bool """ @@ -719,7 +710,7 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ - settings: MXRecordSettings + settings: DNSKEYRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -732,11 +723,22 @@ class MXRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["MX"] - """Record type.""" +class DNSKEYRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" -class MXRecordSettings(TypedDict, total=False): + flags: float + """Flags.""" + + protocol: float + """Protocol.""" + + public_key: str + """Public Key.""" + + +class DNSKEYRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -754,21 +756,24 @@ class MXRecordSettings(TypedDict, total=False): """ -class NAPTRRecord(TypedDict, total=False): +class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: NAPTRRecordData - """Components of a NAPTR record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: DSRecordData + """Components of a DS record.""" proxied: bool """ @@ -776,7 +781,7 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ - settings: NAPTRRecordSettings + settings: DSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -787,33 +792,24 @@ class NAPTRRecord(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["NAPTR"] - """Record type.""" - - -class NAPTRRecordData(TypedDict, total=False): - flags: str - """Flags.""" + """ - order: float - """Order.""" - preference: float - """Preference.""" +class DSRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - regex: str - """Regex.""" + digest: str + """Digest.""" - replacement: str - """Replacement.""" + digest_type: float + """Digest Type.""" - service: str - """Service.""" + key_tag: float + """Key Tag.""" -class NAPTRRecordSettings(TypedDict, total=False): +class DSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -831,21 +827,24 @@ class NAPTRRecordSettings(TypedDict, total=False): """ -class NSRecord(TypedDict, total=False): +class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A valid name server host name.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: HTTPSRecordData + """Components of a HTTPS record.""" proxied: bool """ @@ -853,7 +852,7 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ - settings: NSRecordSettings + settings: HTTPSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -866,11 +865,19 @@ class NSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["NS"] - """Record type.""" +class HTTPSRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" -class NSRecordSettings(TypedDict, total=False): + value: str + """value.""" + + +class HTTPSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -888,21 +895,24 @@ class NSRecordSettings(TypedDict, total=False): """ -class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): +class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: LOCRecordData + """Components of a LOC record.""" proxied: bool """ @@ -910,7 +920,7 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings + settings: LOCRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -923,11 +933,46 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["OPENPGPKEY"] - """Record type.""" +class LOCRecordData(TypedDict, total=False): + altitude: float + """Altitude of location in meters.""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + lat_degrees: float + """Degrees of latitude.""" + + lat_direction: Literal["N", "S"] + """Latitude direction.""" + + lat_minutes: float + """Minutes of latitude.""" + + lat_seconds: float + """Seconds of latitude.""" + + long_degrees: float + """Degrees of longitude.""" + + long_direction: Literal["E", "W"] + """Longitude direction.""" + + long_minutes: float + """Minutes of longitude.""" + + long_seconds: float + """Seconds of longitude.""" + + precision_horz: float + """Horizontal precision of location.""" + + precision_vert: float + """Vertical precision of location.""" + + size: float + """Size of location in meters.""" + + +class LOCRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -945,21 +990,24 @@ class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): """ -class PTRRecord(TypedDict, total=False): +class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """Domain name pointing to the address.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: NAPTRRecordData + """Components of a NAPTR record.""" proxied: bool """ @@ -967,7 +1015,7 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ - settings: PTRRecordSettings + settings: NAPTRRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -980,11 +1028,28 @@ class PTRRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["PTR"] - """Record type.""" +class NAPTRRecordData(TypedDict, total=False): + flags: str + """Flags.""" + + order: float + """Order.""" + + preference: float + """Preference.""" -class PTRRecordSettings(TypedDict, total=False): + regex: str + """Regex.""" + + replacement: str + """Replacement.""" + + service: str + """Service.""" + + +class NAPTRRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -1006,6 +1071,12 @@ class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1015,9 +1086,6 @@ class SMIMEARecord(TypedDict, total=False): data: SMIMEARecordData """Components of a SMIMEA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1037,9 +1105,6 @@ class SMIMEARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SMIMEA"] - """Record type.""" - class SMIMEARecordData(TypedDict, total=False): certificate: str @@ -1077,6 +1142,12 @@ class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SRV"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1086,9 +1157,6 @@ class SRVRecord(TypedDict, total=False): data: SRVRecordData """Components of a SRV record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1108,9 +1176,6 @@ class SRVRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SRV"] - """Record type.""" - class SRVRecordData(TypedDict, total=False): port: float @@ -1151,6 +1216,12 @@ class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1160,9 +1231,6 @@ class SSHFPRecord(TypedDict, total=False): data: SSHFPRecordData """Components of a SSHFP record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1182,9 +1250,6 @@ class SSHFPRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SSHFP"] - """Record type.""" - class SSHFPRecordData(TypedDict, total=False): algorithm: float @@ -1219,6 +1284,12 @@ class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1228,9 +1299,6 @@ class SVCBRecord(TypedDict, total=False): data: SVCBRecordData """Components of a SVCB record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1250,9 +1318,6 @@ class SVCBRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SVCB"] - """Record type.""" - class SVCBRecordData(TypedDict, total=False): priority: float @@ -1287,6 +1352,12 @@ class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1296,9 +1367,6 @@ class TLSARecord(TypedDict, total=False): data: TLSARecordData """Components of a TLSA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1318,9 +1386,6 @@ class TLSARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["TLSA"] - """Record type.""" - class TLSARecordData(TypedDict, total=False): certificate: str @@ -1354,75 +1419,16 @@ class TLSARecordSettings(TypedDict, total=False): """ -class TXTRecord(TypedDict, total=False): +class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """Text content for the record. - - The content must consist of quoted "character strings" (RFC 1035), each with a - length of up to 255 bytes. Strings exceeding this allowed maximum length are - automatically split. - - Learn more at - . - """ - - name: str + name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: TXTRecordSettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS 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: Literal["TXT"] + type: Required[Literal["URI"]] """Record type.""" - -class TXTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class URIRecord(TypedDict, total=False): - zone_id: Required[str] - """Identifier.""" - comment: str """Comments or notes about the DNS record. @@ -1432,9 +1438,6 @@ class URIRecord(TypedDict, total=False): data: URIRecordData """Components of a URI record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: float """Required for MX, SRV and URI records; unused by other record types. @@ -1460,9 +1463,6 @@ class URIRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["URI"] - """Record type.""" - class URIRecordData(TypedDict, total=False): target: str @@ -1493,23 +1493,23 @@ class URIRecordSettings(TypedDict, total=False): RecordEditParams: TypeAlias = Union[ ARecord, AAAARecord, + CNAMERecord, + MXRecord, + NSRecord, + DNSRecordsOpenpgpkeyRecord, + PTRRecord, + TXTRecord, CAARecord, CERTRecord, - CNAMERecord, DNSKEYRecord, DSRecord, HTTPSRecord, LOCRecord, - MXRecord, NAPTRRecord, - NSRecord, - DNSRecordsOpenpgpkeyRecord, - PTRRecord, SMIMEARecord, SRVRecord, SSHFPRecord, SVCBRecord, TLSARecord, - TXTRecord, URIRecord, ] diff --git a/src/cloudflare/types/dns/record_param.py b/src/cloudflare/types/dns/record_param.py deleted file mode 100644 index fd9202fefef..00000000000 --- a/src/cloudflare/types/dns/record_param.py +++ /dev/null @@ -1,110 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from typing_extensions import Literal, TypeAlias, TypedDict - -from .ttl_param import TTLParam -from .record_tags import RecordTags -from .a_record_param import ARecordParam -from .ds_record_param import DSRecordParam -from .mx_record_param import MXRecordParam -from .ns_record_param import NSRecordParam -from .caa_record_param import CAARecordParam -from .loc_record_param import LOCRecordParam -from .ptr_record_param import PTRRecordParam -from .srv_record_param import SRVRecordParam -from .txt_record_param import TXTRecordParam -from .uri_record_param import URIRecordParam -from .aaaa_record_param import AAAARecordParam -from .cert_record_param import CERTRecordParam -from .svcb_record_param import SVCBRecordParam -from .tlsa_record_param import TLSARecordParam -from .cname_record_param import CNAMERecordParam -from .https_record_param import HTTPSRecordParam -from .naptr_record_param import NAPTRRecordParam -from .sshfp_record_param import SSHFPRecordParam -from .dnskey_record_param import DNSKEYRecordParam -from .smimea_record_param import SMIMEARecordParam - -__all__ = ["RecordParam", "Openpgpkey", "OpenpgpkeySettings"] - - -class OpenpgpkeySettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(TypedDict, total=False): - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS 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: Literal["OPENPGPKEY"] - """Record type.""" - - -RecordParam: TypeAlias = Union[ - ARecordParam, - AAAARecordParam, - CAARecordParam, - CERTRecordParam, - CNAMERecordParam, - DNSKEYRecordParam, - DSRecordParam, - HTTPSRecordParam, - LOCRecordParam, - MXRecordParam, - NAPTRRecordParam, - NSRecordParam, - Openpgpkey, - PTRRecordParam, - SMIMEARecordParam, - SRVRecordParam, - SSHFPRecordParam, - SVCBRecordParam, - TLSARecordParam, - TXTRecordParam, - URIRecordParam, -] diff --git a/src/cloudflare/types/dns/record_response.py b/src/cloudflare/types/dns/record_response.py index 5d85efa5a11..b9a3de7c9c3 100644 --- a/src/cloudflare/types/dns/record_response.py +++ b/src/cloudflare/types/dns/record_response.py @@ -2,61 +2,62 @@ from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - +from typing_extensions import Literal, TypeAlias + +from . import ( + a_record, + ds_record, + mx_record, + ns_record, + caa_record, + loc_record, + ptr_record, + srv_record, + txt_record, + uri_record, + aaaa_record, + cert_record, + svcb_record, + tlsa_record, + cname_record, + https_record, + naptr_record, + sshfp_record, + dnskey_record, + smimea_record, +) from .ttl import TTL -from ..._utils import PropertyInfo -from .a_record import ARecord from ..._models import BaseModel -from .ds_record import DSRecord -from .mx_record import MXRecord -from .ns_record import NSRecord -from .caa_record import CAARecord -from .loc_record import LOCRecord -from .ptr_record import PTRRecord -from .srv_record import SRVRecord -from .txt_record import TXTRecord -from .uri_record import URIRecord -from .aaaa_record import AAAARecord -from .cert_record import CERTRecord from .record_tags import RecordTags -from .svcb_record import SVCBRecord -from .tlsa_record import TLSARecord -from .cname_record import CNAMERecord -from .https_record import HTTPSRecord -from .naptr_record import NAPTRRecord -from .sshfp_record import SSHFPRecord -from .dnskey_record import DNSKEYRecord -from .smimea_record import SMIMEARecord __all__ = [ "RecordResponse", - "A", - "AAAA", - "CAA", - "CERT", - "CNAME", - "DNSKEY", - "DS", - "HTTPS", - "LOC", - "MX", - "NAPTR", - "NS", - "Openpgpkey", - "OpenpgpkeySettings", - "PTR", - "SMIMEA", - "SRV", - "SSHFP", - "SVCB", - "TLSA", - "TXT", - "URI", + "ARecord", + "AAAARecord", + "CNAMERecord", + "MXRecord", + "NSRecord", + "OpenpgpkeyRecord", + "OpenpgpkeyRecordSettings", + "PTRRecord", + "TXTRecord", + "CAARecord", + "CERTRecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "NAPTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "URIRecord", ] -class A(ARecord): +class ARecord(a_record.ARecord): id: str """Identifier.""" @@ -79,7 +80,7 @@ class A(ARecord): """When the record tags were last modified. Omitted if there are no tags.""" -class AAAA(AAAARecord): +class AAAARecord(aaaa_record.AAAARecord): id: str """Identifier.""" @@ -102,7 +103,7 @@ class AAAA(AAAARecord): """When the record tags were last modified. Omitted if there are no tags.""" -class CAA(CAARecord): +class CNAMERecord(cname_record.CNAMERecord): id: str """Identifier.""" @@ -125,7 +126,7 @@ class CAA(CAARecord): """When the record tags were last modified. Omitted if there are no tags.""" -class CERT(CERTRecord): +class MXRecord(mx_record.MXRecord): id: str """Identifier.""" @@ -148,7 +149,7 @@ class CERT(CERTRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class CNAME(CNAMERecord): +class NSRecord(ns_record.NSRecord): id: str """Identifier.""" @@ -171,10 +172,37 @@ class CNAME(CNAMERecord): """When the record tags were last modified. Omitted if there are no tags.""" -class DNSKEY(DNSKEYRecord): +class OpenpgpkeyRecordSettings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class OpenpgpkeyRecord(BaseModel): id: str """Identifier.""" + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + created_on: datetime """When the record was created.""" @@ -184,9 +212,34 @@ class DNSKEY(DNSKEYRecord): modified_on: datetime """When the record was last modified.""" + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + proxiable: bool """Whether the record can be proxied by Cloudflare or not.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + settings: OpenpgpkeyRecordSettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + comment_modified_on: Optional[datetime] = None """When the record comment was last modified. Omitted if there is no comment.""" @@ -194,7 +247,7 @@ class DNSKEY(DNSKEYRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class DS(DSRecord): +class PTRRecord(ptr_record.PTRRecord): id: str """Identifier.""" @@ -217,7 +270,7 @@ class DS(DSRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class HTTPS(HTTPSRecord): +class TXTRecord(txt_record.TXTRecord): id: str """Identifier.""" @@ -240,7 +293,7 @@ class HTTPS(HTTPSRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class LOC(LOCRecord): +class CAARecord(caa_record.CAARecord): id: str """Identifier.""" @@ -263,7 +316,7 @@ class LOC(LOCRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class MX(MXRecord): +class CERTRecord(cert_record.CERTRecord): id: str """Identifier.""" @@ -286,7 +339,7 @@ class MX(MXRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class NAPTR(NAPTRRecord): +class DNSKEYRecord(dnskey_record.DNSKEYRecord): id: str """Identifier.""" @@ -309,7 +362,7 @@ class NAPTR(NAPTRRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class NS(NSRecord): +class DSRecord(ds_record.DSRecord): id: str """Identifier.""" @@ -332,37 +385,10 @@ class NS(NSRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class OpenpgpkeySettings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(BaseModel): +class HTTPSRecord(https_record.HTTPSRecord): id: str """Identifier.""" - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - created_on: datetime """When the record was created.""" @@ -372,34 +398,9 @@ class Openpgpkey(BaseModel): modified_on: datetime """When the record was last modified.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxiable: bool """Whether the record can be proxied by Cloudflare or not.""" - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - comment_modified_on: Optional[datetime] = None """When the record comment was last modified. Omitted if there is no comment.""" @@ -407,7 +408,7 @@ class Openpgpkey(BaseModel): """When the record tags were last modified. Omitted if there are no tags.""" -class PTR(PTRRecord): +class LOCRecord(loc_record.LOCRecord): id: str """Identifier.""" @@ -430,7 +431,7 @@ class PTR(PTRRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class SMIMEA(SMIMEARecord): +class NAPTRRecord(naptr_record.NAPTRRecord): id: str """Identifier.""" @@ -453,7 +454,7 @@ class SMIMEA(SMIMEARecord): """When the record tags were last modified. Omitted if there are no tags.""" -class SRV(SRVRecord): +class SMIMEARecord(smimea_record.SMIMEARecord): id: str """Identifier.""" @@ -476,7 +477,7 @@ class SRV(SRVRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class SSHFP(SSHFPRecord): +class SRVRecord(srv_record.SRVRecord): id: str """Identifier.""" @@ -499,7 +500,7 @@ class SSHFP(SSHFPRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class SVCB(SVCBRecord): +class SSHFPRecord(sshfp_record.SSHFPRecord): id: str """Identifier.""" @@ -522,7 +523,7 @@ class SVCB(SVCBRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class TLSA(TLSARecord): +class SVCBRecord(svcb_record.SVCBRecord): id: str """Identifier.""" @@ -545,7 +546,7 @@ class TLSA(TLSARecord): """When the record tags were last modified. Omitted if there are no tags.""" -class TXT(TXTRecord): +class TLSARecord(tlsa_record.TLSARecord): id: str """Identifier.""" @@ -568,7 +569,7 @@ class TXT(TXTRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class URI(URIRecord): +class URIRecord(uri_record.URIRecord): id: str """Identifier.""" @@ -591,29 +592,26 @@ class URI(URIRecord): """When the record tags were last modified. Omitted if there are no tags.""" -RecordResponse: TypeAlias = Annotated[ - Union[ - A, - AAAA, - CAA, - CERT, - CNAME, - DNSKEY, - DS, - HTTPS, - LOC, - MX, - NAPTR, - NS, - Openpgpkey, - PTR, - SMIMEA, - SRV, - SSHFP, - SVCB, - TLSA, - TXT, - URI, - ], - PropertyInfo(discriminator="type"), +RecordResponse: TypeAlias = Union[ + ARecord, + AAAARecord, + CNAMERecord, + MXRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + TXTRecord, + CAARecord, + CERTRecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + NAPTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + URIRecord, ] diff --git a/src/cloudflare/types/dns/record_update_params.py b/src/cloudflare/types/dns/record_update_params.py index c66bfa59fa9..3420e186d33 100644 --- a/src/cloudflare/types/dns/record_update_params.py +++ b/src/cloudflare/types/dns/record_update_params.py @@ -14,14 +14,24 @@ "ARecordSettings", "AAAARecord", "AAAARecordSettings", + "CNAMERecord", + "CNAMERecordSettings", + "MXRecord", + "MXRecordSettings", + "NSRecord", + "NSRecordSettings", + "DNSRecordsOpenpgpkeyRecord", + "DNSRecordsOpenpgpkeyRecordSettings", + "PTRRecord", + "PTRRecordSettings", + "TXTRecord", + "TXTRecordSettings", "CAARecord", "CAARecordData", "CAARecordSettings", "CERTRecord", "CERTRecordData", "CERTRecordSettings", - "CNAMERecord", - "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", "DNSKEYRecordSettings", @@ -34,17 +44,9 @@ "LOCRecord", "LOCRecordData", "LOCRecordSettings", - "MXRecord", - "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", "NAPTRRecordSettings", - "NSRecord", - "NSRecordSettings", - "DNSRecordsOpenpgpkeyRecord", - "DNSRecordsOpenpgpkeyRecordSettings", - "PTRRecord", - "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", "SMIMEARecordSettings", @@ -60,8 +62,6 @@ "TLSARecord", "TLSARecordData", "TLSARecordSettings", - "TXTRecord", - "TXTRecordSettings", "URIRecord", "URIRecordData", "URIRecordSettings", @@ -72,6 +72,12 @@ class ARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["A"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -81,9 +87,6 @@ class ARecord(TypedDict, total=False): content: str """A valid IPv4 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -103,9 +106,6 @@ class ARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["A"] - """Record type.""" - class ARecordSettings(TypedDict, total=False): ipv4_only: bool @@ -129,6 +129,12 @@ class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -138,9 +144,6 @@ class AAAARecord(TypedDict, total=False): content: str """A valid IPv6 address.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -160,9 +163,6 @@ class AAAARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["AAAA"] - """Record type.""" - class AAAARecordSettings(TypedDict, total=False): ipv4_only: bool @@ -182,21 +182,24 @@ class AAAARecordSettings(TypedDict, total=False): """ -class CAARecord(TypedDict, total=False): +class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CNAME"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: CAARecordData - """Components of a CAA record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + content: str + """A valid hostname. Must not match the record's name.""" proxied: bool """ @@ -204,7 +207,7 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ - settings: CAARecordSettings + settings: CNAMERecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -217,22 +220,16 @@ class CAARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CAA"] - """Record type.""" - - -class CAARecordData(TypedDict, total=False): - flags: float - """Flags for the CAA record.""" - - tag: str - """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" - - value: str - """Value of the record. This field's semantics depend on the chosen tag.""" +class CNAMERecordSettings(TypedDict, total=False): + flatten_cname: bool + """ + If enabled, causes the CNAME record to be resolved externally and the resulting + address records (e.g., A and AAAA) to be returned instead of the CNAME record + itself. This setting is unavailable for proxied records, since they are always + flattened. + """ -class CAARecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -250,21 +247,30 @@ class CAARecordSettings(TypedDict, total=False): """ -class CERTRecord(TypedDict, total=False): +class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["MX"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: CERTRecordData - """Components of a CERT record.""" + content: str + """A valid mail server hostname.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ proxied: bool """ @@ -272,7 +278,7 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ - settings: CERTRecordSettings + settings: MXRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -285,25 +291,8 @@ class CERTRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CERT"] - """Record type.""" - - -class CERTRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" - certificate: str - """Certificate.""" - - key_tag: float - """Key Tag.""" - - type: float - """Type.""" - - -class CERTRecordSettings(TypedDict, total=False): +class MXRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -321,10 +310,16 @@ class CERTRecordSettings(TypedDict, total=False): """ -class CNAMERecord(TypedDict, total=False): +class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -332,10 +327,7 @@ class CNAMERecord(TypedDict, total=False): """ content: str - """A valid hostname. Must not match the record's name.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + """A valid name server host name.""" proxied: bool """ @@ -343,7 +335,7 @@ class CNAMERecord(TypedDict, total=False): Cloudflare. """ - settings: CNAMERecordSettings + settings: NSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -356,19 +348,8 @@ class CNAMERecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["CNAME"] - """Record type.""" - - -class CNAMERecordSettings(TypedDict, total=False): - flatten_cname: bool - """ - If enabled, causes the CNAME record to be resolved externally and the resulting - address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always - flattened. - """ +class NSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -386,21 +367,24 @@ class CNAMERecordSettings(TypedDict, total=False): """ -class DNSKEYRecord(TypedDict, total=False): +class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: DNSKEYRecordData - """Components of a DNSKEY record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" proxied: bool """ @@ -408,7 +392,7 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSKEYRecordSettings + settings: DNSRecordsOpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -421,25 +405,65 @@ class DNSKEYRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["DNSKEY"] + +class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class PTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] """Record type.""" + comment: str + """Comments or notes about the DNS record. -class DNSKEYRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" + This field has no effect on DNS responses. + """ - flags: float - """Flags.""" + content: str + """Domain name pointing to the address.""" - protocol: float - """Protocol.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - public_key: str - """Public Key.""" + settings: PTRRecordSettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. -class DNSKEYRecordSettings(TypedDict, total=False): + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +class PTRRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -457,21 +481,32 @@ class DNSKEYRecordSettings(TypedDict, total=False): """ -class DSRecord(TypedDict, total=False): +class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: DSRecordData - """Components of a DS record.""" + content: str + """Text content for the record. - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + The content must consist of quoted "character strings" (RFC 1035), each with a + length of up to 255 bytes. Strings exceeding this allowed maximum length are + automatically split. + + Learn more at + . + """ proxied: bool """ @@ -479,7 +514,7 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ - settings: DSRecordSettings + settings: TXTRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -492,25 +527,8 @@ class DSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["DS"] - """Record type.""" - -class DSRecordData(TypedDict, total=False): - algorithm: float - """Algorithm.""" - - digest: str - """Digest.""" - - digest_type: float - """Digest Type.""" - - key_tag: float - """Key Tag.""" - - -class DSRecordSettings(TypedDict, total=False): +class TXTRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -528,21 +546,24 @@ class DSRecordSettings(TypedDict, total=False): """ -class HTTPSRecord(TypedDict, total=False): +class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CAA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: HTTPSRecordData - """Components of a HTTPS record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: CAARecordData + """Components of a CAA record.""" proxied: bool """ @@ -550,7 +571,7 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ - settings: HTTPSRecordSettings + settings: CAARecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -563,22 +584,19 @@ class HTTPSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["HTTPS"] - """Record type.""" - -class HTTPSRecordData(TypedDict, total=False): - priority: float - """priority.""" +class CAARecordData(TypedDict, total=False): + flags: float + """Flags for the CAA record.""" - target: str - """target.""" + tag: str + """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" value: str - """value.""" + """Value of the record. This field's semantics depend on the chosen tag.""" -class HTTPSRecordSettings(TypedDict, total=False): +class CAARecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -596,21 +614,24 @@ class HTTPSRecordSettings(TypedDict, total=False): """ -class LOCRecord(TypedDict, total=False): +class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: LOCRecordData - """Components of a LOC record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: CERTRecordData + """Components of a CERT record.""" proxied: bool """ @@ -618,7 +639,7 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ - settings: LOCRecordSettings + settings: CERTRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -631,49 +652,22 @@ class LOCRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["LOC"] - """Record type.""" - - -class LOCRecordData(TypedDict, total=False): - altitude: float - """Altitude of location in meters.""" - lat_degrees: float - """Degrees of latitude.""" - - lat_direction: Literal["N", "S"] - """Latitude direction.""" - - lat_minutes: float - """Minutes of latitude.""" - - lat_seconds: float - """Seconds of latitude.""" - - long_degrees: float - """Degrees of longitude.""" - - long_direction: Literal["E", "W"] - """Longitude direction.""" - - long_minutes: float - """Minutes of longitude.""" - - long_seconds: float - """Seconds of longitude.""" +class CERTRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - precision_horz: float - """Horizontal precision of location.""" + certificate: str + """Certificate.""" - precision_vert: float - """Vertical precision of location.""" + key_tag: float + """Key Tag.""" - size: float - """Size of location in meters.""" + type: float + """Type.""" -class LOCRecordSettings(TypedDict, total=False): +class CERTRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -691,27 +685,24 @@ class LOCRecordSettings(TypedDict, total=False): """ -class MXRecord(TypedDict, total=False): +class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DNSKEY"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A valid mail server hostname.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - priority: float - """Required for MX, SRV and URI records; unused by other record types. - - Records with lower priorities are preferred. - """ + data: DNSKEYRecordData + """Components of a DNSKEY record.""" proxied: bool """ @@ -719,7 +710,7 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ - settings: MXRecordSettings + settings: DNSKEYRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -732,11 +723,22 @@ class MXRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["MX"] - """Record type.""" +class DNSKEYRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" -class MXRecordSettings(TypedDict, total=False): + flags: float + """Flags.""" + + protocol: float + """Protocol.""" + + public_key: str + """Public Key.""" + + +class DNSKEYRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -754,21 +756,24 @@ class MXRecordSettings(TypedDict, total=False): """ -class NAPTRRecord(TypedDict, total=False): +class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["DS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - data: NAPTRRecordData - """Components of a NAPTR record.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: DSRecordData + """Components of a DS record.""" proxied: bool """ @@ -776,7 +781,7 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ - settings: NAPTRRecordSettings + settings: DSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -787,33 +792,24 @@ class NAPTRRecord(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["NAPTR"] - """Record type.""" - - -class NAPTRRecordData(TypedDict, total=False): - flags: str - """Flags.""" + """ - order: float - """Order.""" - preference: float - """Preference.""" +class DSRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - regex: str - """Regex.""" + digest: str + """Digest.""" - replacement: str - """Replacement.""" + digest_type: float + """Digest Type.""" - service: str - """Service.""" + key_tag: float + """Key Tag.""" -class NAPTRRecordSettings(TypedDict, total=False): +class DSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -831,21 +827,24 @@ class NAPTRRecordSettings(TypedDict, total=False): """ -class NSRecord(TypedDict, total=False): +class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A valid name server host name.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: HTTPSRecordData + """Components of a HTTPS record.""" proxied: bool """ @@ -853,7 +852,7 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ - settings: NSRecordSettings + settings: HTTPSRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -866,11 +865,19 @@ class NSRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["NS"] - """Record type.""" +class HTTPSRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" -class NSRecordSettings(TypedDict, total=False): + value: str + """value.""" + + +class HTTPSRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -888,21 +895,24 @@ class NSRecordSettings(TypedDict, total=False): """ -class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): +class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: LOCRecordData + """Components of a LOC record.""" proxied: bool """ @@ -910,7 +920,7 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings + settings: LOCRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -923,11 +933,46 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["OPENPGPKEY"] - """Record type.""" +class LOCRecordData(TypedDict, total=False): + altitude: float + """Altitude of location in meters.""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + lat_degrees: float + """Degrees of latitude.""" + + lat_direction: Literal["N", "S"] + """Latitude direction.""" + + lat_minutes: float + """Minutes of latitude.""" + + lat_seconds: float + """Seconds of latitude.""" + + long_degrees: float + """Degrees of longitude.""" + + long_direction: Literal["E", "W"] + """Longitude direction.""" + + long_minutes: float + """Minutes of longitude.""" + + long_seconds: float + """Seconds of longitude.""" + + precision_horz: float + """Horizontal precision of location.""" + + precision_vert: float + """Vertical precision of location.""" + + size: float + """Size of location in meters.""" + + +class LOCRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -945,21 +990,24 @@ class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): """ -class PTRRecord(TypedDict, total=False): +class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """Domain name pointing to the address.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" + data: NAPTRRecordData + """Components of a NAPTR record.""" proxied: bool """ @@ -967,7 +1015,7 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ - settings: PTRRecordSettings + settings: NAPTRRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -980,11 +1028,28 @@ class PTRRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["PTR"] - """Record type.""" +class NAPTRRecordData(TypedDict, total=False): + flags: str + """Flags.""" + + order: float + """Order.""" + + preference: float + """Preference.""" -class PTRRecordSettings(TypedDict, total=False): + regex: str + """Regex.""" + + replacement: str + """Replacement.""" + + service: str + """Service.""" + + +class NAPTRRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -1006,6 +1071,12 @@ class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1015,9 +1086,6 @@ class SMIMEARecord(TypedDict, total=False): data: SMIMEARecordData """Components of a SMIMEA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1037,9 +1105,6 @@ class SMIMEARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SMIMEA"] - """Record type.""" - class SMIMEARecordData(TypedDict, total=False): certificate: str @@ -1077,6 +1142,12 @@ class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SRV"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1086,9 +1157,6 @@ class SRVRecord(TypedDict, total=False): data: SRVRecordData """Components of a SRV record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1108,9 +1176,6 @@ class SRVRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SRV"] - """Record type.""" - class SRVRecordData(TypedDict, total=False): port: float @@ -1151,6 +1216,12 @@ class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1160,9 +1231,6 @@ class SSHFPRecord(TypedDict, total=False): data: SSHFPRecordData """Components of a SSHFP record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1182,9 +1250,6 @@ class SSHFPRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SSHFP"] - """Record type.""" - class SSHFPRecordData(TypedDict, total=False): algorithm: float @@ -1219,6 +1284,12 @@ class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1228,9 +1299,6 @@ class SVCBRecord(TypedDict, total=False): data: SVCBRecordData """Components of a SVCB record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1250,9 +1318,6 @@ class SVCBRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["SVCB"] - """Record type.""" - class SVCBRecordData(TypedDict, total=False): priority: float @@ -1287,6 +1352,12 @@ class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -1296,9 +1367,6 @@ class TLSARecord(TypedDict, total=False): data: TLSARecordData """Components of a TLSA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -1318,9 +1386,6 @@ class TLSARecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["TLSA"] - """Record type.""" - class TLSARecordData(TypedDict, total=False): certificate: str @@ -1354,75 +1419,16 @@ class TLSARecordSettings(TypedDict, total=False): """ -class TXTRecord(TypedDict, total=False): +class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """Text content for the record. - - The content must consist of quoted "character strings" (RFC 1035), each with a - length of up to 255 bytes. Strings exceeding this allowed maximum length are - automatically split. - - Learn more at - . - """ - - name: str + name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: TXTRecordSettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS 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: Literal["TXT"] + type: Required[Literal["URI"]] """Record type.""" - -class TXTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class URIRecord(TypedDict, total=False): - zone_id: Required[str] - """Identifier.""" - comment: str """Comments or notes about the DNS record. @@ -1432,9 +1438,6 @@ class URIRecord(TypedDict, total=False): data: URIRecordData """Components of a URI record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: float """Required for MX, SRV and URI records; unused by other record types. @@ -1460,9 +1463,6 @@ class URIRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["URI"] - """Record type.""" - class URIRecordData(TypedDict, total=False): target: str @@ -1493,23 +1493,23 @@ class URIRecordSettings(TypedDict, total=False): RecordUpdateParams: TypeAlias = Union[ ARecord, AAAARecord, + CNAMERecord, + MXRecord, + NSRecord, + DNSRecordsOpenpgpkeyRecord, + PTRRecord, + TXTRecord, CAARecord, CERTRecord, - CNAMERecord, DNSKEYRecord, DSRecord, HTTPSRecord, LOCRecord, - MXRecord, NAPTRRecord, - NSRecord, - DNSRecordsOpenpgpkeyRecord, - PTRRecord, SMIMEARecord, SRVRecord, SSHFPRecord, SVCBRecord, TLSARecord, - TXTRecord, URIRecord, ] diff --git a/src/cloudflare/types/dns/smimea_record.py b/src/cloudflare/types/dns/smimea_record.py index 7dc5ddbe673..36809d36e62 100644 --- a/src/cloudflare/types/dns/smimea_record.py +++ b/src/cloudflare/types/dns/smimea_record.py @@ -43,6 +43,12 @@ class Settings(BaseModel): class SMIMEARecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["SMIMEA"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -55,9 +61,6 @@ class SMIMEARecord(BaseModel): data: Optional[Data] = None """Components of a SMIMEA record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -76,6 +79,3 @@ class SMIMEARecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["SMIMEA"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/smimea_record_param.py b/src/cloudflare/types/dns/smimea_record_param.py index 45fb99c8700..88563331e7c 100644 --- a/src/cloudflare/types/dns/smimea_record_param.py +++ b/src/cloudflare/types/dns/smimea_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -44,6 +44,12 @@ class Settings(TypedDict, total=False): class SMIMEARecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -53,9 +59,6 @@ class SMIMEARecordParam(TypedDict, total=False): data: Data """Components of a SMIMEA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -74,6 +77,3 @@ class SMIMEARecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["SMIMEA"] - """Record type.""" diff --git a/src/cloudflare/types/dns/srv_record.py b/src/cloudflare/types/dns/srv_record.py index add58ecb3c5..c6af1db2cdb 100644 --- a/src/cloudflare/types/dns/srv_record.py +++ b/src/cloudflare/types/dns/srv_record.py @@ -46,6 +46,12 @@ class Settings(BaseModel): class SRVRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["SRV"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -61,9 +67,6 @@ class SRVRecord(BaseModel): data: Optional[Data] = None """Components of a SRV record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -82,6 +85,3 @@ class SRVRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["SRV"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/srv_record_param.py b/src/cloudflare/types/dns/srv_record_param.py index a451de23711..26661a4d488 100644 --- a/src/cloudflare/types/dns/srv_record_param.py +++ b/src/cloudflare/types/dns/srv_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -47,6 +47,12 @@ class Settings(TypedDict, total=False): class SRVRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SRV"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -56,9 +62,6 @@ class SRVRecordParam(TypedDict, total=False): data: Data """Components of a SRV record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -77,6 +80,3 @@ class SRVRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["SRV"] - """Record type.""" diff --git a/src/cloudflare/types/dns/sshfp_record.py b/src/cloudflare/types/dns/sshfp_record.py index cc8082194a4..34eebe100af 100644 --- a/src/cloudflare/types/dns/sshfp_record.py +++ b/src/cloudflare/types/dns/sshfp_record.py @@ -40,6 +40,12 @@ class Settings(BaseModel): class SSHFPRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["SSHFP"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -52,9 +58,6 @@ class SSHFPRecord(BaseModel): data: Optional[Data] = None """Components of a SSHFP record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -73,6 +76,3 @@ class SSHFPRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["SSHFP"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/sshfp_record_param.py b/src/cloudflare/types/dns/sshfp_record_param.py index 1f76cd1426b..55300dd798c 100644 --- a/src/cloudflare/types/dns/sshfp_record_param.py +++ b/src/cloudflare/types/dns/sshfp_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -41,6 +41,12 @@ class Settings(TypedDict, total=False): class SSHFPRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -50,9 +56,6 @@ class SSHFPRecordParam(TypedDict, total=False): data: Data """Components of a SSHFP record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -71,6 +74,3 @@ class SSHFPRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["SSHFP"] - """Record type.""" diff --git a/src/cloudflare/types/dns/svcb_record.py b/src/cloudflare/types/dns/svcb_record.py index 9daf5db47e4..2047b8b3a6e 100644 --- a/src/cloudflare/types/dns/svcb_record.py +++ b/src/cloudflare/types/dns/svcb_record.py @@ -40,6 +40,12 @@ class Settings(BaseModel): class SVCBRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["SVCB"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -52,9 +58,6 @@ class SVCBRecord(BaseModel): data: Optional[Data] = None """Components of a SVCB record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -73,6 +76,3 @@ class SVCBRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["SVCB"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/svcb_record_param.py b/src/cloudflare/types/dns/svcb_record_param.py index d82b6b1fa75..df50717f966 100644 --- a/src/cloudflare/types/dns/svcb_record_param.py +++ b/src/cloudflare/types/dns/svcb_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -41,6 +41,12 @@ class Settings(TypedDict, total=False): class SVCBRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -50,9 +56,6 @@ class SVCBRecordParam(TypedDict, total=False): data: Data """Components of a SVCB record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -71,6 +74,3 @@ class SVCBRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["SVCB"] - """Record type.""" diff --git a/src/cloudflare/types/dns/tlsa_record.py b/src/cloudflare/types/dns/tlsa_record.py index f87a2bf2e98..d6e349d2002 100644 --- a/src/cloudflare/types/dns/tlsa_record.py +++ b/src/cloudflare/types/dns/tlsa_record.py @@ -43,6 +43,12 @@ class Settings(BaseModel): class TLSARecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["TLSA"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -55,9 +61,6 @@ class TLSARecord(BaseModel): data: Optional[Data] = None """Components of a TLSA record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -76,6 +79,3 @@ class TLSARecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["TLSA"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/tlsa_record_param.py b/src/cloudflare/types/dns/tlsa_record_param.py index 8ccad170c08..2a0d3c80d73 100644 --- a/src/cloudflare/types/dns/tlsa_record_param.py +++ b/src/cloudflare/types/dns/tlsa_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -44,6 +44,12 @@ class Settings(TypedDict, total=False): class TLSARecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -53,9 +59,6 @@ class TLSARecordParam(TypedDict, total=False): data: Data """Components of a TLSA record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -74,6 +77,3 @@ class TLSARecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["TLSA"] - """Record type.""" diff --git a/src/cloudflare/types/dns/txt_record.py b/src/cloudflare/types/dns/txt_record.py index 77e0cba8c67..e55205570da 100644 --- a/src/cloudflare/types/dns/txt_record.py +++ b/src/cloudflare/types/dns/txt_record.py @@ -29,6 +29,12 @@ class Settings(BaseModel): class TXTRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["TXT"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,9 +52,6 @@ class TXTRecord(BaseModel): . """ - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None """ Whether the record is receiving the performance and security benefits of @@ -67,6 +70,3 @@ class TXTRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["TXT"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/txt_record_param.py b/src/cloudflare/types/dns/txt_record_param.py index b17a8385426..877cba3a547 100644 --- a/src/cloudflare/types/dns/txt_record_param.py +++ b/src/cloudflare/types/dns/txt_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -30,6 +30,12 @@ class Settings(TypedDict, total=False): class TXTRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -47,9 +53,6 @@ class TXTRecordParam(TypedDict, total=False): . """ - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of @@ -68,6 +71,3 @@ class TXTRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["TXT"] - """Record type.""" diff --git a/src/cloudflare/types/dns/uri_record.py b/src/cloudflare/types/dns/uri_record.py index d281d0c6d28..deb5ec91ebb 100644 --- a/src/cloudflare/types/dns/uri_record.py +++ b/src/cloudflare/types/dns/uri_record.py @@ -37,6 +37,12 @@ class Settings(BaseModel): class URIRecord(BaseModel): + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Literal["URI"] + """Record type.""" + comment: Optional[str] = None """Comments or notes about the DNS record. @@ -49,9 +55,6 @@ class URIRecord(BaseModel): data: Optional[Data] = None """Components of a URI record.""" - name: Optional[str] = None - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: Optional[float] = None """Required for MX, SRV and URI records; unused by other record types. @@ -76,6 +79,3 @@ class URIRecord(BaseModel): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Optional[Literal["URI"]] = None - """Record type.""" diff --git a/src/cloudflare/types/dns/uri_record_param.py b/src/cloudflare/types/dns/uri_record_param.py index 4995b415771..eff1a6684b8 100644 --- a/src/cloudflare/types/dns/uri_record_param.py +++ b/src/cloudflare/types/dns/uri_record_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -38,6 +38,12 @@ class Settings(TypedDict, total=False): class URIRecordParam(TypedDict, total=False): + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["URI"]] + """Record type.""" + comment: str """Comments or notes about the DNS record. @@ -47,9 +53,6 @@ class URIRecordParam(TypedDict, total=False): data: Data """Components of a URI record.""" - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - priority: float """Required for MX, SRV and URI records; unused by other record types. @@ -74,6 +77,3 @@ class URIRecordParam(TypedDict, total=False): Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - - type: Literal["URI"] - """Record type.""" diff --git a/src/cloudflare/types/dns_firewall/analytics/report_get_params.py b/src/cloudflare/types/dns_firewall/analytics/report_get_params.py index dae21a5ed5a..8ef5f5c9902 100644 --- a/src/cloudflare/types/dns_firewall/analytics/report_get_params.py +++ b/src/cloudflare/types/dns_firewall/analytics/report_get_params.py @@ -13,7 +13,7 @@ class ReportGetParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier.""" dimensions: str """A comma-separated list of dimensions to group results by.""" diff --git a/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py b/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py index 9332d84b970..e335fd562be 100644 --- a/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py +++ b/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py @@ -13,7 +13,7 @@ class BytimeGetParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier.""" dimensions: str """A comma-separated list of dimensions to group results by.""" diff --git a/src/cloudflare/types/email_security/investigate_get_response.py b/src/cloudflare/types/email_security/investigate_get_response.py index 43a2cae09b4..2e5495bcc9c 100644 --- a/src/cloudflare/types/email_security/investigate_get_response.py +++ b/src/cloudflare/types/email_security/investigate_get_response.py @@ -7,7 +7,11 @@ from ..._models import BaseModel -__all__ = ["InvestigateGetResponse", "Validation"] +__all__ = ["InvestigateGetResponse", "Properties", "Validation"] + + +class Properties(BaseModel): + whitelisted_pattern_type: Optional[str] = None class Validation(BaseModel): @@ -36,6 +40,8 @@ class InvestigateGetResponse(BaseModel): postfix_id: str """The identifier of the message.""" + properties: Properties + ts: str alert_id: Optional[str] = None diff --git a/src/cloudflare/types/email_security/investigate_list_response.py b/src/cloudflare/types/email_security/investigate_list_response.py index 78004ee0fd5..580f118a42f 100644 --- a/src/cloudflare/types/email_security/investigate_list_response.py +++ b/src/cloudflare/types/email_security/investigate_list_response.py @@ -7,7 +7,11 @@ from ..._models import BaseModel -__all__ = ["InvestigateListResponse", "Validation"] +__all__ = ["InvestigateListResponse", "Properties", "Validation"] + + +class Properties(BaseModel): + whitelisted_pattern_type: Optional[str] = None class Validation(BaseModel): @@ -36,6 +40,8 @@ class InvestigateListResponse(BaseModel): postfix_id: str """The identifier of the message.""" + properties: Properties + ts: str alert_id: Optional[str] = None diff --git a/src/cloudflare/types/firewall/lockdown_create_params.py b/src/cloudflare/types/firewall/lockdown_create_params.py index 501e56c9f23..7a8edc23ab5 100644 --- a/src/cloudflare/types/firewall/lockdown_create_params.py +++ b/src/cloudflare/types/firewall/lockdown_create_params.py @@ -28,3 +28,19 @@ class LockdownCreateParams(TypedDict, total=False): You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns. """ + + description: str + """An informative summary of the rate limit. + + This value is sanitized and any tags will be removed. + """ + + paused: bool + """When true, indicates that the rule is currently paused.""" + + priority: float + """The priority of the rule to control the processing order. + + A lower number indicates higher priority. If not provided, any rules with a + configured priority will be processed before rules without a priority. + """ diff --git a/src/cloudflare/types/firewall/ua_rule_create_params.py b/src/cloudflare/types/firewall/ua_rule_create_params.py index bd15cf2a8ac..63ae7961c1f 100644 --- a/src/cloudflare/types/firewall/ua_rule_create_params.py +++ b/src/cloudflare/types/firewall/ua_rule_create_params.py @@ -2,14 +2,7 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -from .asn_configuration_param import ASNConfigurationParam -from .ipv6_configuration_param import IPV6ConfigurationParam -from .country_configuration_param import CountryConfigurationParam -from .access_rule_ip_configuration_param import AccessRuleIPConfigurationParam -from .access_rule_cidr_configuration_param import AccessRuleCIDRConfigurationParam +from typing_extensions import Literal, Required, TypedDict __all__ = ["UARuleCreateParams", "Configuration"] @@ -19,16 +12,17 @@ class UARuleCreateParams(TypedDict, total=False): """Defines an identifier.""" configuration: Required[Configuration] - """The rule configuration.""" mode: Required[Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"]] """The action to apply to a matched request.""" -Configuration: TypeAlias = Union[ - AccessRuleIPConfigurationParam, - IPV6ConfigurationParam, - AccessRuleCIDRConfigurationParam, - ASNConfigurationParam, - CountryConfigurationParam, -] +class Configuration(TypedDict, total=False): + target: Literal["ua"] + """The configuration target. + + You must set the target to `ua` when specifying a user agent in the rule. + """ + + value: str + """the user agent to exactly match""" diff --git a/src/cloudflare/types/iam/__init__.py b/src/cloudflare/types/iam/__init__.py index 36d1f4d74c0..a87f6b17c7d 100644 --- a/src/cloudflare/types/iam/__init__.py +++ b/src/cloudflare/types/iam/__init__.py @@ -2,7 +2,15 @@ from __future__ import annotations +from .user_group_list_params import UserGroupListParams as UserGroupListParams +from .user_group_get_response import UserGroupGetResponse as UserGroupGetResponse +from .user_group_create_params import UserGroupCreateParams as UserGroupCreateParams +from .user_group_list_response import UserGroupListResponse as UserGroupListResponse +from .user_group_update_params import UserGroupUpdateParams as UserGroupUpdateParams from .resource_group_list_params import ResourceGroupListParams as ResourceGroupListParams +from .user_group_create_response import UserGroupCreateResponse as UserGroupCreateResponse +from .user_group_delete_response import UserGroupDeleteResponse as UserGroupDeleteResponse +from .user_group_update_response import UserGroupUpdateResponse as UserGroupUpdateResponse from .resource_group_get_response import ResourceGroupGetResponse as ResourceGroupGetResponse from .permission_group_list_params import PermissionGroupListParams as PermissionGroupListParams from .resource_group_create_params import ResourceGroupCreateParams as ResourceGroupCreateParams diff --git a/src/cloudflare/types/iam/permission_group_get_response.py b/src/cloudflare/types/iam/permission_group_get_response.py index 5aef2643aa0..fbb792e8aeb 100644 --- a/src/cloudflare/types/iam/permission_group_get_response.py +++ b/src/cloudflare/types/iam/permission_group_get_response.py @@ -15,10 +15,10 @@ class Meta(BaseModel): class PermissionGroupGetResponse(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the permission group.""" meta: Optional[Meta] = None """Attributes associated to the permission group.""" name: Optional[str] = None - """Name of the group.""" + """Name of the permission group.""" diff --git a/src/cloudflare/types/iam/permission_group_list_response.py b/src/cloudflare/types/iam/permission_group_list_response.py index aafdde5605d..889709302a3 100644 --- a/src/cloudflare/types/iam/permission_group_list_response.py +++ b/src/cloudflare/types/iam/permission_group_list_response.py @@ -15,10 +15,10 @@ class Meta(BaseModel): class PermissionGroupListResponse(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the permission group.""" meta: Optional[Meta] = None """Attributes associated to the permission group.""" name: Optional[str] = None - """Name of the group.""" + """Name of the permission group.""" diff --git a/src/cloudflare/types/iam/resource_group_get_response.py b/src/cloudflare/types/iam/resource_group_get_response.py index 1f41351fa92..23933e007af 100644 --- a/src/cloudflare/types/iam/resource_group_get_response.py +++ b/src/cloudflare/types/iam/resource_group_get_response.py @@ -34,7 +34,7 @@ class Meta(BaseModel): class ResourceGroupGetResponse(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the resource group.""" scope: List[Scope] """The scope associated to the resource group""" diff --git a/src/cloudflare/types/iam/resource_group_list_response.py b/src/cloudflare/types/iam/resource_group_list_response.py index 11a7f0f0365..ad78df2905a 100644 --- a/src/cloudflare/types/iam/resource_group_list_response.py +++ b/src/cloudflare/types/iam/resource_group_list_response.py @@ -34,7 +34,7 @@ class Meta(BaseModel): class ResourceGroupListResponse(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the resource group.""" scope: List[Scope] """The scope associated to the resource group""" diff --git a/src/cloudflare/types/iam/resource_group_update_response.py b/src/cloudflare/types/iam/resource_group_update_response.py index fb5c67ed451..63b71898c02 100644 --- a/src/cloudflare/types/iam/resource_group_update_response.py +++ b/src/cloudflare/types/iam/resource_group_update_response.py @@ -34,7 +34,7 @@ class Meta(BaseModel): class ResourceGroupUpdateResponse(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the resource group.""" scope: List[Scope] """The scope associated to the resource group""" diff --git a/src/cloudflare/types/iam/user_group_create_params.py b/src/cloudflare/types/iam/user_group_create_params.py new file mode 100644 index 00000000000..16cfd90a561 --- /dev/null +++ b/src/cloudflare/types/iam/user_group_create_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["UserGroupCreateParams", "Policy", "PolicyPermissionGroup", "PolicyResourceGroup"] + + +class UserGroupCreateParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + name: Required[str] + """Name of the User group.""" + + policies: Required[Iterable[Policy]] + """Policies attached to the User group""" + + +class PolicyPermissionGroup(TypedDict, total=False): + id: Required[str] + """Permission Group identifier tag.""" + + +class PolicyResourceGroup(TypedDict, total=False): + id: Required[str] + """Resource Group identifier tag.""" + + +class Policy(TypedDict, total=False): + access: Required[Literal["allow", "deny"]] + """Allow or deny operations against the resources.""" + + permission_groups: Required[Iterable[PolicyPermissionGroup]] + """A set of permission groups that are specified to the policy.""" + + resource_groups: Required[Iterable[PolicyResourceGroup]] + """A set of resource groups that are specified to the policy.""" diff --git a/src/cloudflare/types/iam/user_group_create_response.py b/src/cloudflare/types/iam/user_group_create_response.py new file mode 100644 index 00000000000..e8d5011ce98 --- /dev/null +++ b/src/cloudflare/types/iam/user_group_create_response.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = [ + "UserGroupCreateResponse", + "Policy", + "PolicyPermissionGroup", + "PolicyPermissionGroupMeta", + "PolicyResourceGroup", + "PolicyResourceGroupScope", + "PolicyResourceGroupScopeObject", + "PolicyResourceGroupMeta", +] + + +class PolicyPermissionGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyPermissionGroup(BaseModel): + id: str + """Identifier of the permission group.""" + + meta: Optional[PolicyPermissionGroupMeta] = None + """Attributes associated to the permission group.""" + + name: Optional[str] = None + """Name of the permission group.""" + + +class PolicyResourceGroupScopeObject(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Zone ID + etc.) + """ + + +class PolicyResourceGroupScope(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Account + ID etc.) + """ + + objects: List[PolicyResourceGroupScopeObject] + """A list of scope objects for additional context.""" + + +class PolicyResourceGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyResourceGroup(BaseModel): + id: str + """Identifier of the resource group.""" + + scope: List[PolicyResourceGroupScope] + """The scope associated to the resource group""" + + meta: Optional[PolicyResourceGroupMeta] = None + """Attributes associated to the resource group.""" + + name: Optional[str] = None + """Name of the resource group.""" + + +class Policy(BaseModel): + id: Optional[str] = None + """Policy identifier.""" + + access: Optional[Literal["allow", "deny"]] = None + """Allow or deny operations against the resources.""" + + permission_groups: Optional[List[PolicyPermissionGroup]] = None + """A set of permission groups that are specified to the policy.""" + + resource_groups: Optional[List[PolicyResourceGroup]] = None + """A list of resource groups that the policy applies to.""" + + +class UserGroupCreateResponse(BaseModel): + id: str + """User Group identifier tag.""" + + created_on: datetime + """Timestamp for the creation of the user group""" + + modified_on: datetime + """Last time the user group was modified.""" + + name: str + """Name of the user group.""" + + policies: Optional[List[Policy]] = None + """Policies attached to the User group""" diff --git a/src/cloudflare/types/iam/user_group_delete_response.py b/src/cloudflare/types/iam/user_group_delete_response.py new file mode 100644 index 00000000000..ed58df2b8a3 --- /dev/null +++ b/src/cloudflare/types/iam/user_group_delete_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["UserGroupDeleteResponse"] + + +class UserGroupDeleteResponse(BaseModel): + id: str + """Identifier""" diff --git a/src/cloudflare/types/iam/user_group_get_response.py b/src/cloudflare/types/iam/user_group_get_response.py new file mode 100644 index 00000000000..fe6d7ad43aa --- /dev/null +++ b/src/cloudflare/types/iam/user_group_get_response.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = [ + "UserGroupGetResponse", + "Policy", + "PolicyPermissionGroup", + "PolicyPermissionGroupMeta", + "PolicyResourceGroup", + "PolicyResourceGroupScope", + "PolicyResourceGroupScopeObject", + "PolicyResourceGroupMeta", +] + + +class PolicyPermissionGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyPermissionGroup(BaseModel): + id: str + """Identifier of the permission group.""" + + meta: Optional[PolicyPermissionGroupMeta] = None + """Attributes associated to the permission group.""" + + name: Optional[str] = None + """Name of the permission group.""" + + +class PolicyResourceGroupScopeObject(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Zone ID + etc.) + """ + + +class PolicyResourceGroupScope(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Account + ID etc.) + """ + + objects: List[PolicyResourceGroupScopeObject] + """A list of scope objects for additional context.""" + + +class PolicyResourceGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyResourceGroup(BaseModel): + id: str + """Identifier of the resource group.""" + + scope: List[PolicyResourceGroupScope] + """The scope associated to the resource group""" + + meta: Optional[PolicyResourceGroupMeta] = None + """Attributes associated to the resource group.""" + + name: Optional[str] = None + """Name of the resource group.""" + + +class Policy(BaseModel): + id: Optional[str] = None + """Policy identifier.""" + + access: Optional[Literal["allow", "deny"]] = None + """Allow or deny operations against the resources.""" + + permission_groups: Optional[List[PolicyPermissionGroup]] = None + """A set of permission groups that are specified to the policy.""" + + resource_groups: Optional[List[PolicyResourceGroup]] = None + """A list of resource groups that the policy applies to.""" + + +class UserGroupGetResponse(BaseModel): + id: str + """User Group identifier tag.""" + + created_on: datetime + """Timestamp for the creation of the user group""" + + modified_on: datetime + """Last time the user group was modified.""" + + name: str + """Name of the user group.""" + + policies: Optional[List[Policy]] = None + """Policies attached to the User group""" diff --git a/src/cloudflare/types/iam/user_group_list_params.py b/src/cloudflare/types/iam/user_group_list_params.py new file mode 100644 index 00000000000..8280bb6c3e0 --- /dev/null +++ b/src/cloudflare/types/iam/user_group_list_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["UserGroupListParams"] + + +class UserGroupListParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + id: str + """ID of the user group to be fetched.""" + + direction: str + """The sort order of returned user groups by name. + + Default sort order is ascending. To switch to descending, set this parameter to + "desc" + """ + + fuzzy_name: Annotated[str, PropertyInfo(alias="fuzzyName")] + """A string used for searching for user groups containing that substring.""" + + name: str + """Name of the user group to be fetched.""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Maximum number of results per page.""" diff --git a/src/cloudflare/types/iam/user_group_list_response.py b/src/cloudflare/types/iam/user_group_list_response.py new file mode 100644 index 00000000000..c62f7c1f1fe --- /dev/null +++ b/src/cloudflare/types/iam/user_group_list_response.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = [ + "UserGroupListResponse", + "Policy", + "PolicyPermissionGroup", + "PolicyPermissionGroupMeta", + "PolicyResourceGroup", + "PolicyResourceGroupScope", + "PolicyResourceGroupScopeObject", + "PolicyResourceGroupMeta", +] + + +class PolicyPermissionGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyPermissionGroup(BaseModel): + id: str + """Identifier of the permission group.""" + + meta: Optional[PolicyPermissionGroupMeta] = None + """Attributes associated to the permission group.""" + + name: Optional[str] = None + """Name of the permission group.""" + + +class PolicyResourceGroupScopeObject(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Zone ID + etc.) + """ + + +class PolicyResourceGroupScope(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Account + ID etc.) + """ + + objects: List[PolicyResourceGroupScopeObject] + """A list of scope objects for additional context.""" + + +class PolicyResourceGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyResourceGroup(BaseModel): + id: str + """Identifier of the resource group.""" + + scope: List[PolicyResourceGroupScope] + """The scope associated to the resource group""" + + meta: Optional[PolicyResourceGroupMeta] = None + """Attributes associated to the resource group.""" + + name: Optional[str] = None + """Name of the resource group.""" + + +class Policy(BaseModel): + id: Optional[str] = None + """Policy identifier.""" + + access: Optional[Literal["allow", "deny"]] = None + """Allow or deny operations against the resources.""" + + permission_groups: Optional[List[PolicyPermissionGroup]] = None + """A set of permission groups that are specified to the policy.""" + + resource_groups: Optional[List[PolicyResourceGroup]] = None + """A list of resource groups that the policy applies to.""" + + +class UserGroupListResponse(BaseModel): + id: str + """User Group identifier tag.""" + + created_on: datetime + """Timestamp for the creation of the user group""" + + modified_on: datetime + """Last time the user group was modified.""" + + name: str + """Name of the user group.""" + + policies: Optional[List[Policy]] = None + """Policies attached to the User group""" diff --git a/src/cloudflare/types/iam/user_group_update_params.py b/src/cloudflare/types/iam/user_group_update_params.py new file mode 100644 index 00000000000..487bfd04617 --- /dev/null +++ b/src/cloudflare/types/iam/user_group_update_params.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["UserGroupUpdateParams", "Policy", "PolicyPermissionGroup", "PolicyResourceGroup"] + + +class UserGroupUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + name: str + """Name of the User group.""" + + policies: Iterable[Policy] + """Policies attached to the User group""" + + +class PolicyPermissionGroup(TypedDict, total=False): + id: Required[str] + """Permission Group identifier tag.""" + + +class PolicyResourceGroup(TypedDict, total=False): + id: Required[str] + """Resource Group identifier tag.""" + + +class Policy(TypedDict, total=False): + id: Required[str] + """Policy identifier.""" + + access: Required[Literal["allow", "deny"]] + """Allow or deny operations against the resources.""" + + permission_groups: Required[Iterable[PolicyPermissionGroup]] + """A set of permission groups that are specified to the policy.""" + + resource_groups: Required[Iterable[PolicyResourceGroup]] + """A set of resource groups that are specified to the policy.""" diff --git a/src/cloudflare/types/iam/user_group_update_response.py b/src/cloudflare/types/iam/user_group_update_response.py new file mode 100644 index 00000000000..7661e267340 --- /dev/null +++ b/src/cloudflare/types/iam/user_group_update_response.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = [ + "UserGroupUpdateResponse", + "Policy", + "PolicyPermissionGroup", + "PolicyPermissionGroupMeta", + "PolicyResourceGroup", + "PolicyResourceGroupScope", + "PolicyResourceGroupScopeObject", + "PolicyResourceGroupMeta", +] + + +class PolicyPermissionGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyPermissionGroup(BaseModel): + id: str + """Identifier of the permission group.""" + + meta: Optional[PolicyPermissionGroupMeta] = None + """Attributes associated to the permission group.""" + + name: Optional[str] = None + """Name of the permission group.""" + + +class PolicyResourceGroupScopeObject(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Zone ID + etc.) + """ + + +class PolicyResourceGroupScope(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Account + ID etc.) + """ + + objects: List[PolicyResourceGroupScopeObject] + """A list of scope objects for additional context.""" + + +class PolicyResourceGroupMeta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PolicyResourceGroup(BaseModel): + id: str + """Identifier of the resource group.""" + + scope: List[PolicyResourceGroupScope] + """The scope associated to the resource group""" + + meta: Optional[PolicyResourceGroupMeta] = None + """Attributes associated to the resource group.""" + + name: Optional[str] = None + """Name of the resource group.""" + + +class Policy(BaseModel): + id: Optional[str] = None + """Policy identifier.""" + + access: Optional[Literal["allow", "deny"]] = None + """Allow or deny operations against the resources.""" + + permission_groups: Optional[List[PolicyPermissionGroup]] = None + """A set of permission groups that are specified to the policy.""" + + resource_groups: Optional[List[PolicyResourceGroup]] = None + """A list of resource groups that the policy applies to.""" + + +class UserGroupUpdateResponse(BaseModel): + id: str + """User Group identifier tag.""" + + created_on: datetime + """Timestamp for the creation of the user group""" + + modified_on: datetime + """Last time the user group was modified.""" + + name: str + """Name of the user group.""" + + policies: Optional[List[Policy]] = None + """Policies attached to the User group""" diff --git a/src/cloudflare/types/iam/user_groups/__init__.py b/src/cloudflare/types/iam/user_groups/__init__.py new file mode 100644 index 00000000000..61081ac868f --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/__init__.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .member_list_params import MemberListParams as MemberListParams +from .member_create_params import MemberCreateParams as MemberCreateParams +from .member_list_response import MemberListResponse as MemberListResponse +from .member_update_params import MemberUpdateParams as MemberUpdateParams +from .member_create_response import MemberCreateResponse as MemberCreateResponse +from .member_delete_response import MemberDeleteResponse as MemberDeleteResponse +from .member_update_response import MemberUpdateResponse as MemberUpdateResponse diff --git a/src/cloudflare/types/iam/user_groups/member_create_params.py b/src/cloudflare/types/iam/user_groups/member_create_params.py new file mode 100644 index 00000000000..e1cfe45ece1 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_create_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["MemberCreateParams", "Body"] + + +class MemberCreateParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + body: Required[Iterable[Body]] + + +class Body(TypedDict, total=False): + id: Required[str] + """The identifier of an existing account Member.""" diff --git a/src/cloudflare/types/iam/user_groups/member_create_response.py b/src/cloudflare/types/iam/user_groups/member_create_response.py new file mode 100644 index 00000000000..fc847130f39 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_create_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MemberCreateResponse"] + + +class MemberCreateResponse(BaseModel): + id: str + """Account member identifier.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + status: Optional[Literal["accepted", "pending"]] = None + """The member's status in the account.""" diff --git a/src/cloudflare/types/iam/user_groups/member_delete_response.py b/src/cloudflare/types/iam/user_groups/member_delete_response.py new file mode 100644 index 00000000000..df901494d09 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_delete_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MemberDeleteResponse"] + + +class MemberDeleteResponse(BaseModel): + id: str + """Account member identifier.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + status: Optional[Literal["accepted", "pending"]] = None + """The member's status in the account.""" diff --git a/src/cloudflare/types/iam/user_groups/member_list_params.py b/src/cloudflare/types/iam/user_groups/member_list_params.py new file mode 100644 index 00000000000..49532964553 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_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__ = ["MemberListParams"] + + +class MemberListParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Maximum number of results per page.""" diff --git a/src/cloudflare/types/iam/user_groups/member_list_response.py b/src/cloudflare/types/iam/user_groups/member_list_response.py new file mode 100644 index 00000000000..0eb4b96bd6d --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_list_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MemberListResponse"] + + +class MemberListResponse(BaseModel): + id: str + """Account member identifier.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + status: Optional[Literal["accepted", "pending"]] = None + """The member's status in the account.""" diff --git a/src/cloudflare/types/iam/user_groups/member_update_params.py b/src/cloudflare/types/iam/user_groups/member_update_params.py new file mode 100644 index 00000000000..49c0ea06569 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_update_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 import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["MemberUpdateParams", "Body"] + + +class MemberUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + body: Required[Iterable[Body]] + """Set/Replace members to a user group.""" + + +class Body(TypedDict, total=False): + id: Required[str] + """The identifier of an existing account Member.""" diff --git a/src/cloudflare/types/iam/user_groups/member_update_response.py b/src/cloudflare/types/iam/user_groups/member_update_response.py new file mode 100644 index 00000000000..78f1da68c44 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_update_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MemberUpdateResponse"] + + +class MemberUpdateResponse(BaseModel): + id: str + """Account member identifier.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + status: Optional[Literal["accepted", "pending"]] = None + """The member's status in the account.""" diff --git a/src/cloudflare/types/ips/__init__.py b/src/cloudflare/types/ips/__init__.py index 4b563930dab..785aaadcdb2 100644 --- a/src/cloudflare/types/ips/__init__.py +++ b/src/cloudflare/types/ips/__init__.py @@ -3,6 +3,5 @@ from __future__ import annotations from .ips import IPs as IPs -from .jdcloud_ips import JDCloudIPs as JDCloudIPs from .ip_list_params import IPListParams as IPListParams from .ip_list_response import IPListResponse as IPListResponse diff --git a/src/cloudflare/types/ips/ip_list_response.py b/src/cloudflare/types/ips/ip_list_response.py index 8c2d9ad59d8..cb8d088bdd7 100644 --- a/src/cloudflare/types/ips/ip_list_response.py +++ b/src/cloudflare/types/ips/ip_list_response.py @@ -1,11 +1,36 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import List, Union, Optional from typing_extensions import TypeAlias -from .ips import IPs -from .jdcloud_ips import JDCloudIPs +from ..._models import BaseModel -__all__ = ["IPListResponse"] +__all__ = ["IPListResponse", "PublicIPIPs", "PublicIPIPsJDCloud"] -IPListResponse: TypeAlias = Union[IPs, JDCloudIPs] + +class PublicIPIPs(BaseModel): + etag: Optional[str] = None + """A digest of the IP data. Useful for determining if the data has changed.""" + + ipv4_cidrs: Optional[List[str]] = None + """List of Cloudflare IPv4 CIDR addresses.""" + + ipv6_cidrs: Optional[List[str]] = None + """List of Cloudflare IPv6 CIDR addresses.""" + + +class PublicIPIPsJDCloud(BaseModel): + etag: Optional[str] = None + """A digest of the IP data. Useful for determining if the data has changed.""" + + ipv4_cidrs: Optional[List[str]] = None + """List of Cloudflare IPv4 CIDR addresses.""" + + ipv6_cidrs: Optional[List[str]] = None + """List of Cloudflare IPv6 CIDR addresses.""" + + jdcloud_cidrs: Optional[List[str]] = None + """List IPv4 and IPv6 CIDRs, only populated if `?networks=jdcloud` is used.""" + + +IPListResponse: TypeAlias = Union[PublicIPIPs, PublicIPIPsJDCloud] diff --git a/src/cloudflare/types/ips/ips.py b/src/cloudflare/types/ips/ips.py index 176e4c0db8a..ec535d669a4 100644 --- a/src/cloudflare/types/ips/ips.py +++ b/src/cloudflare/types/ips/ips.py @@ -1,18 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime +from typing_extensions import TypeAlias from ..._models import BaseModel -__all__ = ["IPs"] +__all__ = ["IPs", "IPItem"] -class IPs(BaseModel): - etag: Optional[str] = None - """A digest of the IP data. Useful for determining if the data has changed.""" +class IPItem(BaseModel): + created_at: Optional[datetime] = None - ipv4_cidrs: Optional[List[str]] = None - """List of Cloudflare IPv4 CIDR addresses.""" + ip: Optional[str] = None + """An IPv4 or IPv6 address.""" - ipv6_cidrs: Optional[List[str]] = None - """List of Cloudflare IPv6 CIDR addresses.""" + +IPs: TypeAlias = List[IPItem] diff --git a/src/cloudflare/types/ips/jdcloud_ips.py b/src/cloudflare/types/ips/jdcloud_ips.py deleted file mode 100644 index d09b6d10a60..00000000000 --- a/src/cloudflare/types/ips/jdcloud_ips.py +++ /dev/null @@ -1,21 +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__ = ["JDCloudIPs"] - - -class JDCloudIPs(BaseModel): - etag: Optional[str] = None - """A digest of the IP data. Useful for determining if the data has changed.""" - - ipv4_cidrs: Optional[List[str]] = None - """List of Cloudflare IPv4 CIDR addresses.""" - - ipv6_cidrs: Optional[List[str]] = None - """List of Cloudflare IPv6 CIDR addresses.""" - - jdcloud_cidrs: Optional[List[str]] = None - """List IPv4 and IPv6 CIDRs, only populated if `?networks=jdcloud` is used.""" diff --git a/src/cloudflare/types/kv/__init__.py b/src/cloudflare/types/kv/__init__.py index bf707c56e66..512003710f4 100644 --- a/src/cloudflare/types/kv/__init__.py +++ b/src/cloudflare/types/kv/__init__.py @@ -6,4 +6,10 @@ from .namespace_list_params import NamespaceListParams as NamespaceListParams from .namespace_create_params import NamespaceCreateParams as NamespaceCreateParams from .namespace_update_params import NamespaceUpdateParams as NamespaceUpdateParams +from .namespace_bulk_get_params import NamespaceBulkGetParams as NamespaceBulkGetParams from .namespace_delete_response import NamespaceDeleteResponse as NamespaceDeleteResponse +from .namespace_bulk_get_response import NamespaceBulkGetResponse as NamespaceBulkGetResponse +from .namespace_bulk_delete_params import NamespaceBulkDeleteParams as NamespaceBulkDeleteParams +from .namespace_bulk_update_params import NamespaceBulkUpdateParams as NamespaceBulkUpdateParams +from .namespace_bulk_delete_response import NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse +from .namespace_bulk_update_response import NamespaceBulkUpdateResponse as NamespaceBulkUpdateResponse diff --git a/src/cloudflare/types/kv/namespace_bulk_delete_params.py b/src/cloudflare/types/kv/namespace_bulk_delete_params.py new file mode 100644 index 00000000000..1de9c109a16 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_bulk_delete_params.py @@ -0,0 +1,15 @@ +# 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 Required, TypedDict + +__all__ = ["NamespaceBulkDeleteParams"] + + +class NamespaceBulkDeleteParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + body: Required[List[str]] diff --git a/src/cloudflare/types/kv/namespace_bulk_delete_response.py b/src/cloudflare/types/kv/namespace_bulk_delete_response.py new file mode 100644 index 00000000000..5cf86953b96 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_bulk_delete_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["NamespaceBulkDeleteResponse"] + + +class NamespaceBulkDeleteResponse(BaseModel): + successful_key_count: Optional[float] = None + """Number of keys successfully updated""" + + unsuccessful_keys: Optional[List[str]] = None + """Name of the keys that failed to be fully updated. They should be retried.""" diff --git a/src/cloudflare/types/kv/namespace_bulk_get_params.py b/src/cloudflare/types/kv/namespace_bulk_get_params.py new file mode 100644 index 00000000000..9f49de2a982 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_bulk_get_params.py @@ -0,0 +1,24 @@ +# 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, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["NamespaceBulkGetParams"] + + +class NamespaceBulkGetParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + keys: Required[List[str]] + """Array of keys to retrieve (maximum 100)""" + + type: Literal["text", "json"] + """Whether to parse JSON values in the response""" + + with_metadata: Annotated[bool, PropertyInfo(alias="withMetadata")] + """Whether to include metadata in the response""" diff --git a/src/cloudflare/types/kv/namespace_bulk_get_response.py b/src/cloudflare/types/kv/namespace_bulk_get_response.py new file mode 100644 index 00000000000..8a590e1caa2 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_bulk_get_response.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "NamespaceBulkGetResponse", + "WorkersKVBulkGetResult", + "WorkersKVBulkGetResultWithMetadata", + "WorkersKVBulkGetResultWithMetadataValues", +] + + +class WorkersKVBulkGetResult(BaseModel): + values: Optional[Dict[str, Union[str, float, bool, Dict[str, object]]]] = None + """Requested keys are paired with their values in an object""" + + +class WorkersKVBulkGetResultWithMetadataValues(BaseModel): + metadata: Optional[Dict[str, object]] = None + """The metadata associated with the key""" + + value: Union[str, float, bool, Dict[str, object]] + """The value associated with the key""" + + expiration: Optional[float] = None + """ + The time, measured in number of seconds since the UNIX epoch, at which the key + should expire. + """ + + +class WorkersKVBulkGetResultWithMetadata(BaseModel): + values: Optional[Dict[str, Optional[WorkersKVBulkGetResultWithMetadataValues]]] = None + """Requested keys are paired with their values and metadata in an object""" + + +NamespaceBulkGetResponse: TypeAlias = Union[WorkersKVBulkGetResult, WorkersKVBulkGetResultWithMetadata, None] diff --git a/src/cloudflare/types/kv/namespace_bulk_update_params.py b/src/cloudflare/types/kv/namespace_bulk_update_params.py new file mode 100644 index 00000000000..e1ce68a86b6 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_bulk_update_params.py @@ -0,0 +1,49 @@ +# 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__ = ["NamespaceBulkUpdateParams", "Body"] + + +class NamespaceBulkUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + body: Required[Iterable[Body]] + + +class Body(TypedDict, total=False): + base64: bool + """Whether or not the server should base64 decode the value before storing it. + + Useful for writing values that wouldn't otherwise be valid JSON strings, such as + images. + """ + + expiration: float + """ + The time, measured in number of seconds since the UNIX epoch, at which the key + should expire. + """ + + expiration_ttl: float + """The number of seconds for which the key should be visible before it expires. + + At least 60. + """ + + key: str + """A key's name. + + The name may be at most 512 bytes. All printable, non-whitespace characters are + valid. + """ + + metadata: Dict[str, object] + """Arbitrary JSON that is associated with a key.""" + + value: str + """A UTF-8 encoded string to be stored, up to 25 MiB in length.""" diff --git a/src/cloudflare/types/kv/namespace_bulk_update_response.py b/src/cloudflare/types/kv/namespace_bulk_update_response.py new file mode 100644 index 00000000000..6076c1444f5 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_bulk_update_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["NamespaceBulkUpdateResponse"] + + +class NamespaceBulkUpdateResponse(BaseModel): + successful_key_count: Optional[float] = None + """Number of keys successfully updated""" + + unsuccessful_keys: Optional[List[str]] = None + """Name of the keys that failed to be fully updated. They should be retried.""" diff --git a/src/cloudflare/types/load_balancers/search_list_params.py b/src/cloudflare/types/load_balancers/search_list_params.py index 38396bdf885..36979b8ef59 100644 --- a/src/cloudflare/types/load_balancers/search_list_params.py +++ b/src/cloudflare/types/load_balancers/search_list_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["SearchListParams", "SearchParams"] +__all__ = ["SearchListParams"] class SearchListParams(TypedDict, total=False): @@ -15,12 +15,12 @@ class SearchListParams(TypedDict, total=False): per_page: float - search_params: SearchParams - - -class SearchParams(TypedDict, total=False): query: str """Search query term.""" references: Literal["", "*", "referral", "referrer"] - """The type of references to include ("\\**" for all).""" + """The type of references to include. + + "\\**" to include both referral and referrer references. "" to not include any + reference information. + """ diff --git a/src/cloudflare/types/logs/control/cmb/cmb_config.py b/src/cloudflare/types/logs/control/cmb/cmb_config.py index e0eb13ba603..c6f1a2d64cd 100644 --- a/src/cloudflare/types/logs/control/cmb/cmb_config.py +++ b/src/cloudflare/types/logs/control/cmb/cmb_config.py @@ -8,5 +8,8 @@ class CmbConfig(BaseModel): + allow_out_of_region_access: Optional[bool] = None + """Allow out of region access""" + regions: Optional[str] = None """Name of the region.""" diff --git a/src/cloudflare/types/logs/control/cmb/config_create_params.py b/src/cloudflare/types/logs/control/cmb/config_create_params.py index 6e1e53efb84..4fb77a53222 100644 --- a/src/cloudflare/types/logs/control/cmb/config_create_params.py +++ b/src/cloudflare/types/logs/control/cmb/config_create_params.py @@ -11,5 +11,8 @@ class ConfigCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier.""" + allow_out_of_region_access: bool + """Allow out of region access""" + regions: str """Name of the region.""" diff --git a/src/cloudflare/types/magic_transit/connector_edit_params.py b/src/cloudflare/types/magic_transit/connector_edit_params.py index 8fb54e30c3e..da638c4e8a3 100644 --- a/src/cloudflare/types/magic_transit/connector_edit_params.py +++ b/src/cloudflare/types/magic_transit/connector_edit_params.py @@ -9,6 +9,7 @@ class ConnectorEditParams(TypedDict, total=False): account_id: Required[str] + """Account identifier""" activated: bool diff --git a/src/cloudflare/types/magic_transit/connector_update_params.py b/src/cloudflare/types/magic_transit/connector_update_params.py index 7561ebbfcaf..bce1d58116e 100644 --- a/src/cloudflare/types/magic_transit/connector_update_params.py +++ b/src/cloudflare/types/magic_transit/connector_update_params.py @@ -9,6 +9,7 @@ class ConnectorUpdateParams(TypedDict, total=False): account_id: Required[str] + """Account identifier""" activated: bool diff --git a/src/cloudflare/types/magic_transit/connectors/event_list_params.py b/src/cloudflare/types/magic_transit/connectors/event_list_params.py index 68aa2be867c..7ffc819ab42 100644 --- a/src/cloudflare/types/magic_transit/connectors/event_list_params.py +++ b/src/cloudflare/types/magic_transit/connectors/event_list_params.py @@ -10,7 +10,8 @@ class EventListParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] + """Account identifier""" from_: Required[Annotated[float, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py b/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py index 89b4547c722..b2c9a69b3a6 100644 --- a/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py +++ b/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py @@ -10,7 +10,8 @@ class SnapshotListParams(TypedDict, total=False): - account_id: Required[float] + account_id: Required[str] + """Account identifier""" from_: Required[Annotated[float, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/memberships/membership_get_response.py b/src/cloudflare/types/memberships/membership_get_response.py index 524eaa1ead9..fdc4fa36b57 100644 --- a/src/cloudflare/types/memberships/membership_get_response.py +++ b/src/cloudflare/types/memberships/membership_get_response.py @@ -54,13 +54,13 @@ class PolicyPermissionGroupMeta(BaseModel): class PolicyPermissionGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the permission group.""" meta: Optional[PolicyPermissionGroupMeta] = None """Attributes associated to the permission group.""" name: Optional[str] = None - """Name of the group.""" + """Name of the permission group.""" class PolicyResourceGroupScopeObject(BaseModel): @@ -90,7 +90,7 @@ class PolicyResourceGroupMeta(BaseModel): class PolicyResourceGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the resource group.""" scope: List[PolicyResourceGroupScope] """The scope associated to the resource group""" diff --git a/src/cloudflare/types/memberships/membership_update_response.py b/src/cloudflare/types/memberships/membership_update_response.py index 7f6b238103c..c8981529d85 100644 --- a/src/cloudflare/types/memberships/membership_update_response.py +++ b/src/cloudflare/types/memberships/membership_update_response.py @@ -54,13 +54,13 @@ class PolicyPermissionGroupMeta(BaseModel): class PolicyPermissionGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the permission group.""" meta: Optional[PolicyPermissionGroupMeta] = None """Attributes associated to the permission group.""" name: Optional[str] = None - """Name of the group.""" + """Name of the permission group.""" class PolicyResourceGroupScopeObject(BaseModel): @@ -90,7 +90,7 @@ class PolicyResourceGroupMeta(BaseModel): class PolicyResourceGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the resource group.""" scope: List[PolicyResourceGroupScope] """The scope associated to the resource group""" diff --git a/src/cloudflare/types/network_interconnects/cni_list_params.py b/src/cloudflare/types/network_interconnects/cni_list_params.py index 9f1efabf277..105f62d5031 100644 --- a/src/cloudflare/types/network_interconnects/cni_list_params.py +++ b/src/cloudflare/types/network_interconnects/cni_list_params.py @@ -18,3 +18,6 @@ class CNIListParams(TypedDict, total=False): slot: Optional[str] """If specified, only show CNIs associated with the specified slot""" + + tunnel_id: Optional[str] + """If specified, only show cnis associated with the specified tunnel id""" diff --git a/src/cloudflare/types/queues/message_pull_response.py b/src/cloudflare/types/queues/message_pull_response.py index bbbed2be267..529a7132788 100644 --- a/src/cloudflare/types/queues/message_pull_response.py +++ b/src/cloudflare/types/queues/message_pull_response.py @@ -1,13 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from ..._models import BaseModel -__all__ = ["MessagePullResponse"] +__all__ = ["MessagePullResponse", "Message"] -class MessagePullResponse(BaseModel): +class Message(BaseModel): id: Optional[str] = None attempts: Optional[float] = None @@ -23,3 +23,10 @@ class MessagePullResponse(BaseModel): metadata: Optional[object] = None timestamp_ms: Optional[float] = None + + +class MessagePullResponse(BaseModel): + message_backlog_count: Optional[float] = None + """The number of unacknowledged messages in the queue""" + + messages: Optional[List[Message]] = None diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py index d47ce220214..109a493fd38 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryUserAgentResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryUserAgentResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryUserAgentResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/ai/inference/summary_model_response.py b/src/cloudflare/types/radar/ai/inference/summary_model_response.py index 7aa2499b888..16b300edfda 100644 --- a/src/cloudflare/types/radar/ai/inference/summary_model_response.py +++ b/src/cloudflare/types/radar/ai/inference/summary_model_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryModelResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryModelResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryModelResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/ai/inference/summary_task_response.py b/src/cloudflare/types/radar/ai/inference/summary_task_response.py index c8b34b40a03..d4dd193c2a0 100644 --- a/src/cloudflare/types/radar/ai/inference/summary_task_response.py +++ b/src/cloudflare/types/radar/ai/inference/summary_task_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryTaskResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryTaskResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryTaskResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py index 8dc1979f7db..c9af7e04f58 100644 --- a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ......_models import BaseModel -__all__ = ["SummaryModelResponse", "Serie0"] +__all__ = [ + "SummaryModelResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class SummaryModelResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py index 0d8ef99e7c8..f45dc1088fe 100644 --- a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ......_models import BaseModel -__all__ = ["SummaryTaskResponse", "Serie0"] +__all__ = [ + "SummaryTaskResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class SummaryTaskResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py b/src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py index e84aab4ab60..a50abb619b3 100644 --- a/src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py +++ b/src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupUserAgentResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupUserAgentResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupUserAgentResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/annotations/outage_get_response.py b/src/cloudflare/types/radar/annotations/outage_get_response.py index a849b72fd21..19edf9ea02b 100644 --- a/src/cloudflare/types/radar/annotations/outage_get_response.py +++ b/src/cloudflare/types/radar/annotations/outage_get_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime from pydantic import Field as FieldInfo @@ -59,11 +60,11 @@ class Annotation(BaseModel): outage: AnnotationOutage - start_date: str = FieldInfo(alias="startDate") + start_date: datetime = FieldInfo(alias="startDate") description: Optional[str] = None - end_date: Optional[str] = FieldInfo(alias="endDate", default=None) + end_date: Optional[datetime] = FieldInfo(alias="endDate", default=None) linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) diff --git a/src/cloudflare/types/radar/annotations/outage_locations_response.py b/src/cloudflare/types/radar/annotations/outage_locations_response.py index b175087e150..b01d0f0a089 100644 --- a/src/cloudflare/types/radar/annotations/outage_locations_response.py +++ b/src/cloudflare/types/radar/annotations/outage_locations_response.py @@ -15,6 +15,7 @@ class Annotation(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class OutageLocationsResponse(BaseModel): diff --git a/src/cloudflare/types/radar/as112/summary_dnssec_response.py b/src/cloudflare/types/radar/as112/summary_dnssec_response.py index b692d28f07f..5d904b19e2f 100644 --- a/src/cloudflare/types/radar/as112/summary_dnssec_response.py +++ b/src/cloudflare/types/radar/as112/summary_dnssec_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryDNSSECResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): not_supported: str = FieldInfo(alias="NOT_SUPPORTED") + """A numeric string.""" supported: str = FieldInfo(alias="SUPPORTED") + """A numeric string.""" class SummaryDNSSECResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/as112/summary_edns_response.py b/src/cloudflare/types/radar/as112/summary_edns_response.py index 48ca7517798..a288f6df83b 100644 --- a/src/cloudflare/types/radar/as112/summary_edns_response.py +++ b/src/cloudflare/types/radar/as112/summary_edns_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryEdnsResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): not_supported: str = FieldInfo(alias="NOT_SUPPORTED") + """A numeric string.""" supported: str = FieldInfo(alias="SUPPORTED") + """A numeric string.""" class SummaryEdnsResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/as112/summary_ip_version_response.py b/src/cloudflare/types/radar/as112/summary_ip_version_response.py index 6286c80dc1d..5ade97ddc23 100644 --- a/src/cloudflare/types/radar/as112/summary_ip_version_response.py +++ b/src/cloudflare/types/radar/as112/summary_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): i_pv4: str = FieldInfo(alias="IPv4") + """A numeric string.""" i_pv6: str = FieldInfo(alias="IPv6") + """A numeric string.""" class SummaryIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/as112/summary_protocol_response.py b/src/cloudflare/types/radar/as112/summary_protocol_response.py index b75c6a52eb9..da6b44a7151 100644 --- a/src/cloudflare/types/radar/as112/summary_protocol_response.py +++ b/src/cloudflare/types/radar/as112/summary_protocol_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,64 +11,96 @@ __all__ = [ "SummaryProtocolResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): https: str = FieldInfo(alias="HTTPS") + """A numeric string.""" tcp: str = FieldInfo(alias="TCP") + """A numeric string.""" tls: str = FieldInfo(alias="TLS") + """A numeric string.""" udp: str = FieldInfo(alias="UDP") + """A numeric string.""" class SummaryProtocolResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/as112/summary_query_type_response.py b/src/cloudflare/types/radar/as112/summary_query_type_response.py index 87baa9cd63b..b1515b5fada 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_response.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["SummaryQueryTypeResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryQueryTypeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryQueryTypeResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_response.py b/src/cloudflare/types/radar/as112/summary_response_codes_response.py index f4e19fe4238..60887a68417 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_response.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_response.py @@ -2,6 +2,7 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,53 +11,81 @@ __all__ = [ "SummaryResponseCodesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryResponseCodesResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/as112/timeseries_group_dnssec_response.py b/src/cloudflare/types/radar/as112/timeseries_group_dnssec_response.py index dc3bd4beb57..4b5481376c5 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_dnssec_response.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_dnssec_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupDNSSECResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupDNSSECResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupDNSSECResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/as112/timeseries_group_edns_response.py b/src/cloudflare/types/radar/as112/timeseries_group_edns_response.py index b40d292d6b3..d5a7bdea5c0 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_edns_response.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_edns_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupEdnsResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupEdnsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupEdnsResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/as112/timeseries_group_ip_version_response.py b/src/cloudflare/types/radar/as112/timeseries_group_ip_version_response.py index 4e9128d1c2f..790d4de556d 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_ip_version_response.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_ip_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupIPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupIPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/as112/timeseries_group_protocol_response.py b/src/cloudflare/types/radar/as112/timeseries_group_protocol_response.py index 85baee000f5..9b24b34429b 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_protocol_response.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_protocol_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupProtocolResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupProtocolResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -20,6 +105,7 @@ class Serie0(BaseModel): class TimeseriesGroupProtocolResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/as112/timeseries_group_query_type_response.py b/src/cloudflare/types/radar/as112/timeseries_group_query_type_response.py index b63a9d54cbb..4240248af6a 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_query_type_response.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_query_type_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupQueryTypeResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupQueryTypeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupQueryTypeResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_response.py b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_response.py index 4b8af3b157c..9f8245b2ed6 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_response.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupResponseCodesResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupResponseCodesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupResponseCodesResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/as112/top_dnssec_response.py b/src/cloudflare/types/radar/as112/top_dnssec_response.py index a911d0d50b3..fdf76e05b18 100644 --- a/src/cloudflare/types/radar/as112/top_dnssec_response.py +++ b/src/cloudflare/types/radar/as112/top_dnssec_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopDNSSECResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopDNSSECResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TopDNSSECResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/as112/top_edns_response.py b/src/cloudflare/types/radar/as112/top_edns_response.py index 208c881c579..1c6dd05eae6 100644 --- a/src/cloudflare/types/radar/as112/top_edns_response.py +++ b/src/cloudflare/types/radar/as112/top_edns_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopEdnsResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopEdnsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TopEdnsResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/as112/top_ip_version_response.py b/src/cloudflare/types/radar/as112/top_ip_version_response.py index 3b48dfa0ca0..35ab763a487 100644 --- a/src/cloudflare/types/radar/as112/top_ip_version_response.py +++ b/src/cloudflare/types/radar/as112/top_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "TopIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TopIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/as112/top_locations_response.py b/src/cloudflare/types/radar/as112/top_locations_response.py index 671c3284576..be6919353f1 100644 --- a/src/cloudflare/types/radar/as112/top_locations_response.py +++ b/src/cloudflare/types/radar/as112/top_locations_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "TopLocationsResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TopLocationsResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/as112_timeseries_response.py b/src/cloudflare/types/radar/as112_timeseries_response.py index 3664bedad75..ed23b66b45f 100644 --- a/src/cloudflare/types/radar/as112_timeseries_response.py +++ b/src/cloudflare/types/radar/as112_timeseries_response.py @@ -1,69 +1,105 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from .as112_timeseries_response import UnnamedTypeWithobjectParent1UnnamedTypeWithobjectParent1Item __all__ = [ "AS112TimeseriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", - "Serie0", + "MetaDateRange", + "MetaUnit", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. -class Serie0(BaseModel): - timestamps: List[datetime] + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - values: List[str] + units: List[MetaUnit] + """Measurement units for the results.""" class AS112TimeseriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" - serie_0: Serie0 + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> UnnamedTypeWithobjectParent1UnnamedTypeWithobjectParent1Item: ... diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_response.py index b04e158c215..2fe19bba6fb 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,66 +11,99 @@ __all__ = [ "SummaryBitrateResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): one_gbps_to_ten_gbps: str = FieldInfo(alias="_1_GBPS_TO_10_GBPS") + """A numeric string.""" ten_gbps_to_one_hundred_gbps: str = FieldInfo(alias="_10_GBPS_TO_100_GBPS") + """A numeric string.""" five_hundred_mbps_to_one_gbps: str = FieldInfo(alias="_500_MBPS_TO_1_GBPS") + """A numeric string.""" over_100_gbps: str = FieldInfo(alias="OVER_100_GBPS") + """A numeric string.""" under_500_mbps: str = FieldInfo(alias="UNDER_500_MBPS") + """A numeric string.""" class SummaryBitrateResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_duration_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_duration_response.py index a08fb88a43b..de757ec4676 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_duration_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_duration_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,68 +11,102 @@ __all__ = [ "SummaryDurationResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): one_hour_to_three_hours: str = FieldInfo(alias="_1_HOUR_TO_3_HOURS") + """A numeric string.""" ten_mins_to_twenty_mins: str = FieldInfo(alias="_10_MINS_TO_20_MINS") + """A numeric string.""" twenty_mins_to_forty_mins: str = FieldInfo(alias="_20_MINS_TO_40_MINS") + """A numeric string.""" forty_mins_to_one_hour: str = FieldInfo(alias="_40_MINS_TO_1_HOUR") + """A numeric string.""" over_3_hours: str = FieldInfo(alias="OVER_3_HOURS") + """A numeric string.""" under_10_mins: str = FieldInfo(alias="UNDER_10_MINS") + """A numeric string.""" class SummaryDurationResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_industry_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_industry_response.py index de252763039..a33a0aec474 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_industry_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryIndustryResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryIndustryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryIndustryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_response.py index e1a3995c7e5..b121482480f 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): i_pv4: str = FieldInfo(alias="IPv4") + """A numeric string.""" i_pv6: str = FieldInfo(alias="IPv6") + """A numeric string.""" class SummaryIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_protocol_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_protocol_response.py index 7d749df3a2a..db6dad30a05 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_protocol_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_protocol_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,64 +11,96 @@ __all__ = [ "SummaryProtocolResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): gre: str = FieldInfo(alias="GRE") + """A numeric string.""" icmp: str = FieldInfo(alias="ICMP") + """A numeric string.""" tcp: str = FieldInfo(alias="TCP") + """A numeric string.""" udp: str = FieldInfo(alias="UDP") + """A numeric string.""" class SummaryProtocolResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py index 7dd4becaf4b..bd97d43964d 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryVectorResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryVectorResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryVectorResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vertical_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_vertical_response.py index d2cdd169f86..a5e0a1fde39 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vertical_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryVerticalResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryVerticalResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryVerticalResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_response.py index 0e8f9525a54..5119edf7a84 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupBitrateResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupBitrateResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -18,12 +103,13 @@ class Serie0(BaseModel): over_100_gbps: List[str] = FieldInfo(alias="OVER_100_GBPS") - timestamps: List[str] + timestamps: List[datetime] under_500_mbps: List[str] = FieldInfo(alias="UNDER_500_MBPS") class TimeseriesGroupBitrateResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_response.py index 21149a347e9..7ccefac9068 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupDurationResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupDurationResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -20,12 +105,13 @@ class Serie0(BaseModel): over_3_hours: List[str] = FieldInfo(alias="OVER_3_HOURS") - timestamps: List[str] + timestamps: List[datetime] under_10_mins: List[str] = FieldInfo(alias="UNDER_10_MINS") class TimeseriesGroupDurationResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_response.py index 2751b1e138f..507d3cd63b8 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupIndustryResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIndustryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupIndustryResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_response.py index 136fc4da363..7f139a4b01b 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupIPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -14,10 +99,11 @@ class Serie0(BaseModel): i_pv6: List[str] = FieldInfo(alias="IPv6") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupIPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_response.py index c667519f0ef..1085fa094e1 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupProtocolResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupProtocolResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,12 +101,13 @@ class Serie0(BaseModel): tcp: List[str] = FieldInfo(alias="TCP") - timestamps: List[str] + timestamps: List[datetime] udp: List[str] = FieldInfo(alias="UDP") class TimeseriesGroupProtocolResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_response.py index 383d68a5182..e4a17e94b13 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupVectorResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupVectorResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupVectorResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_response.py index 5b185a2edda..2bb3dba6141 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupVerticalResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupVerticalResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupVerticalResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer3/top/location_origin_response.py b/src/cloudflare/types/radar/attacks/layer3/top/location_origin_response.py index 102661bf56a..b8974ab2133 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top/location_origin_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top/location_origin_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "LocationOriginResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -67,5 +97,6 @@ class Top0(BaseModel): class LocationOriginResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer3/top/location_target_response.py b/src/cloudflare/types/radar/attacks/layer3/top/location_target_response.py index 4641eb271e6..210e36c37ad 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top/location_target_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top/location_target_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "LocationTargetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -67,5 +97,6 @@ class Top0(BaseModel): class LocationTargetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer3/top_attacks_response.py b/src/cloudflare/types/radar/attacks/layer3/top_attacks_response.py index 100bfdc7d49..432fe1677b1 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_attacks_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_attacks_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopAttacksResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopAttacksResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -58,5 +95,6 @@ class Top0(BaseModel): class TopAttacksResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py b/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py index 7b8893c1cf0..60ed9704e83 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopIndustryResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopIndustryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -56,5 +93,6 @@ class Top0(BaseModel): class TopIndustryResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py b/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py index a9b5b23fbf3..b2e43e8699d 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopVerticalResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopVerticalResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -56,5 +93,6 @@ class Top0(BaseModel): class TopVerticalResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer3_timeseries_response.py b/src/cloudflare/types/radar/attacks/layer3_timeseries_response.py index c83a6af9578..18b51a6a0d4 100644 --- a/src/cloudflare/types/radar/attacks/layer3_timeseries_response.py +++ b/src/cloudflare/types/radar/attacks/layer3_timeseries_response.py @@ -1,20 +1,105 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import TYPE_CHECKING, List from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel +from .layer3_timeseries_response import UnnamedTypeWithobjectParent2UnnamedTypeWithobjectParent2Item + +__all__ = [ + "Layer3TimeseriesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") -__all__ = ["Layer3TimeseriesResponse", "Serie0"] + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. -class Serie0(BaseModel): - timestamps: List[datetime] + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - values: List[str] + units: List[MetaUnit] + """Measurement units for the results.""" class Layer3TimeseriesResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" - serie_0: Serie0 + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> UnnamedTypeWithobjectParent2UnnamedTypeWithobjectParent2Item: ... diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py index 79afadef9b6..0874d807cd5 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryHTTPMethodResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryHTTPMethodResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryHTTPMethodResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_version_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_version_response.py index f78c229daaa..1417cb71058 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,78 @@ __all__ = [ "SummaryHTTPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): @@ -67,5 +95,6 @@ class Summary0(BaseModel): class SummaryHTTPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_industry_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_industry_response.py index de252763039..a33a0aec474 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_industry_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryIndustryResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryIndustryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryIndustryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_response.py index e1a3995c7e5..8eca8811ec5 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,78 @@ __all__ = [ "SummaryIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): @@ -65,5 +93,6 @@ class Summary0(BaseModel): class SummaryIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py index d63373ae0c7..f0eb8ac27fe 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryManagedRulesResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryManagedRulesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryManagedRulesResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py index eebfb391f20..eb5e429d477 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py @@ -2,6 +2,7 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,53 +11,81 @@ __all__ = [ "SummaryMitigationProductResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryMitigationProductResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_vertical_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_vertical_response.py index d2cdd169f86..a5e0a1fde39 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_vertical_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryVerticalResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryVerticalResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryVerticalResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py index 45e7a8b8a9f..38f2e8a60ff 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupHTTPMethodResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupHTTPMethodResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupHTTPMethodResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py index 0aeb0474fd0..9d9eaaf6484 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupHTTPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupHTTPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,10 +101,11 @@ class Serie0(BaseModel): http_3: List[str] = FieldInfo(alias="HTTP/3") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupHTTPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_response.py index 2751b1e138f..507d3cd63b8 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupIndustryResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIndustryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupIndustryResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_response.py index 136fc4da363..7f139a4b01b 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupIPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -14,10 +99,11 @@ class Serie0(BaseModel): i_pv6: List[str] = FieldInfo(alias="IPv6") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupIPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_response.py index 362411fce48..957e3974c22 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupManagedRulesResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupManagedRulesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupManagedRulesResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py index b3e88c1e6a0..e0c4fcc3c37 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupMitigationProductResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupMitigationProductResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupMitigationProductResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_response.py index 5b185a2edda..2bb3dba6141 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupVerticalResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupVerticalResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupVerticalResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_response.py b/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_response.py index 7c7bdac68f6..c19996f4439 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ......_models import BaseModel -__all__ = ["AseOriginResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "AseOriginResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -60,5 +97,6 @@ class Top0(BaseModel): class AseOriginResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer7/top/location_origin_response.py b/src/cloudflare/types/radar/attacks/layer7/top/location_origin_response.py index 102661bf56a..b8974ab2133 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top/location_origin_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top/location_origin_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "LocationOriginResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -67,5 +97,6 @@ class Top0(BaseModel): class LocationOriginResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer7/top/location_target_response.py b/src/cloudflare/types/radar/attacks/layer7/top/location_target_response.py index 4641eb271e6..210e36c37ad 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top/location_target_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top/location_target_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "LocationTargetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -67,5 +97,6 @@ class Top0(BaseModel): class LocationTargetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer7/top_attacks_response.py b/src/cloudflare/types/radar/attacks/layer7/top_attacks_response.py index 68577c2c62c..7442da4aba0 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_attacks_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_attacks_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopAttacksResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopAttacksResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -62,5 +99,6 @@ class Top0(BaseModel): class TopAttacksResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py b/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py index 7b8893c1cf0..60ed9704e83 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopIndustryResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopIndustryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -56,5 +93,6 @@ class Top0(BaseModel): class TopIndustryResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py b/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py index a9b5b23fbf3..b2e43e8699d 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopVerticalResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopVerticalResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -56,5 +93,6 @@ class Top0(BaseModel): class TopVerticalResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/attacks/layer7_timeseries_response.py b/src/cloudflare/types/radar/attacks/layer7_timeseries_response.py index 355696d9df5..87657458ae5 100644 --- a/src/cloudflare/types/radar/attacks/layer7_timeseries_response.py +++ b/src/cloudflare/types/radar/attacks/layer7_timeseries_response.py @@ -1,7 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,87 @@ __all__ = [ "Layer7TimeseriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Serie0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -65,5 +102,6 @@ class Serie0(BaseModel): class Layer7TimeseriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/bgp/ip_timeseries_response.py b/src/cloudflare/types/radar/bgp/ip_timeseries_response.py index a1ca89321b8..81e9a3d55ef 100644 --- a/src/cloudflare/types/radar/bgp/ip_timeseries_response.py +++ b/src/cloudflare/types/radar/bgp/ip_timeseries_response.py @@ -1,32 +1,151 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["IPTimeseriesResponse", "Meta", "MetaQuery", "MetaQueryDateRange", "Serie174"] +__all__ = [ + "IPTimeseriesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "MetaDelay", + "MetaDelayASNData", + "MetaDelayASNDataLatest", + "MetaDelayCountryData", + "MetaDelayCountryDataLatest", + "Serie0", +] -class MetaQueryDateRange(BaseModel): - end_time: str = FieldInfo(alias="endTime") +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") - start_time: str = FieldInfo(alias="startTime") + description: str + end_date: datetime = FieldInfo(alias="endDate") -class MetaQuery(BaseModel): - date_range: MetaQueryDateRange = FieldInfo(alias="dateRange") + event_type: str = FieldInfo(alias="eventType") - entity: str + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class MetaDelayASNDataLatest(BaseModel): + entries_count: float + + path: str + + timestamp: float + + +class MetaDelayASNData(BaseModel): + delay_secs: float = FieldInfo(alias="delaySecs") + + delay_str: str = FieldInfo(alias="delayStr") + + healthy: bool + + latest: MetaDelayASNDataLatest + + +class MetaDelayCountryDataLatest(BaseModel): + count: float + + timestamp: float + + +class MetaDelayCountryData(BaseModel): + delay_secs: float = FieldInfo(alias="delaySecs") + + delay_str: str = FieldInfo(alias="delayStr") + + healthy: bool + + latest: MetaDelayCountryDataLatest + + +class MetaDelay(BaseModel): + asn_data: MetaDelayASNData + + country_data: MetaDelayCountryData + + healthy: bool + + now_ts: float = FieldInfo(alias="nowTs") class Meta(BaseModel): - queries: List[MetaQuery] + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" + + delay: Optional[MetaDelay] = None -class Serie174(BaseModel): +class Serie0(BaseModel): ipv4: List[str] ipv6: List[str] @@ -36,5 +155,6 @@ class Serie174(BaseModel): class IPTimeseriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" - serie_174: Serie174 + serie_0: Serie0 diff --git a/src/cloudflare/types/radar/bgp/route_realtime_response.py b/src/cloudflare/types/radar/bgp/route_realtime_response.py index d91d53574b6..03e831feffb 100644 --- a/src/cloudflare/types/radar/bgp/route_realtime_response.py +++ b/src/cloudflare/types/radar/bgp/route_realtime_response.py @@ -29,7 +29,7 @@ class MetaCollector(BaseModel): """Public route collector ID.""" latest_realtime_ts: str - """Latest realtime stream timestamp for this collector.""" + """Latest real-time stream timestamp for this collector.""" latest_rib_ts: str """Latest RIB dump MRT file timestamp for this collector.""" diff --git a/src/cloudflare/types/radar/bgp/top_prefixes_response.py b/src/cloudflare/types/radar/bgp/top_prefixes_response.py index 9f5e92716b7..8565bf7da6f 100644 --- a/src/cloudflare/types/radar/bgp/top_prefixes_response.py +++ b/src/cloudflare/types/radar/bgp/top_prefixes_response.py @@ -26,6 +26,7 @@ class Top0(BaseModel): prefix: str value: str + """A numeric string.""" class TopPrefixesResponse(BaseModel): diff --git a/src/cloudflare/types/radar/bgp_timeseries_response.py b/src/cloudflare/types/radar/bgp_timeseries_response.py index b3ca270daa5..8be0d75c155 100644 --- a/src/cloudflare/types/radar/bgp_timeseries_response.py +++ b/src/cloudflare/types/radar/bgp_timeseries_response.py @@ -1,7 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,52 +11,54 @@ __all__ = [ "BGPTimeseriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", "Serie0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["15m", "1h", "1d", "1w"] = FieldInfo(alias="aggInterval") + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - class Serie0(BaseModel): timestamps: List[datetime] diff --git a/src/cloudflare/types/radar/dns/summary_cache_hit_response.py b/src/cloudflare/types/radar/dns/summary_cache_hit_response.py index eac77027ab9..8be64b8e267 100644 --- a/src/cloudflare/types/radar/dns/summary_cache_hit_response.py +++ b/src/cloudflare/types/radar/dns/summary_cache_hit_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryCacheHitResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): negative: str = FieldInfo(alias="NEGATIVE") + """A numeric string.""" positive: str = FieldInfo(alias="POSITIVE") + """A numeric string.""" class SummaryCacheHitResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_dnssec_aware_response.py b/src/cloudflare/types/radar/dns/summary_dnssec_aware_response.py index d31274b80f9..ab107386ba2 100644 --- a/src/cloudflare/types/radar/dns/summary_dnssec_aware_response.py +++ b/src/cloudflare/types/radar/dns/summary_dnssec_aware_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryDNSSECAwareResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): not_supported: str = FieldInfo(alias="NOT_SUPPORTED") + """A numeric string.""" supported: str = FieldInfo(alias="SUPPORTED") + """A numeric string.""" class SummaryDNSSECAwareResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_dnssec_e2e_response.py b/src/cloudflare/types/radar/dns/summary_dnssec_e2e_response.py index 09b86fac10c..4eac2ea6945 100644 --- a/src/cloudflare/types/radar/dns/summary_dnssec_e2e_response.py +++ b/src/cloudflare/types/radar/dns/summary_dnssec_e2e_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryDNSSECE2EResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): negative: str = FieldInfo(alias="NEGATIVE") + """A numeric string.""" positive: str = FieldInfo(alias="POSITIVE") + """A numeric string.""" class SummaryDNSSECE2EResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_dnssec_response.py b/src/cloudflare/types/radar/dns/summary_dnssec_response.py index a4f7393ab7f..a902284fbbb 100644 --- a/src/cloudflare/types/radar/dns/summary_dnssec_response.py +++ b/src/cloudflare/types/radar/dns/summary_dnssec_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,64 +11,96 @@ __all__ = [ "SummaryDNSSECResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): insecure: str = FieldInfo(alias="INSECURE") + """A numeric string.""" invalid: str = FieldInfo(alias="INVALID") + """A numeric string.""" other: str = FieldInfo(alias="OTHER") + """A numeric string.""" secure: str = FieldInfo(alias="SECURE") + """A numeric string.""" class SummaryDNSSECResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_ip_version_response.py b/src/cloudflare/types/radar/dns/summary_ip_version_response.py index 6286c80dc1d..5ade97ddc23 100644 --- a/src/cloudflare/types/radar/dns/summary_ip_version_response.py +++ b/src/cloudflare/types/radar/dns/summary_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): i_pv4: str = FieldInfo(alias="IPv4") + """A numeric string.""" i_pv6: str = FieldInfo(alias="IPv6") + """A numeric string.""" class SummaryIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_matching_answer_response.py b/src/cloudflare/types/radar/dns/summary_matching_answer_response.py index b232290ab60..9b88202cfa9 100644 --- a/src/cloudflare/types/radar/dns/summary_matching_answer_response.py +++ b/src/cloudflare/types/radar/dns/summary_matching_answer_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryMatchingAnswerResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): negative: str = FieldInfo(alias="NEGATIVE") + """A numeric string.""" positive: str = FieldInfo(alias="POSITIVE") + """A numeric string.""" class SummaryMatchingAnswerResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_protocol_response.py b/src/cloudflare/types/radar/dns/summary_protocol_response.py index b75c6a52eb9..da6b44a7151 100644 --- a/src/cloudflare/types/radar/dns/summary_protocol_response.py +++ b/src/cloudflare/types/radar/dns/summary_protocol_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,64 +11,96 @@ __all__ = [ "SummaryProtocolResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): https: str = FieldInfo(alias="HTTPS") + """A numeric string.""" tcp: str = FieldInfo(alias="TCP") + """A numeric string.""" tls: str = FieldInfo(alias="TLS") + """A numeric string.""" udp: str = FieldInfo(alias="UDP") + """A numeric string.""" class SummaryProtocolResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/summary_query_type_response.py b/src/cloudflare/types/radar/dns/summary_query_type_response.py index 87baa9cd63b..b1515b5fada 100644 --- a/src/cloudflare/types/radar/dns/summary_query_type_response.py +++ b/src/cloudflare/types/radar/dns/summary_query_type_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["SummaryQueryTypeResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryQueryTypeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryQueryTypeResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/dns/summary_response_code_response.py b/src/cloudflare/types/radar/dns/summary_response_code_response.py index 01764dfda55..6062b9f7cf7 100644 --- a/src/cloudflare/types/radar/dns/summary_response_code_response.py +++ b/src/cloudflare/types/radar/dns/summary_response_code_response.py @@ -2,20 +2,20 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["SummaryResponseCodeResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryResponseCodeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,34 +23,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryResponseCodeResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/dns/summary_response_ttl_response.py b/src/cloudflare/types/radar/dns/summary_response_ttl_response.py index 8c3259e1ec4..41994cccc65 100644 --- a/src/cloudflare/types/radar/dns/summary_response_ttl_response.py +++ b/src/cloudflare/types/radar/dns/summary_response_ttl_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,70 +11,105 @@ __all__ = [ "SummaryResponseTTLResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): gt_15m_lte_1h: str + """A numeric string.""" gt_1d_lte_1w: str + """A numeric string.""" gt_1h_lte_1d: str + """A numeric string.""" gt_1m_lte_5m: str + """A numeric string.""" gt_1w: str + """A numeric string.""" gt_5m_lte_15m: str + """A numeric string.""" lte_1m: str + """A numeric string.""" class SummaryResponseTTLResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_cache_hit_response.py b/src/cloudflare/types/radar/dns/timeseries_group_cache_hit_response.py index 97208f52613..0b7e2f6d990 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_cache_hit_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_cache_hit_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupCacheHitResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupCacheHitResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupCacheHitResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_dnssec_aware_response.py b/src/cloudflare/types/radar/dns/timeseries_group_dnssec_aware_response.py index db3f76bd240..8e403373795 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_dnssec_aware_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_dnssec_aware_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupDNSSECAwareResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupDNSSECAwareResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupDNSSECAwareResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_dnssec_e2e_response.py b/src/cloudflare/types/radar/dns/timeseries_group_dnssec_e2e_response.py index 7b324937876..86cf5cf88a8 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_dnssec_e2e_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_dnssec_e2e_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupDNSSECE2EResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupDNSSECE2EResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupDNSSECE2EResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_dnssec_response.py b/src/cloudflare/types/radar/dns/timeseries_group_dnssec_response.py index d87e01cceef..b8bd85ea864 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_dnssec_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_dnssec_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupDNSSECResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupDNSSECResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -20,6 +105,7 @@ class Serie0(BaseModel): class TimeseriesGroupDNSSECResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_ip_version_response.py b/src/cloudflare/types/radar/dns/timeseries_group_ip_version_response.py index 4e9128d1c2f..790d4de556d 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_ip_version_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_ip_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupIPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupIPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_matching_answer_response.py b/src/cloudflare/types/radar/dns/timeseries_group_matching_answer_response.py index c7ad80a20d4..d3107fa9cc3 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_matching_answer_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_matching_answer_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupMatchingAnswerResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupMatchingAnswerResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupMatchingAnswerResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_protocol_response.py b/src/cloudflare/types/radar/dns/timeseries_group_protocol_response.py index 85baee000f5..9b24b34429b 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_protocol_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_protocol_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupProtocolResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupProtocolResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -20,6 +105,7 @@ class Serie0(BaseModel): class TimeseriesGroupProtocolResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_query_type_response.py b/src/cloudflare/types/radar/dns/timeseries_group_query_type_response.py index b63a9d54cbb..4240248af6a 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_query_type_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_query_type_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupQueryTypeResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupQueryTypeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupQueryTypeResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_response_code_response.py b/src/cloudflare/types/radar/dns/timeseries_group_response_code_response.py index b5d3c5a39b7..5925803e452 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_response_code_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_response_code_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupResponseCodeResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupResponseCodeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupResponseCodeResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/timeseries_group_response_ttl_response.py b/src/cloudflare/types/radar/dns/timeseries_group_response_ttl_response.py index 2ba2fcea097..90cfbef4d37 100644 --- a/src/cloudflare/types/radar/dns/timeseries_group_response_ttl_response.py +++ b/src/cloudflare/types/radar/dns/timeseries_group_response_ttl_response.py @@ -1,10 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupResponseTTLResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupResponseTTLResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -24,6 +111,7 @@ class Serie0(BaseModel): class TimeseriesGroupResponseTTLResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/top_ases_response.py b/src/cloudflare/types/radar/dns/top_ases_response.py index e87c9d659f0..e4acf19874f 100644 --- a/src/cloudflare/types/radar/dns/top_ases_response.py +++ b/src/cloudflare/types/radar/dns/top_ases_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopAsesResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopAsesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,27 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -52,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class TopAsesResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/dns/top_locations_response.py b/src/cloudflare/types/radar/dns/top_locations_response.py index 4be71f2a029..be6919353f1 100644 --- a/src/cloudflare/types/radar/dns/top_locations_response.py +++ b/src/cloudflare/types/radar/dns/top_locations_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,47 +11,78 @@ __all__ = [ "TopLocationsResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" - level: Optional[int] = None + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -59,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TopLocationsResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/dns_timeseries_response.py b/src/cloudflare/types/radar/dns_timeseries_response.py index 1d17716bd40..64f06be307e 100644 --- a/src/cloudflare/types/radar/dns_timeseries_response.py +++ b/src/cloudflare/types/radar/dns_timeseries_response.py @@ -1,69 +1,105 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from .dns_timeseries_response import UnnamedTypeWithobjectParent0UnnamedTypeWithobjectParent0Item __all__ = [ "DNSTimeseriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", - "Serie0", + "MetaDateRange", + "MetaUnit", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. -class Serie0(BaseModel): - timestamps: List[datetime] + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - values: List[str] + units: List[MetaUnit] + """Measurement units for the results.""" class DNSTimeseriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" - serie_0: Serie0 + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> UnnamedTypeWithobjectParent0UnnamedTypeWithobjectParent0Item: ... diff --git a/src/cloudflare/types/radar/email/routing/summary_arc_response.py b/src/cloudflare/types/radar/email/routing/summary_arc_response.py index 274e9a535ba..3ae3cd48245 100644 --- a/src/cloudflare/types/radar/email/routing/summary_arc_response.py +++ b/src/cloudflare/types/radar/email/routing/summary_arc_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummaryARCResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryARCResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/routing/summary_dkim_response.py b/src/cloudflare/types/radar/email/routing/summary_dkim_response.py index df8a79048cd..b5f22259c95 100644 --- a/src/cloudflare/types/radar/email/routing/summary_dkim_response.py +++ b/src/cloudflare/types/radar/email/routing/summary_dkim_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummaryDKIMResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryDKIMResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryDKIMResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/routing/summary_dmarc_response.py b/src/cloudflare/types/radar/email/routing/summary_dmarc_response.py index 0563a742286..ca4ac4a0d00 100644 --- a/src/cloudflare/types/radar/email/routing/summary_dmarc_response.py +++ b/src/cloudflare/types/radar/email/routing/summary_dmarc_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummaryDMARCResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryDMARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryDMARCResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/routing/summary_encrypted_response.py b/src/cloudflare/types/radar/email/routing/summary_encrypted_response.py index 5461181d3de..e9fb924c13c 100644 --- a/src/cloudflare/types/radar/email/routing/summary_encrypted_response.py +++ b/src/cloudflare/types/radar/email/routing/summary_encrypted_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryEncryptedResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): encrypted: str = FieldInfo(alias="ENCRYPTED") + """A numeric string.""" not_encrypted: str = FieldInfo(alias="NOT_ENCRYPTED") + """A numeric string.""" class SummaryEncryptedResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/routing/summary_ip_version_response.py b/src/cloudflare/types/radar/email/routing/summary_ip_version_response.py index e1a3995c7e5..b121482480f 100644 --- a/src/cloudflare/types/radar/email/routing/summary_ip_version_response.py +++ b/src/cloudflare/types/radar/email/routing/summary_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): i_pv4: str = FieldInfo(alias="IPv4") + """A numeric string.""" i_pv6: str = FieldInfo(alias="IPv6") + """A numeric string.""" class SummaryIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/routing/summary_spf_response.py b/src/cloudflare/types/radar/email/routing/summary_spf_response.py index 9cd062e392f..3ad9edc35f5 100644 --- a/src/cloudflare/types/radar/email/routing/summary_spf_response.py +++ b/src/cloudflare/types/radar/email/routing/summary_spf_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummarySPFResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummarySPFResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummarySPFResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_arc_response.py b/src/cloudflare/types/radar/email/routing/timeseries_group_arc_response.py index 2db9f3e2724..75cfb14e85b 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_arc_response.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_arc_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupARCResponse"] +__all__ = [ + "TimeseriesGroupARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupARCResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_response.py b/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_response.py index 5ca5b0d279d..a365a603651 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_response.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupDKIMResponse"] +__all__ = [ + "TimeseriesGroupDKIMResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupDKIMResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_response.py b/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_response.py index 2a64afcfe24..7b9dfa90d1d 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_response.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupDMARCResponse"] +__all__ = [ + "TimeseriesGroupDMARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupDMARCResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_response.py b/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_response.py index e6d73b1a0bf..d71f229e692 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_response.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupEncryptedResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupEncryptedResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupEncryptedResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_response.py b/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_response.py index 613041d358d..5d8a14762a2 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_response.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupIPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupIPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_spf_response.py b/src/cloudflare/types/radar/email/routing/timeseries_group_spf_response.py index 212c6fa23e6..8061d11e270 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_spf_response.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_spf_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupSPFResponse"] +__all__ = [ + "TimeseriesGroupSPFResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupSPFResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/security/summary_arc_response.py b/src/cloudflare/types/radar/email/security/summary_arc_response.py index 274e9a535ba..3ae3cd48245 100644 --- a/src/cloudflare/types/radar/email/security/summary_arc_response.py +++ b/src/cloudflare/types/radar/email/security/summary_arc_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummaryARCResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryARCResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/security/summary_dkim_response.py b/src/cloudflare/types/radar/email/security/summary_dkim_response.py index df8a79048cd..b5f22259c95 100644 --- a/src/cloudflare/types/radar/email/security/summary_dkim_response.py +++ b/src/cloudflare/types/radar/email/security/summary_dkim_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummaryDKIMResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryDKIMResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryDKIMResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/security/summary_dmarc_response.py b/src/cloudflare/types/radar/email/security/summary_dmarc_response.py index 0563a742286..ca4ac4a0d00 100644 --- a/src/cloudflare/types/radar/email/security/summary_dmarc_response.py +++ b/src/cloudflare/types/radar/email/security/summary_dmarc_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummaryDMARCResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummaryDMARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummaryDMARCResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/security/summary_malicious_response.py b/src/cloudflare/types/radar/email/security/summary_malicious_response.py index 44426a6e84e..2015166596d 100644 --- a/src/cloudflare/types/radar/email/security/summary_malicious_response.py +++ b/src/cloudflare/types/radar/email/security/summary_malicious_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryMaliciousResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): malicious: str = FieldInfo(alias="MALICIOUS") + """A numeric string.""" not_malicious: str = FieldInfo(alias="NOT_MALICIOUS") + """A numeric string.""" class SummaryMaliciousResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/security/summary_spam_response.py b/src/cloudflare/types/radar/email/security/summary_spam_response.py index 4fe4f3c5172..ca258d7eea1 100644 --- a/src/cloudflare/types/radar/email/security/summary_spam_response.py +++ b/src/cloudflare/types/radar/email/security/summary_spam_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummarySpamResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): not_spam: str = FieldInfo(alias="NOT_SPAM") + """A numeric string.""" spam: str = FieldInfo(alias="SPAM") + """A numeric string.""" class SummarySpamResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/security/summary_spf_response.py b/src/cloudflare/types/radar/email/security/summary_spf_response.py index 9cd062e392f..3ad9edc35f5 100644 --- a/src/cloudflare/types/radar/email/security/summary_spf_response.py +++ b/src/cloudflare/types/radar/email/security/summary_spf_response.py @@ -2,21 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel from ...radar_email_summary import RadarEmailSummary -__all__ = ["SummarySPFResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SummarySPFResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -24,34 +24,69 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class SummarySPFResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: RadarEmailSummary diff --git a/src/cloudflare/types/radar/email/security/summary_spoof_response.py b/src/cloudflare/types/radar/email/security/summary_spoof_response.py index b9e738ea0e1..76799ed3118 100644 --- a/src/cloudflare/types/radar/email/security/summary_spoof_response.py +++ b/src/cloudflare/types/radar/email/security/summary_spoof_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummarySpoofResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): not_spoof: str = FieldInfo(alias="NOT_SPOOF") + """A numeric string.""" spoof: str = FieldInfo(alias="SPOOF") + """A numeric string.""" class SummarySpoofResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/security/summary_threat_category_response.py b/src/cloudflare/types/radar/email/security/summary_threat_category_response.py index 36e2d29bbdf..713b5e20eaf 100644 --- a/src/cloudflare/types/radar/email/security/summary_threat_category_response.py +++ b/src/cloudflare/types/radar/email/security/summary_threat_category_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,64 +11,96 @@ __all__ = [ "SummaryThreatCategoryResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): brand_impersonation: str = FieldInfo(alias="BrandImpersonation") + """A numeric string.""" credential_harvester: str = FieldInfo(alias="CredentialHarvester") + """A numeric string.""" identity_deception: str = FieldInfo(alias="IdentityDeception") + """A numeric string.""" link: str = FieldInfo(alias="Link") + """A numeric string.""" class SummaryThreatCategoryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/security/summary_tls_version_response.py b/src/cloudflare/types/radar/email/security/summary_tls_version_response.py index f9ea5ad0711..c722089d9ab 100644 --- a/src/cloudflare/types/radar/email/security/summary_tls_version_response.py +++ b/src/cloudflare/types/radar/email/security/summary_tls_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,64 +11,96 @@ __all__ = [ "SummaryTLSVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): tls_1_0: str = FieldInfo(alias="TLS 1.0") + """A numeric string.""" tls_1_1: str = FieldInfo(alias="TLS 1.1") + """A numeric string.""" tls_1_2: str = FieldInfo(alias="TLS 1.2") + """A numeric string.""" tls_1_3: str = FieldInfo(alias="TLS 1.3") + """A numeric string.""" class SummaryTLSVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_arc_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_arc_response.py index 2db9f3e2724..75cfb14e85b 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_arc_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_arc_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupARCResponse"] +__all__ = [ + "TimeseriesGroupARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupARCResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_dkim_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_dkim_response.py index 5ca5b0d279d..a365a603651 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_dkim_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_dkim_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupDKIMResponse"] +__all__ = [ + "TimeseriesGroupDKIMResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupDKIMResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_response.py index 2a64afcfe24..7b9dfa90d1d 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupDMARCResponse"] +__all__ = [ + "TimeseriesGroupDMARCResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupDMARCResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_malicious_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_malicious_response.py index ad00ede30b2..6ab49f82489 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_malicious_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_malicious_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupMaliciousResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupMaliciousResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupMaliciousResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_spam_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_spam_response.py index 2ef1a477591..8fba012c800 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_spam_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_spam_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupSpamResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupSpamResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupSpamResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_spf_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_spf_response.py index 212c6fa23e6..8061d11e270 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_spf_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_spf_response.py @@ -1,12 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + from ....._models import BaseModel from ...radar_email_series import RadarEmailSeries -__all__ = ["TimeseriesGroupSPFResponse"] +__all__ = [ + "TimeseriesGroupSPFResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class TimeseriesGroupSPFResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: RadarEmailSeries diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_spoof_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_spoof_response.py index e5df9bebbd6..6d17f5e49ef 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_spoof_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_spoof_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupSpoofResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupSpoofResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,6 +101,7 @@ class Serie0(BaseModel): class TimeseriesGroupSpoofResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_response.py index 001546718bb..649386f6f32 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupThreatCategoryResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupThreatCategoryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -20,6 +105,7 @@ class Serie0(BaseModel): class TimeseriesGroupThreatCategoryResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_response.py b/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_response.py index 8e41a81157a..577ec171d8d 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_response.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TimeseriesGroupTLSVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupTLSVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -20,6 +105,7 @@ class Serie0(BaseModel): class TimeseriesGroupTLSVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/email/security/top/tld_get_response.py b/src/cloudflare/types/radar/email/security/top/tld_get_response.py index 49aa4d04c3f..1c2ca4cc7ce 100644 --- a/src/cloudflare/types/radar/email/security/top/tld_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tld_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ......_models import BaseModel -__all__ = ["TldGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TldGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,38 +24,76 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): name: str value: str + """A numeric string.""" class TldGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py b/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py index 48be3d39b00..38ed7746144 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,58 +11,89 @@ __all__ = [ "MaliciousGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" - level: Optional[int] = None + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): name: str value: str + """A numeric string.""" class MaliciousGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py b/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py index f4114b96787..7b824836d13 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ......._models import BaseModel -__all__ = ["SpamGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SpamGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,38 +24,76 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): name: str value: str + """A numeric string.""" class SpamGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py b/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py index 212026d457a..a8a0f67f6b9 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ......._models import BaseModel -__all__ = ["SpoofGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "SpoofGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,38 +24,76 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): name: str value: str + """A numeric string.""" class SpoofGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/entities/location_get_response.py b/src/cloudflare/types/radar/entities/location_get_response.py index 4a2461c1aea..0341e6df340 100644 --- a/src/cloudflare/types/radar/entities/location_get_response.py +++ b/src/cloudflare/types/radar/entities/location_get_response.py @@ -13,8 +13,10 @@ class Location(BaseModel): confidence_level: int = FieldInfo(alias="confidenceLevel") latitude: str + """A numeric string.""" longitude: str + """A numeric string.""" name: str diff --git a/src/cloudflare/types/radar/entities/location_list_response.py b/src/cloudflare/types/radar/entities/location_list_response.py index 0141afd4295..11030b01b7a 100644 --- a/src/cloudflare/types/radar/entities/location_list_response.py +++ b/src/cloudflare/types/radar/entities/location_list_response.py @@ -11,8 +11,10 @@ class Location(BaseModel): alpha2: str latitude: str + """A numeric string.""" longitude: str + """A numeric string.""" name: str diff --git a/src/cloudflare/types/radar/http/ase_get_response.py b/src/cloudflare/types/radar/http/ase_get_response.py index a606c25f81c..b7de9ad51ce 100644 --- a/src/cloudflare/types/radar/http/ase_get_response.py +++ b/src/cloudflare/types/radar/http/ase_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["AseGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "AseGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class AseGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/bot_class_get_response.py b/src/cloudflare/types/radar/http/ases/bot_class_get_response.py index c48362beaed..5dbc74d339f 100644 --- a/src/cloudflare/types/radar/http/ases/bot_class_get_response.py +++ b/src/cloudflare/types/radar/http/ases/bot_class_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["BotClassGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "BotClassGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class BotClassGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/browser_family_get_response.py b/src/cloudflare/types/radar/http/ases/browser_family_get_response.py index f4d2f1fc2be..fdf6d0cb548 100644 --- a/src/cloudflare/types/radar/http/ases/browser_family_get_response.py +++ b/src/cloudflare/types/radar/http/ases/browser_family_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "BrowserFamilyGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class BrowserFamilyGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/device_type_get_response.py b/src/cloudflare/types/radar/http/ases/device_type_get_response.py index a619785971d..f9de44db7e0 100644 --- a/src/cloudflare/types/radar/http/ases/device_type_get_response.py +++ b/src/cloudflare/types/radar/http/ases/device_type_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "DeviceTypeGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class DeviceTypeGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/http_method_get_response.py b/src/cloudflare/types/radar/http/ases/http_method_get_response.py index d4e4622fe36..d10a9289280 100644 --- a/src/cloudflare/types/radar/http/ases/http_method_get_response.py +++ b/src/cloudflare/types/radar/http/ases/http_method_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "HTTPMethodGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class HTTPMethodGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/http_protocol_get_response.py b/src/cloudflare/types/radar/http/ases/http_protocol_get_response.py index 3552fc7cad0..cea438e0d05 100644 --- a/src/cloudflare/types/radar/http/ases/http_protocol_get_response.py +++ b/src/cloudflare/types/radar/http/ases/http_protocol_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "HTTPProtocolGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class HTTPProtocolGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/ip_version_get_response.py b/src/cloudflare/types/radar/http/ases/ip_version_get_response.py index cb714fbcdf2..49261adf705 100644 --- a/src/cloudflare/types/radar/http/ases/ip_version_get_response.py +++ b/src/cloudflare/types/radar/http/ases/ip_version_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "IPVersionGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class IPVersionGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/os_get_response.py b/src/cloudflare/types/radar/http/ases/os_get_response.py index a8777949f24..d58c0da5555 100644 --- a/src/cloudflare/types/radar/http/ases/os_get_response.py +++ b/src/cloudflare/types/radar/http/ases/os_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["OSGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "OSGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class OSGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/ases/tls_version_get_response.py b/src/cloudflare/types/radar/http/ases/tls_version_get_response.py index 1ffc7b6c327..943dd70512e 100644 --- a/src/cloudflare/types/radar/http/ases/tls_version_get_response.py +++ b/src/cloudflare/types/radar/http/ases/tls_version_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "TLSVersionGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class TLSVersionGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/location_get_response.py b/src/cloudflare/types/radar/http/location_get_response.py index 95a4c526fe3..549fcaca324 100644 --- a/src/cloudflare/types/radar/http/location_get_response.py +++ b/src/cloudflare/types/radar/http/location_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["LocationGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "LocationGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class LocationGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/bot_class_get_response.py b/src/cloudflare/types/radar/http/locations/bot_class_get_response.py index 9b7d9f6c23d..afa6d60905e 100644 --- a/src/cloudflare/types/radar/http/locations/bot_class_get_response.py +++ b/src/cloudflare/types/radar/http/locations/bot_class_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["BotClassGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "BotClassGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class BotClassGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/browser_family_get_response.py b/src/cloudflare/types/radar/http/locations/browser_family_get_response.py index 5f161c3903e..23374ffb5d2 100644 --- a/src/cloudflare/types/radar/http/locations/browser_family_get_response.py +++ b/src/cloudflare/types/radar/http/locations/browser_family_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "BrowserFamilyGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class BrowserFamilyGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/device_type_get_response.py b/src/cloudflare/types/radar/http/locations/device_type_get_response.py index ed2f568faad..4b63e1ed723 100644 --- a/src/cloudflare/types/radar/http/locations/device_type_get_response.py +++ b/src/cloudflare/types/radar/http/locations/device_type_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "DeviceTypeGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class DeviceTypeGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/http_method_get_response.py b/src/cloudflare/types/radar/http/locations/http_method_get_response.py index ed56bfd057f..2d1b42d93f2 100644 --- a/src/cloudflare/types/radar/http/locations/http_method_get_response.py +++ b/src/cloudflare/types/radar/http/locations/http_method_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "HTTPMethodGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class HTTPMethodGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/http_protocol_get_response.py b/src/cloudflare/types/radar/http/locations/http_protocol_get_response.py index 6d9b31aad62..d1b0f7aef31 100644 --- a/src/cloudflare/types/radar/http/locations/http_protocol_get_response.py +++ b/src/cloudflare/types/radar/http/locations/http_protocol_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "HTTPProtocolGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class HTTPProtocolGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/ip_version_get_response.py b/src/cloudflare/types/radar/http/locations/ip_version_get_response.py index bb30d89b81e..5fc1326418e 100644 --- a/src/cloudflare/types/radar/http/locations/ip_version_get_response.py +++ b/src/cloudflare/types/radar/http/locations/ip_version_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "IPVersionGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class IPVersionGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/os_get_response.py b/src/cloudflare/types/radar/http/locations/os_get_response.py index 31e24633774..981ff2cc6db 100644 --- a/src/cloudflare/types/radar/http/locations/os_get_response.py +++ b/src/cloudflare/types/radar/http/locations/os_get_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["OSGetResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "OSGetResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class OSGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/locations/tls_version_get_response.py b/src/cloudflare/types/radar/http/locations/tls_version_get_response.py index 82d4b85eec7..664e062ac28 100644 --- a/src/cloudflare/types/radar/http/locations/tls_version_get_response.py +++ b/src/cloudflare/types/radar/http/locations/tls_version_get_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "TLSVersionGetResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -61,9 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TLSVersionGetResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/summary_bot_class_response.py b/src/cloudflare/types/radar/http/summary_bot_class_response.py index d4c5847ae8d..558d9f18035 100644 --- a/src/cloudflare/types/radar/http/summary_bot_class_response.py +++ b/src/cloudflare/types/radar/http/summary_bot_class_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryBotClassResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): bot: str + """A numeric string.""" human: str + """A numeric string.""" class SummaryBotClassResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_device_type_response.py b/src/cloudflare/types/radar/http/summary_device_type_response.py index 7aa1bbd9fd7..61310a25d7b 100644 --- a/src/cloudflare/types/radar/http/summary_device_type_response.py +++ b/src/cloudflare/types/radar/http/summary_device_type_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,62 +11,93 @@ __all__ = [ "SummaryDeviceTypeResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): desktop: str + """A numeric string.""" mobile: str + """A numeric string.""" other: str + """A numeric string.""" class SummaryDeviceTypeResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_http_protocol_response.py b/src/cloudflare/types/radar/http/summary_http_protocol_response.py index 3ee6ffef02f..0e24e5c999d 100644 --- a/src/cloudflare/types/radar/http/summary_http_protocol_response.py +++ b/src/cloudflare/types/radar/http/summary_http_protocol_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryHTTPProtocolResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): http: str + """A numeric string.""" https: str + """A numeric string.""" class SummaryHTTPProtocolResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_http_version_response.py b/src/cloudflare/types/radar/http/summary_http_version_response.py index 7c3c97a3d57..1a9b81e4d6c 100644 --- a/src/cloudflare/types/radar/http/summary_http_version_response.py +++ b/src/cloudflare/types/radar/http/summary_http_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,62 +11,93 @@ __all__ = [ "SummaryHTTPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): http_1_x: str = FieldInfo(alias="HTTP/1.x") + """A numeric string.""" http_2: str = FieldInfo(alias="HTTP/2") + """A numeric string.""" http_3: str = FieldInfo(alias="HTTP/3") + """A numeric string.""" class SummaryHTTPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_ip_version_response.py b/src/cloudflare/types/radar/http/summary_ip_version_response.py index 6286c80dc1d..5ade97ddc23 100644 --- a/src/cloudflare/types/radar/http/summary_ip_version_response.py +++ b/src/cloudflare/types/radar/http/summary_ip_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryIPVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): i_pv4: str = FieldInfo(alias="IPv4") + """A numeric string.""" i_pv6: str = FieldInfo(alias="IPv6") + """A numeric string.""" class SummaryIPVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_os_response.py b/src/cloudflare/types/radar/http/summary_os_response.py index b9737a2dcf9..e3a74c1cd32 100644 --- a/src/cloudflare/types/radar/http/summary_os_response.py +++ b/src/cloudflare/types/radar/http/summary_os_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryOSResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): android: str = FieldInfo(alias="ANDROID") + """A numeric string.""" ios: str = FieldInfo(alias="IOS") + """A numeric string.""" class SummaryOSResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_post_quantum_response.py b/src/cloudflare/types/radar/http/summary_post_quantum_response.py index f244b9910b7..f34f5dbae04 100644 --- a/src/cloudflare/types/radar/http/summary_post_quantum_response.py +++ b/src/cloudflare/types/radar/http/summary_post_quantum_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryPostQuantumResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): not_supported: str = FieldInfo(alias="NOT_SUPPORTED") + """A numeric string.""" supported: str = FieldInfo(alias="SUPPORTED") + """A numeric string.""" class SummaryPostQuantumResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/summary_tls_version_response.py b/src/cloudflare/types/radar/http/summary_tls_version_response.py index 1a8ffeb3e19..97e9f0b27cb 100644 --- a/src/cloudflare/types/radar/http/summary_tls_version_response.py +++ b/src/cloudflare/types/radar/http/summary_tls_version_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,66 +11,99 @@ __all__ = [ "SummaryTLSVersionResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): tls_1_0: str = FieldInfo(alias="TLS 1.0") + """A numeric string.""" tls_1_1: str = FieldInfo(alias="TLS 1.1") + """A numeric string.""" tls_1_2: str = FieldInfo(alias="TLS 1.2") + """A numeric string.""" tls_1_3: str = FieldInfo(alias="TLS 1.3") + """A numeric string.""" tls_quic: str = FieldInfo(alias="TLS QUIC") + """A numeric string.""" class SummaryTLSVersionResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_bot_class_response.py b/src/cloudflare/types/radar/http/timeseries_group_bot_class_response.py index 8e2d5aa1a80..b8a2a75ea40 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_bot_class_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_bot_class_response.py @@ -1,10 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupBotClassResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupBotClassResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -12,10 +99,11 @@ class Serie0(BaseModel): human: List[str] - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupBotClassResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_family_response.py b/src/cloudflare/types/radar/http/timeseries_group_browser_family_response.py index 8f14d62efd1..6208810f399 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_family_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_family_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupBrowserFamilyResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupBrowserFamilyResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupBrowserFamilyResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_response.py b/src/cloudflare/types/radar/http/timeseries_group_browser_response.py index 329563a8ca3..e594533b685 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupBrowserResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupBrowserResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupBrowserResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_device_type_response.py b/src/cloudflare/types/radar/http/timeseries_group_device_type_response.py index d053d647fd3..f295c666653 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_device_type_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_device_type_response.py @@ -1,10 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupDeviceTypeResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupDeviceTypeResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -14,10 +101,11 @@ class Serie0(BaseModel): other: List[str] - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupDeviceTypeResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_http_protocol_response.py b/src/cloudflare/types/radar/http/timeseries_group_http_protocol_response.py index 62628a00588..21cc09d8d25 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_http_protocol_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_http_protocol_response.py @@ -1,10 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupHTTPProtocolResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupHTTPProtocolResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -12,10 +99,11 @@ class Serie0(BaseModel): https: List[str] - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupHTTPProtocolResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_http_version_response.py b/src/cloudflare/types/radar/http/timeseries_group_http_version_response.py index 0bde713e070..2f5763c5df9 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_http_version_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_http_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupHTTPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupHTTPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -16,10 +101,11 @@ class Serie0(BaseModel): http_3: List[str] = FieldInfo(alias="HTTP/3") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupHTTPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_ip_version_response.py b/src/cloudflare/types/radar/http/timeseries_group_ip_version_response.py index 560271c2fd8..e889221f044 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_ip_version_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_ip_version_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupIPVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupIPVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -14,10 +99,11 @@ class Serie0(BaseModel): i_pv6: List[str] = FieldInfo(alias="IPv6") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupIPVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_os_response.py b/src/cloudflare/types/radar/http/timeseries_group_os_response.py index 717cffd93ea..a6aa9c38b9a 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_os_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_os_response.py @@ -1,14 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import TYPE_CHECKING, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupOSResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupOSResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -18,6 +105,7 @@ def __getattr__(self, attr: str) -> List[str]: ... class TimeseriesGroupOSResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_post_quantum_response.py b/src/cloudflare/types/radar/http/timeseries_group_post_quantum_response.py index 17c145551b4..353b8aa1893 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_post_quantum_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_post_quantum_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupPostQuantumResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupPostQuantumResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -14,10 +99,11 @@ class Serie0(BaseModel): supported: List[str] = FieldInfo(alias="SUPPORTED") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupPostQuantumResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/timeseries_group_tls_version_response.py b/src/cloudflare/types/radar/http/timeseries_group_tls_version_response.py index 5f79831e6cc..97a4fb8670d 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_tls_version_response.py +++ b/src/cloudflare/types/radar/http/timeseries_group_tls_version_response.py @@ -1,16 +1,101 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupTLSVersionResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupTLSVersionResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] tls_1_0: List[str] = FieldInfo(alias="TLS 1.0") @@ -24,6 +109,7 @@ class Serie0(BaseModel): class TimeseriesGroupTLSVersionResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/http/top_browser_family_response.py b/src/cloudflare/types/radar/http/top_browser_family_response.py index 07776d8e47d..aa1ca37b2c1 100644 --- a/src/cloudflare/types/radar/http/top_browser_family_response.py +++ b/src/cloudflare/types/radar/http/top_browser_family_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "TopBrowserFamilyResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" - level: Optional[int] = None + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -63,5 +93,6 @@ class Top0(BaseModel): class TopBrowserFamilyResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http/top_browser_response.py b/src/cloudflare/types/radar/http/top_browser_response.py index 6499e5ba955..62809424079 100644 --- a/src/cloudflare/types/radar/http/top_browser_response.py +++ b/src/cloudflare/types/radar/http/top_browser_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopBrowserResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopBrowserResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -56,5 +93,6 @@ class Top0(BaseModel): class TopBrowserResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/http_timeseries_response.py b/src/cloudflare/types/radar/http_timeseries_response.py index 6b45e4c117c..a756b7bdeca 100644 --- a/src/cloudflare/types/radar/http_timeseries_response.py +++ b/src/cloudflare/types/radar/http_timeseries_response.py @@ -1,69 +1,105 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel +from .http_timeseries_response import UnnamedTypeWithobjectParent3UnnamedTypeWithobjectParent3Item __all__ = [ "HTTPTimeseriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", - "Serie0", + "MetaDateRange", + "MetaUnit", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" - level: Optional[int] = None + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. -class Serie0(BaseModel): - timestamps: List[datetime] + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - values: List[str] + units: List[MetaUnit] + """Measurement units for the results.""" class HTTPTimeseriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" - serie_0: Serie0 + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> UnnamedTypeWithobjectParent3UnnamedTypeWithobjectParent3Item: ... diff --git a/src/cloudflare/types/radar/leaked_credentials/summary_bot_class_response.py b/src/cloudflare/types/radar/leaked_credentials/summary_bot_class_response.py index d4c5847ae8d..558d9f18035 100644 --- a/src/cloudflare/types/radar/leaked_credentials/summary_bot_class_response.py +++ b/src/cloudflare/types/radar/leaked_credentials/summary_bot_class_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryBotClassResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): bot: str + """A numeric string.""" human: str + """A numeric string.""" class SummaryBotClassResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/leaked_credentials/summary_compromised_response.py b/src/cloudflare/types/radar/leaked_credentials/summary_compromised_response.py index 5e7f527a3ab..6ff324a28d8 100644 --- a/src/cloudflare/types/radar/leaked_credentials/summary_compromised_response.py +++ b/src/cloudflare/types/radar/leaked_credentials/summary_compromised_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,60 +11,90 @@ __all__ = [ "SummaryCompromisedResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): clean: str = FieldInfo(alias="CLEAN") + """A numeric string.""" compromised: str = FieldInfo(alias="COMPROMISED") + """A numeric string.""" class SummaryCompromisedResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/leaked_credentials/timeseries_group_bot_class_response.py b/src/cloudflare/types/radar/leaked_credentials/timeseries_group_bot_class_response.py index 8e2d5aa1a80..b8a2a75ea40 100644 --- a/src/cloudflare/types/radar/leaked_credentials/timeseries_group_bot_class_response.py +++ b/src/cloudflare/types/radar/leaked_credentials/timeseries_group_bot_class_response.py @@ -1,10 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupBotClassResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupBotClassResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -12,10 +99,11 @@ class Serie0(BaseModel): human: List[str] - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupBotClassResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/leaked_credentials/timeseries_group_compromised_response.py b/src/cloudflare/types/radar/leaked_credentials/timeseries_group_compromised_response.py index 43fa8946832..cfe2f3b9609 100644 --- a/src/cloudflare/types/radar/leaked_credentials/timeseries_group_compromised_response.py +++ b/src/cloudflare/types/radar/leaked_credentials/timeseries_group_compromised_response.py @@ -1,12 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TimeseriesGroupCompromisedResponse", "Serie0"] +__all__ = [ + "TimeseriesGroupCompromisedResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -14,10 +99,11 @@ class Serie0(BaseModel): compromised: List[str] = FieldInfo(alias="COMPROMISED") - timestamps: List[str] + timestamps: List[datetime] class TimeseriesGroupCompromisedResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/netflow_summary_response.py b/src/cloudflare/types/radar/netflow_summary_response.py index bfaf0077229..0daf646347e 100644 --- a/src/cloudflare/types/radar/netflow_summary_response.py +++ b/src/cloudflare/types/radar/netflow_summary_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,56 +11,90 @@ __all__ = [ "NetflowSummaryResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): http: str = FieldInfo(alias="HTTP") + """A numeric string.""" other: str = FieldInfo(alias="OTHER") + """A numeric string.""" class NetflowSummaryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/netflow_timeseries_response.py b/src/cloudflare/types/radar/netflow_timeseries_response.py index 99701458c4d..9f9249d0e8e 100644 --- a/src/cloudflare/types/radar/netflow_timeseries_response.py +++ b/src/cloudflare/types/radar/netflow_timeseries_response.py @@ -1,7 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,87 @@ __all__ = [ "NetflowTimeseriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Serie0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -65,5 +102,6 @@ class Serie0(BaseModel): class NetflowTimeseriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/netflows/top_ases_response.py b/src/cloudflare/types/radar/netflows/top_ases_response.py index 90b022f899f..f658a2f4e8d 100644 --- a/src/cloudflare/types/radar/netflows/top_ases_response.py +++ b/src/cloudflare/types/radar/netflows/top_ases_response.py @@ -1,12 +1,88 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopAsesResponse", "Top0"] +__all__ = [ + "TopAsesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -15,7 +91,11 @@ class Top0(BaseModel): client_as_name: str = FieldInfo(alias="clientASName") value: str + """A numeric string.""" class TopAsesResponse(BaseModel): + meta: Meta + """Metadata for the results.""" + top_0: List[Top0] diff --git a/src/cloudflare/types/radar/netflows/top_locations_response.py b/src/cloudflare/types/radar/netflows/top_locations_response.py index fc168e7c58a..be6919353f1 100644 --- a/src/cloudflare/types/radar/netflows/top_locations_response.py +++ b/src/cloudflare/types/radar/netflows/top_locations_response.py @@ -1,12 +1,88 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopLocationsResponse", "Top0"] +__all__ = [ + "TopLocationsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -15,7 +91,11 @@ class Top0(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class TopLocationsResponse(BaseModel): + meta: Meta + """Metadata for the results.""" + top_0: List[Top0] diff --git a/src/cloudflare/types/radar/quality/iqi_summary_response.py b/src/cloudflare/types/radar/quality/iqi_summary_response.py index 3e241c1ed90..05764affc48 100644 --- a/src/cloudflare/types/radar/quality/iqi_summary_response.py +++ b/src/cloudflare/types/radar/quality/iqi_summary_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,78 @@ __all__ = [ "IQISummaryResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): @@ -67,5 +95,6 @@ class Summary0(BaseModel): class IQISummaryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/quality/iqi_timeseries_groups_response.py b/src/cloudflare/types/radar/quality/iqi_timeseries_groups_response.py index 1f4fca310a9..dcdb17da39a 100644 --- a/src/cloudflare/types/radar/quality/iqi_timeseries_groups_response.py +++ b/src/cloudflare/types/radar/quality/iqi_timeseries_groups_response.py @@ -1,10 +1,97 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["IQITimeseriesGroupsResponse", "Serie0"] +__all__ = [ + "IQITimeseriesGroupsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -18,6 +105,7 @@ class Serie0(BaseModel): class IQITimeseriesGroupsResponse(BaseModel): - meta: object + meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/quality/speed/top_ases_response.py b/src/cloudflare/types/radar/quality/speed/top_ases_response.py index a67ff9d1ba8..e519fcdb079 100644 --- a/src/cloudflare/types/radar/quality/speed/top_ases_response.py +++ b/src/cloudflare/types/radar/quality/speed/top_ases_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["TopAsesResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopAsesResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,29 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + - level: Optional[int] = None +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -72,5 +109,6 @@ class Top0(BaseModel): class TopAsesResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/quality/speed/top_locations_response.py b/src/cloudflare/types/radar/quality/speed/top_locations_response.py index 37420438e16..e29c78c247d 100644 --- a/src/cloudflare/types/radar/quality/speed/top_locations_response.py +++ b/src/cloudflare/types/radar/quality/speed/top_locations_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,49 +11,78 @@ __all__ = [ "TopLocationsResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" - level: Optional[int] = None + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -79,5 +109,6 @@ class Top0(BaseModel): class TopLocationsResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/quality/speed_histogram_response.py b/src/cloudflare/types/radar/quality/speed_histogram_response.py index 61d0fbc669e..620208648bc 100644 --- a/src/cloudflare/types/radar/quality/speed_histogram_response.py +++ b/src/cloudflare/types/radar/quality/speed_histogram_response.py @@ -1,12 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["SpeedHistogramResponse", "Histogram0"] +__all__ = [ + "SpeedHistogramResponse", + "Histogram0", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] class Histogram0(BaseModel): @@ -17,7 +27,79 @@ class Histogram0(BaseModel): bucket_min: List[str] = FieldInfo(alias="bucketMin") +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + bucket_size: int = FieldInfo(alias="bucketSize") + """The width for every bucket in the histogram.""" + + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + total_tests: List[int] = FieldInfo(alias="totalTests") + + units: List[MetaUnit] + """Measurement units for the results.""" + + class SpeedHistogramResponse(BaseModel): histogram_0: Histogram0 - meta: object + meta: Meta + """Metadata for the results.""" diff --git a/src/cloudflare/types/radar/quality/speed_summary_response.py b/src/cloudflare/types/radar/quality/speed_summary_response.py index af59a84fb16..51704e28746 100644 --- a/src/cloudflare/types/radar/quality/speed_summary_response.py +++ b/src/cloudflare/types/radar/quality/speed_summary_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,78 @@ __all__ = [ "SpeedSummaryResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): @@ -75,5 +103,6 @@ class Summary0(BaseModel): class SpeedSummaryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/radar_email_summary.py b/src/cloudflare/types/radar/radar_email_summary.py index 19a29a852e2..762f810b5d5 100644 --- a/src/cloudflare/types/radar/radar_email_summary.py +++ b/src/cloudflare/types/radar/radar_email_summary.py @@ -9,7 +9,10 @@ class RadarEmailSummary(BaseModel): fail: str = FieldInfo(alias="FAIL") + """A numeric string.""" none: str = FieldInfo(alias="NONE") + """A numeric string.""" pass_: str = FieldInfo(alias="PASS") + """A numeric string.""" diff --git a/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py index 76ac2a31de8..c701e25c647 100644 --- a/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py +++ b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py @@ -2,12 +2,45 @@ from typing import TYPE_CHECKING, List, Union from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["InternetServiceTimeseriesGroupsResponse", "Meta", "MetaDateRange", "Serie0"] +__all__ = [ + "InternetServiceTimeseriesGroupsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" class MetaDateRange(BaseModel): @@ -18,12 +51,51 @@ class MetaDateRange(BaseModel): """Adjusted start of date range.""" +class MetaUnit(BaseModel): + name: str + + value: str + + class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" + class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -34,5 +106,6 @@ def __getattr__(self, attr: str) -> List[Union[str, float]]: ... class InternetServiceTimeseriesGroupsResponse(BaseModel): meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ranking/internet_service_top_response.py b/src/cloudflare/types/radar/ranking/internet_service_top_response.py index 0559e8fb43a..dbd9337ba64 100644 --- a/src/cloudflare/types/radar/ranking/internet_service_top_response.py +++ b/src/cloudflare/types/radar/ranking/internet_service_top_response.py @@ -1,22 +1,88 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["InternetServiceTopResponse", "Meta", "MetaTop0", "Top0"] +__all__ = [ + "InternetServiceTopResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] -class MetaTop0(BaseModel): - date: str +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") - service_category: str = FieldInfo(alias="serviceCategory") + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - top_0: MetaTop0 + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): diff --git a/src/cloudflare/types/radar/ranking_timeseries_groups_response.py b/src/cloudflare/types/radar/ranking_timeseries_groups_response.py index 804dbdab1cb..109b0c8f1ee 100644 --- a/src/cloudflare/types/radar/ranking_timeseries_groups_response.py +++ b/src/cloudflare/types/radar/ranking_timeseries_groups_response.py @@ -2,12 +2,45 @@ from typing import TYPE_CHECKING, List, Union from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["RankingTimeseriesGroupsResponse", "Meta", "MetaDateRange", "Serie0"] +__all__ = [ + "RankingTimeseriesGroupsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" class MetaDateRange(BaseModel): @@ -18,12 +51,51 @@ class MetaDateRange(BaseModel): """Adjusted start of date range.""" +class MetaUnit(BaseModel): + name: str + + value: str + + class Meta(BaseModel): + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" + class Serie0(BaseModel): - timestamps: List[str] + timestamps: List[datetime] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. @@ -34,5 +106,6 @@ def __getattr__(self, attr: str) -> List[Union[str, float]]: ... class RankingTimeseriesGroupsResponse(BaseModel): meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ranking_top_response.py b/src/cloudflare/types/radar/ranking_top_response.py index 83c7e56dfd1..ff98b869e2d 100644 --- a/src/cloudflare/types/radar/ranking_top_response.py +++ b/src/cloudflare/types/radar/ranking_top_response.py @@ -1,20 +1,89 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ..._models import BaseModel -__all__ = ["RankingTopResponse", "Meta", "MetaTop0", "Top0", "Top0Category"] +__all__ = [ + "RankingTopResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", + "Top0Category", +] -class MetaTop0(BaseModel): - date: str +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - top_0: MetaTop0 + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0Category(BaseModel): diff --git a/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py index 945a2b60827..669e4362ac4 100644 --- a/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py +++ b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,42 +11,44 @@ __all__ = [ "UserAgentDirectiveResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" class MetaUnit(BaseModel): @@ -55,15 +58,31 @@ class MetaUnit(BaseModel): class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - units: Optional[List[MetaUnit]] = None + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -78,5 +97,6 @@ class Top0(BaseModel): class UserAgentDirectiveResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py b/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py index 10e1d0c48ba..f4324d817e5 100644 --- a/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py +++ b/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,42 +11,44 @@ __all__ = [ "TopDomainCategoriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" class MetaUnit(BaseModel): @@ -55,15 +58,31 @@ class MetaUnit(BaseModel): class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - last_updated: str = FieldInfo(alias="lastUpdated") + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" - normalization: str + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - units: Optional[List[MetaUnit]] = None + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -74,5 +93,6 @@ class Top0(BaseModel): class TopDomainCategoriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/search_global_params.py b/src/cloudflare/types/radar/search_global_params.py index 0d8cb341cca..e0b1c49791a 100644 --- a/src/cloudflare/types/radar/search_global_params.py +++ b/src/cloudflare/types/radar/search_global_params.py @@ -14,13 +14,13 @@ class SearchGlobalParams(TypedDict, total=False): query: Required[str] """Search for locations, autonomous systems and reports.""" - exclude: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] + exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] """Search types excluded from results.""" format: Literal["JSON", "CSV"] """Format in which results will be returned.""" - include: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] + include: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] """Search types included in results.""" limit: int diff --git a/src/cloudflare/types/radar/tcp_resets_timeout_summary_response.py b/src/cloudflare/types/radar/tcp_resets_timeout_summary_response.py index f38a9c7df46..a0fc24ac0a5 100644 --- a/src/cloudflare/types/radar/tcp_resets_timeout_summary_response.py +++ b/src/cloudflare/types/radar/tcp_resets_timeout_summary_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,47 +11,78 @@ __all__ = [ "TCPResetsTimeoutSummaryResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Summary0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" - level: Optional[int] = None + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Summary0(BaseModel): @@ -84,5 +116,6 @@ class Summary0(BaseModel): class TCPResetsTimeoutSummaryResponse(BaseModel): meta: Meta + """Metadata for the results.""" summary_0: Summary0 diff --git a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py index b6ab06c0b94..6ccb96f7790 100644 --- a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py +++ b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py @@ -1,7 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,51 +11,87 @@ __all__ = [ "TCPResetsTimeoutTimeseriesGroupsResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Serie0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] - level: Optional[int] = None + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """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/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + units: List[MetaUnit] + """Measurement units for the results.""" class Serie0(BaseModel): @@ -73,5 +110,6 @@ class Serie0(BaseModel): class TCPResetsTimeoutTimeseriesGroupsResponse(BaseModel): meta: Meta + """Metadata for the results.""" serie_0: Serie0 diff --git a/src/cloudflare/types/radar/traffic_anomalies/location_get_response.py b/src/cloudflare/types/radar/traffic_anomalies/location_get_response.py index 3cf6ca01da7..fdc6a2ff010 100644 --- a/src/cloudflare/types/radar/traffic_anomalies/location_get_response.py +++ b/src/cloudflare/types/radar/traffic_anomalies/location_get_response.py @@ -15,6 +15,7 @@ class TrafficAnomaly(BaseModel): client_country_name: str = FieldInfo(alias="clientCountryName") value: str + """A numeric string.""" class LocationGetResponse(BaseModel): diff --git a/src/cloudflare/types/radar/traffic_anomaly_get_response.py b/src/cloudflare/types/radar/traffic_anomaly_get_response.py index ba231bfa22c..3002910ed4c 100644 --- a/src/cloudflare/types/radar/traffic_anomaly_get_response.py +++ b/src/cloudflare/types/radar/traffic_anomaly_get_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime from pydantic import Field as FieldInfo @@ -46,7 +47,7 @@ class TrafficAnomaly(BaseModel): asn_details: Optional[TrafficAnomalyASNDetails] = FieldInfo(alias="asnDetails", default=None) - end_date: Optional[str] = FieldInfo(alias="endDate", default=None) + end_date: Optional[datetime] = FieldInfo(alias="endDate", default=None) location_details: Optional[TrafficAnomalyLocationDetails] = FieldInfo(alias="locationDetails", default=None) diff --git a/src/cloudflare/types/radar/verified_bots/top_bots_response.py b/src/cloudflare/types/radar/verified_bots/top_bots_response.py index 2e3ffc6a653..c75d3845bcd 100644 --- a/src/cloudflare/types/radar/verified_bots/top_bots_response.py +++ b/src/cloudflare/types/radar/verified_bots/top_bots_response.py @@ -2,20 +2,21 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["TopBotsResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", "Top0"] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" +__all__ = [ + "TopBotsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Top0", +] class MetaConfidenceInfoAnnotation(BaseModel): @@ -23,27 +24,65 @@ class MetaConfidenceInfoAnnotation(BaseModel): description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str - level: Optional[int] = None + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): @@ -54,9 +93,11 @@ class Top0(BaseModel): bot_owner: str = FieldInfo(alias="botOwner") value: str + """A numeric string.""" class TopBotsResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/radar/verified_bots/top_categories_response.py b/src/cloudflare/types/radar/verified_bots/top_categories_response.py index 46260e454ca..ddabfea09b7 100644 --- a/src/cloudflare/types/radar/verified_bots/top_categories_response.py +++ b/src/cloudflare/types/radar/verified_bots/top_categories_response.py @@ -2,6 +2,7 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -10,56 +11,89 @@ __all__ = [ "TopCategoriesResponse", "Meta", - "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", "Top0", ] -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - class MetaConfidenceInfoAnnotation(BaseModel): data_source: str = FieldInfo(alias="dataSource") description: str + end_date: datetime = FieldInfo(alias="endDate") + event_type: str = FieldInfo(alias="eventType") is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + linked_url: str = FieldInfo(alias="linkedUrl") - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + start_date: datetime = FieldInfo(alias="startDate") class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" - level: Optional[int] = None + +class MetaUnit(BaseModel): + name: str + + value: str class Meta(BaseModel): + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" class Top0(BaseModel): bot_category: str = FieldInfo(alias="botCategory") value: str + """A numeric string.""" class TopCategoriesResponse(BaseModel): meta: Meta + """Metadata for the results.""" top_0: List[Top0] diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index 457b933d929..34df410f1f4 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -1963,11 +1963,11 @@ class SetConfigRuleActionParameters(TypedDict, total=False): opportunistic_encryption: bool """Turn on or off Opportunistic Encryption.""" - polish: Literal["off", "lossless", "lossy"] + polish: Literal["off", "lossless", "lossy", "webp"] """Configure the Polish level.""" rocket_loader: bool - """Turn on or off Rocket Loader""" + """Turn on or off Rocket Loader.""" security_level: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] """Configure the Security Level.""" @@ -2394,12 +2394,12 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal class SetCacheSettingsRuleActionParametersCacheKey(TypedDict, total=False): cache_by_device_type: bool - """Separate cached content based on the visitor’s device type""" + """Separate cached content based on the visitor’s device type.""" cache_deception_armor: bool """ Protect from web cache deception attacks while allowing static assets to be - cached + cached. """ custom_key: SetCacheSettingsRuleActionParametersCacheKeyCustomKey @@ -2440,7 +2440,7 @@ class SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange( _SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeReservedKeywords, total=False ): to: Required[int] - """response status code upper bound""" + """Response status code upper bound.""" class SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL(TypedDict, total=False): @@ -2456,7 +2456,7 @@ class SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL(TypedDict, total= """The range of status codes used to apply the selected mode.""" status_code_value: int - """Set the ttl for responses with this specific status code""" + """Set the TTL for responses with this specific status code.""" class SetCacheSettingsRuleActionParametersEdgeTTL(TypedDict, total=False): @@ -2464,10 +2464,10 @@ class SetCacheSettingsRuleActionParametersEdgeTTL(TypedDict, total=False): """The TTL (in seconds) if you choose override_origin mode.""" mode: Required[Literal["respect_origin", "bypass_by_default", "override_origin"]] - """edge ttl options""" + """Edge TTL options.""" status_code_ttl: Required[Iterable[SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL]] - """List of single status codes, or status code ranges to apply the selected mode""" + """List of single status codes, or status code ranges to apply the selected mode.""" class SetCacheSettingsRuleActionParametersServeStale(TypedDict, total=False): @@ -2521,7 +2521,7 @@ class SetCacheSettingsRuleActionParameters(TypedDict, total=False): origin_error_page_passthru: bool """Generate Cloudflare error pages from issues sent from the origin server. - When on, error pages will trigger for issues from the origin + When on, error pages will trigger for issues from the origin. """ read_timeout: int diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 4cd774ad983..31aa6f96dbd 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -2002,11 +2002,11 @@ class SetConfigRuleActionParameters(TypedDict, total=False): opportunistic_encryption: bool """Turn on or off Opportunistic Encryption.""" - polish: Literal["off", "lossless", "lossy"] + polish: Literal["off", "lossless", "lossy", "webp"] """Configure the Polish level.""" rocket_loader: bool - """Turn on or off Rocket Loader""" + """Turn on or off Rocket Loader.""" security_level: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] """Configure the Security Level.""" @@ -2439,12 +2439,12 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal class SetCacheSettingsRuleActionParametersCacheKey(TypedDict, total=False): cache_by_device_type: bool - """Separate cached content based on the visitor’s device type""" + """Separate cached content based on the visitor’s device type.""" cache_deception_armor: bool """ Protect from web cache deception attacks while allowing static assets to be - cached + cached. """ custom_key: SetCacheSettingsRuleActionParametersCacheKeyCustomKey @@ -2485,7 +2485,7 @@ class SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange( _SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeReservedKeywords, total=False ): to: Required[int] - """response status code upper bound""" + """Response status code upper bound.""" class SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL(TypedDict, total=False): @@ -2501,7 +2501,7 @@ class SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL(TypedDict, total= """The range of status codes used to apply the selected mode.""" status_code_value: int - """Set the ttl for responses with this specific status code""" + """Set the TTL for responses with this specific status code.""" class SetCacheSettingsRuleActionParametersEdgeTTL(TypedDict, total=False): @@ -2509,10 +2509,10 @@ class SetCacheSettingsRuleActionParametersEdgeTTL(TypedDict, total=False): """The TTL (in seconds) if you choose override_origin mode.""" mode: Required[Literal["respect_origin", "bypass_by_default", "override_origin"]] - """edge ttl options""" + """Edge TTL options.""" status_code_ttl: Required[Iterable[SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL]] - """List of single status codes, or status code ranges to apply the selected mode""" + """List of single status codes, or status code ranges to apply the selected mode.""" class SetCacheSettingsRuleActionParametersServeStale(TypedDict, total=False): @@ -2566,7 +2566,7 @@ class SetCacheSettingsRuleActionParameters(TypedDict, total=False): origin_error_page_passthru: bool """Generate Cloudflare error pages from issues sent from the origin server. - When on, error pages will trigger for issues from the origin + When on, error pages will trigger for issues from the origin. """ read_timeout: int diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule.py b/src/cloudflare/types/rulesets/set_cache_settings_rule.py index 130af71f799..9f62db2a262 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule.py @@ -179,12 +179,12 @@ class ActionParametersCacheKeyCustomKey(BaseModel): class ActionParametersCacheKey(BaseModel): cache_by_device_type: Optional[bool] = None - """Separate cached content based on the visitor’s device type""" + """Separate cached content based on the visitor’s device type.""" cache_deception_armor: Optional[bool] = None """ Protect from web cache deception attacks while allowing static assets to be - cached + cached. """ custom_key: Optional[ActionParametersCacheKeyCustomKey] = None @@ -214,10 +214,10 @@ class ActionParametersCacheReserve(BaseModel): class ActionParametersEdgeTTLStatusCodeTTLStatusCodeRange(BaseModel): from_: int = FieldInfo(alias="from") - """response status code lower bound""" + """Response status code lower bound.""" to: int - """response status code upper bound""" + """Response status code upper bound.""" class ActionParametersEdgeTTLStatusCodeTTL(BaseModel): @@ -233,7 +233,7 @@ class ActionParametersEdgeTTLStatusCodeTTL(BaseModel): """The range of status codes used to apply the selected mode.""" status_code_value: Optional[int] = None - """Set the ttl for responses with this specific status code""" + """Set the TTL for responses with this specific status code.""" class ActionParametersEdgeTTL(BaseModel): @@ -241,10 +241,10 @@ class ActionParametersEdgeTTL(BaseModel): """The TTL (in seconds) if you choose override_origin mode.""" mode: Literal["respect_origin", "bypass_by_default", "override_origin"] - """edge ttl options""" + """Edge TTL options.""" status_code_ttl: List[ActionParametersEdgeTTLStatusCodeTTL] - """List of single status codes, or status code ranges to apply the selected mode""" + """List of single status codes, or status code ranges to apply the selected mode.""" class ActionParametersServeStale(BaseModel): @@ -298,7 +298,7 @@ class ActionParameters(BaseModel): origin_error_page_passthru: Optional[bool] = None """Generate Cloudflare error pages from issues sent from the origin server. - When on, error pages will trigger for issues from the origin + When on, error pages will trigger for issues from the origin. """ read_timeout: Optional[int] = None diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py index 60790c69dd4..5bc1c8ef884 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py @@ -177,12 +177,12 @@ class ActionParametersCacheKeyCustomKey(TypedDict, total=False): class ActionParametersCacheKey(TypedDict, total=False): cache_by_device_type: bool - """Separate cached content based on the visitor’s device type""" + """Separate cached content based on the visitor’s device type.""" cache_deception_armor: bool """ Protect from web cache deception attacks while allowing static assets to be - cached + cached. """ custom_key: ActionParametersCacheKeyCustomKey @@ -223,7 +223,7 @@ class ActionParametersEdgeTTLStatusCodeTTLStatusCodeRange( _ActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeReservedKeywords, total=False ): to: Required[int] - """response status code upper bound""" + """Response status code upper bound.""" class ActionParametersEdgeTTLStatusCodeTTL(TypedDict, total=False): @@ -239,7 +239,7 @@ class ActionParametersEdgeTTLStatusCodeTTL(TypedDict, total=False): """The range of status codes used to apply the selected mode.""" status_code_value: int - """Set the ttl for responses with this specific status code""" + """Set the TTL for responses with this specific status code.""" class ActionParametersEdgeTTL(TypedDict, total=False): @@ -247,10 +247,10 @@ class ActionParametersEdgeTTL(TypedDict, total=False): """The TTL (in seconds) if you choose override_origin mode.""" mode: Required[Literal["respect_origin", "bypass_by_default", "override_origin"]] - """edge ttl options""" + """Edge TTL options.""" status_code_ttl: Required[Iterable[ActionParametersEdgeTTLStatusCodeTTL]] - """List of single status codes, or status code ranges to apply the selected mode""" + """List of single status codes, or status code ranges to apply the selected mode.""" class ActionParametersServeStale(TypedDict, total=False): @@ -304,7 +304,7 @@ class ActionParameters(TypedDict, total=False): origin_error_page_passthru: bool """Generate Cloudflare error pages from issues sent from the origin server. - When on, error pages will trigger for issues from the origin + When on, error pages will trigger for issues from the origin. """ read_timeout: int diff --git a/src/cloudflare/types/rulesets/set_config_rule.py b/src/cloudflare/types/rulesets/set_config_rule.py index 82df70baaaa..5c61770902c 100644 --- a/src/cloudflare/types/rulesets/set_config_rule.py +++ b/src/cloudflare/types/rulesets/set_config_rule.py @@ -55,11 +55,11 @@ class ActionParameters(BaseModel): opportunistic_encryption: Optional[bool] = None """Turn on or off Opportunistic Encryption.""" - polish: Optional[Literal["off", "lossless", "lossy"]] = None + polish: Optional[Literal["off", "lossless", "lossy", "webp"]] = None """Configure the Polish level.""" rocket_loader: Optional[bool] = None - """Turn on or off Rocket Loader""" + """Turn on or off Rocket Loader.""" security_level: Optional[Literal["off", "essentially_off", "low", "medium", "high", "under_attack"]] = None """Configure the Security Level.""" diff --git a/src/cloudflare/types/rulesets/set_config_rule_param.py b/src/cloudflare/types/rulesets/set_config_rule_param.py index eb134880446..4a917e3c61b 100644 --- a/src/cloudflare/types/rulesets/set_config_rule_param.py +++ b/src/cloudflare/types/rulesets/set_config_rule_param.py @@ -61,11 +61,11 @@ class ActionParameters(TypedDict, total=False): opportunistic_encryption: bool """Turn on or off Opportunistic Encryption.""" - polish: Literal["off", "lossless", "lossy"] + polish: Literal["off", "lossless", "lossy", "webp"] """Configure the Polish level.""" rocket_loader: bool - """Turn on or off Rocket Loader""" + """Turn on or off Rocket Loader.""" security_level: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] """Configure the Security Level.""" diff --git a/src/cloudflare/types/schema_validation/schema_create_params.py b/src/cloudflare/types/schema_validation/schema_create_params.py index 2ce124ae5dc..585316e7cf3 100644 --- a/src/cloudflare/types/schema_validation/schema_create_params.py +++ b/src/cloudflare/types/schema_validation/schema_create_params.py @@ -20,5 +20,5 @@ class SchemaCreateParams(TypedDict, total=False): source: Required[str] """The raw schema, e.g., the OpenAPI schema, either as JSON or YAML""" - validation_enabled: bool + validation_enabled: Required[bool] """An indicator if this schema is enabled""" diff --git a/src/cloudflare/types/shared/member.py b/src/cloudflare/types/shared/member.py index 5391a7acbb1..75e0f61ac91 100644 --- a/src/cloudflare/types/shared/member.py +++ b/src/cloudflare/types/shared/member.py @@ -27,13 +27,13 @@ class PolicyPermissionGroupMeta(BaseModel): class PolicyPermissionGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the permission group.""" meta: Optional[PolicyPermissionGroupMeta] = None """Attributes associated to the permission group.""" name: Optional[str] = None - """Name of the group.""" + """Name of the permission group.""" class PolicyResourceGroupScopeObject(BaseModel): @@ -63,7 +63,7 @@ class PolicyResourceGroupMeta(BaseModel): class PolicyResourceGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the resource group.""" scope: List[PolicyResourceGroupScope] """The scope associated to the resource group""" diff --git a/src/cloudflare/types/shared/token_policy.py b/src/cloudflare/types/shared/token_policy.py index 10909830a01..778cb891f5d 100644 --- a/src/cloudflare/types/shared/token_policy.py +++ b/src/cloudflare/types/shared/token_policy.py @@ -16,13 +16,13 @@ class PermissionGroupMeta(BaseModel): class PermissionGroup(BaseModel): id: str - """Identifier of the group.""" + """Identifier of the permission group.""" meta: Optional[PermissionGroupMeta] = None """Attributes associated to the permission group.""" name: Optional[str] = None - """Name of the group.""" + """Name of the permission group.""" class TokenPolicy(BaseModel): diff --git a/src/cloudflare/types/shared_params/token_policy.py b/src/cloudflare/types/shared_params/token_policy.py index 2a6da587407..e2a11eec39a 100644 --- a/src/cloudflare/types/shared_params/token_policy.py +++ b/src/cloudflare/types/shared_params/token_policy.py @@ -16,7 +16,7 @@ class PermissionGroupMeta(TypedDict, total=False): class PermissionGroup(TypedDict, total=False): id: Required[str] - """Identifier of the group.""" + """Identifier of the permission group.""" meta: PermissionGroupMeta """Attributes associated to the permission group.""" diff --git a/src/cloudflare/types/spectrum/edge_ips.py b/src/cloudflare/types/spectrum/edge_ips.py index 336cf5a04be..4cd5c450300 100644 --- a/src/cloudflare/types/spectrum/edge_ips.py +++ b/src/cloudflare/types/spectrum/edge_ips.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["EdgeIPs", "UnionMember0", "UnionMember1"] +__all__ = ["EdgeIPs", "Dynamic", "Static"] -class UnionMember0(BaseModel): +class Dynamic(BaseModel): connectivity: Optional[Literal["all", "ipv4", "ipv6"]] = None """The IP versions supported for inbound connections on Spectrum anycast IPs.""" @@ -20,7 +20,7 @@ class UnionMember0(BaseModel): """ -class UnionMember1(BaseModel): +class Static(BaseModel): ips: Optional[List[str]] = None """ The array of customer owned IPs we broadcast via anycast for this hostname and @@ -35,4 +35,4 @@ class UnionMember1(BaseModel): """ -EdgeIPs: TypeAlias = Union[UnionMember0, UnionMember1] +EdgeIPs: TypeAlias = Union[Dynamic, Static] diff --git a/src/cloudflare/types/spectrum/edge_ips_param.py b/src/cloudflare/types/spectrum/edge_ips_param.py index ee07525add4..12d73bdcee1 100644 --- a/src/cloudflare/types/spectrum/edge_ips_param.py +++ b/src/cloudflare/types/spectrum/edge_ips_param.py @@ -5,10 +5,10 @@ from typing import List, Union from typing_extensions import Literal, TypeAlias, TypedDict -__all__ = ["EdgeIPsParam", "UnionMember0", "UnionMember1"] +__all__ = ["EdgeIPsParam", "Dynamic", "Static"] -class UnionMember0(TypedDict, total=False): +class Dynamic(TypedDict, total=False): connectivity: Literal["all", "ipv4", "ipv6"] """The IP versions supported for inbound connections on Spectrum anycast IPs.""" @@ -20,7 +20,7 @@ class UnionMember0(TypedDict, total=False): """ -class UnionMember1(TypedDict, total=False): +class Static(TypedDict, total=False): ips: List[str] """ The array of customer owned IPs we broadcast via anycast for this hostname and @@ -35,4 +35,4 @@ class UnionMember1(TypedDict, total=False): """ -EdgeIPsParam: TypeAlias = Union[UnionMember0, UnionMember1] +EdgeIPsParam: TypeAlias = Union[Dynamic, Static] diff --git a/src/cloudflare/types/url_scanner/scan_bulk_create_response.py b/src/cloudflare/types/url_scanner/scan_bulk_create_response.py index 6a554a9878b..99df85a1881 100644 --- a/src/cloudflare/types/url_scanner/scan_bulk_create_response.py +++ b/src/cloudflare/types/url_scanner/scan_bulk_create_response.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from typing_extensions import TypeAlias +from typing_extensions import Literal, TypeAlias from ..._models import BaseModel @@ -25,7 +25,7 @@ class ScanBulkCreateResponseItem(BaseModel): uuid: str """Scan ID.""" - visibility: str + visibility: Literal["public", "unlisted"] """Submitted visibility status.""" options: Optional[ScanBulkCreateResponseItemOptions] = None diff --git a/src/cloudflare/types/url_scanner/scan_create_params.py b/src/cloudflare/types/url_scanner/scan_create_params.py index 66c9cb87385..a53306462fb 100644 --- a/src/cloudflare/types/url_scanner/scan_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_create_params.py @@ -213,6 +213,7 @@ class ScanCreateParams(TypedDict, total=False): "ZM", "ZW", ] + """Country to geo egress from""" customagent: str diff --git a/src/cloudflare/types/url_scanner/scan_create_response.py b/src/cloudflare/types/url_scanner/scan_create_response.py index bd7d74d48de..ba4e034191b 100644 --- a/src/cloudflare/types/url_scanner/scan_create_response.py +++ b/src/cloudflare/types/url_scanner/scan_create_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,7 +19,7 @@ class ScanCreateResponse(BaseModel): message: str result: str - """URL to report.""" + """Public URL to report.""" url: str """Canonical form of submitted URL. Use this if you want to later search by URL.""" @@ -26,7 +27,7 @@ class ScanCreateResponse(BaseModel): uuid: str """Scan ID.""" - visibility: str + visibility: Literal["public", "unlisted"] """Submitted visibility status.""" options: Optional[Options] = None diff --git a/src/cloudflare/types/url_scanner/scan_get_response.py b/src/cloudflare/types/url_scanner/scan_get_response.py index 8d1ef4a39e0..c2acc8e9ffa 100644 --- a/src/cloudflare/types/url_scanner/scan_get_response.py +++ b/src/cloudflare/types/url_scanner/scan_get_response.py @@ -241,7 +241,7 @@ class DataRequestResponseGeoip(BaseModel): geoname_id: str = FieldInfo(alias="geonameId") - ll: List[object] + ll: List[float] region: str diff --git a/src/cloudflare/types/user/__init__.py b/src/cloudflare/types/user/__init__.py index e6436d4c2fb..315f9a5d47b 100644 --- a/src/cloudflare/types/user/__init__.py +++ b/src/cloudflare/types/user/__init__.py @@ -6,7 +6,9 @@ from .organization import Organization as Organization from .user_edit_params import UserEditParams as UserEditParams from .token_list_params import TokenListParams as TokenListParams +from .user_get_response import UserGetResponse as UserGetResponse from .invite_edit_params import InviteEditParams as InviteEditParams +from .user_edit_response import UserEditResponse as UserEditResponse from .token_create_params import TokenCreateParams as TokenCreateParams from .token_update_params import TokenUpdateParams as TokenUpdateParams from .audit_log_list_params import AuditLogListParams as AuditLogListParams diff --git a/src/cloudflare/types/user/user_edit_response.py b/src/cloudflare/types/user/user_edit_response.py new file mode 100644 index 00000000000..c273145becf --- /dev/null +++ b/src/cloudflare/types/user/user_edit_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .organization import Organization + +__all__ = ["UserEditResponse"] + + +class UserEditResponse(BaseModel): + id: Optional[str] = None + """Identifier of the user.""" + + betas: Optional[List[str]] = None + """Lists the betas that the user is participating in.""" + + country: Optional[str] = None + """The country in which the user lives.""" + + first_name: Optional[str] = None + """User's first name""" + + has_business_zones: Optional[bool] = None + """Indicates whether user has any business zones""" + + has_enterprise_zones: Optional[bool] = None + """Indicates whether user has any enterprise zones""" + + has_pro_zones: Optional[bool] = None + """Indicates whether user has any pro zones""" + + last_name: Optional[str] = None + """User's last name""" + + organizations: Optional[List[Organization]] = None + + suspended: Optional[bool] = None + """Indicates whether user has been suspended""" + + telephone: Optional[str] = None + """User's telephone number""" + + two_factor_authentication_enabled: Optional[bool] = None + """Indicates whether two-factor authentication is enabled for the user account. + + Does not apply to API authentication. + """ + + two_factor_authentication_locked: Optional[bool] = None + """ + Indicates whether two-factor authentication is required by one of the accounts + that the user is a member of. + """ + + zipcode: Optional[str] = None + """The zipcode or postal code where the user lives.""" diff --git a/src/cloudflare/types/user/user_get_response.py b/src/cloudflare/types/user/user_get_response.py new file mode 100644 index 00000000000..dae3cff17b6 --- /dev/null +++ b/src/cloudflare/types/user/user_get_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .organization import Organization + +__all__ = ["UserGetResponse"] + + +class UserGetResponse(BaseModel): + id: Optional[str] = None + """Identifier of the user.""" + + betas: Optional[List[str]] = None + """Lists the betas that the user is participating in.""" + + country: Optional[str] = None + """The country in which the user lives.""" + + first_name: Optional[str] = None + """User's first name""" + + has_business_zones: Optional[bool] = None + """Indicates whether user has any business zones""" + + has_enterprise_zones: Optional[bool] = None + """Indicates whether user has any enterprise zones""" + + has_pro_zones: Optional[bool] = None + """Indicates whether user has any pro zones""" + + last_name: Optional[str] = None + """User's last name""" + + organizations: Optional[List[Organization]] = None + + suspended: Optional[bool] = None + """Indicates whether user has been suspended""" + + telephone: Optional[str] = None + """User's telephone number""" + + two_factor_authentication_enabled: Optional[bool] = None + """Indicates whether two-factor authentication is enabled for the user account. + + Does not apply to API authentication. + """ + + two_factor_authentication_locked: Optional[bool] = None + """ + Indicates whether two-factor authentication is required by one of the accounts + that the user is a member of. + """ + + zipcode: Optional[str] = None + """The zipcode or postal code where the user lives.""" diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 51450e5be2c..b34cacf091f 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -39,6 +39,7 @@ "MetadataBindingWorkersBindingKindVersionMetadata", "MetadataBindingWorkersBindingKindSecretsStoreSecret", "MetadataBindingWorkersBindingKindSecretKey", + "MetadataBindingWorkersBindingKindWorkflow", "MetadataMigrations", "MetadataMigrationsWorkersMultipleStepMigrations", "MetadataObservability", @@ -77,18 +78,12 @@ class MetadataAssetsConfig(TypedDict, total=False): is no Worker script. """ - run_worker_first: bool - """When true, requests will always invoke the Worker script. + run_worker_first: List[str] + """Contains a list path rules to control routing to either the Worker or assets. - Otherwise, attempt to serve an asset matching the request, falling back to the - Worker script. - """ - - serve_directly: bool - """ - When true and the incoming request matches an asset, that will be served instead - of invoking the Worker script. When false, requests will always invoke the - Worker script. + Glob (\\**) and negative (!) rules are supported. Rules must start with either '/' + or '!/'. At least one non-negative rule must be provided, and negative rules + have higher precedence than non-negative rules. """ @@ -397,6 +392,29 @@ class MetadataBindingWorkersBindingKindSecretKey(TypedDict, total=False): """ +class MetadataBindingWorkersBindingKindWorkflow(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["workflow"]] + """The kind of resource that the binding provides.""" + + workflow_name: Required[str] + """Name of the Workflow to bind to.""" + + class_name: str + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: str + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + MetadataBinding: TypeAlias = Union[ MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, @@ -420,6 +438,7 @@ class MetadataBindingWorkersBindingKindSecretKey(TypedDict, total=False): MetadataBindingWorkersBindingKindVersionMetadata, MetadataBindingWorkersBindingKindSecretsStoreSecret, MetadataBindingWorkersBindingKindSecretKey, + MetadataBindingWorkersBindingKindWorkflow, ] diff --git a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py index 380abb4364d..59f2909df0a 100644 --- a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py +++ b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py @@ -37,6 +37,7 @@ "SettingsBindingWorkersBindingKindVersionMetadata", "SettingsBindingWorkersBindingKindSecretsStoreSecret", "SettingsBindingWorkersBindingKindSecretKey", + "SettingsBindingWorkersBindingKindWorkflow", "SettingsLimits", "SettingsMigrations", "SettingsMigrationsWorkersMultipleStepMigrations", @@ -350,6 +351,29 @@ class SettingsBindingWorkersBindingKindSecretKey(TypedDict, total=False): """ +class SettingsBindingWorkersBindingKindWorkflow(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["workflow"]] + """The kind of resource that the binding provides.""" + + workflow_name: Required[str] + """Name of the Workflow to bind to.""" + + class_name: str + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: str + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + SettingsBinding: TypeAlias = Union[ SettingsBindingWorkersBindingKindAI, SettingsBindingWorkersBindingKindAnalyticsEngine, @@ -373,6 +397,7 @@ class SettingsBindingWorkersBindingKindSecretKey(TypedDict, total=False): SettingsBindingWorkersBindingKindVersionMetadata, SettingsBindingWorkersBindingKindSecretsStoreSecret, SettingsBindingWorkersBindingKindSecretKey, + SettingsBindingWorkersBindingKindWorkflow, ] diff --git a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py index 0d4bcc5e16d..e1ae8d3a0aa 100644 --- a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py +++ b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py @@ -38,6 +38,7 @@ "BindingWorkersBindingKindVersionMetadata", "BindingWorkersBindingKindSecretsStoreSecret", "BindingWorkersBindingKindSecretKey", + "BindingWorkersBindingKindWorkflow", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -329,6 +330,29 @@ class BindingWorkersBindingKindSecretKey(BaseModel): """ +class BindingWorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -353,6 +377,7 @@ class BindingWorkersBindingKindSecretKey(BaseModel): BindingWorkersBindingKindVersionMetadata, BindingWorkersBindingKindSecretsStoreSecret, BindingWorkersBindingKindSecretKey, + BindingWorkersBindingKindWorkflow, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py b/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py index e0313fa08db..faa3d1d72c2 100644 --- a/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py +++ b/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py @@ -38,6 +38,7 @@ "BindingWorkersBindingKindVersionMetadata", "BindingWorkersBindingKindSecretsStoreSecret", "BindingWorkersBindingKindSecretKey", + "BindingWorkersBindingKindWorkflow", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -329,6 +330,29 @@ class BindingWorkersBindingKindSecretKey(BaseModel): """ +class BindingWorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -353,6 +377,7 @@ class BindingWorkersBindingKindSecretKey(BaseModel): BindingWorkersBindingKindVersionMetadata, BindingWorkersBindingKindSecretsStoreSecret, BindingWorkersBindingKindSecretKey, + BindingWorkersBindingKindWorkflow, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py index 2957b4f2b86..7f81427661f 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -36,6 +36,7 @@ "MetadataBindingWorkersBindingKindVersionMetadata", "MetadataBindingWorkersBindingKindSecretsStoreSecret", "MetadataBindingWorkersBindingKindSecretKey", + "MetadataBindingWorkersBindingKindWorkflow", ] @@ -352,6 +353,29 @@ class MetadataBindingWorkersBindingKindSecretKey(TypedDict, total=False): """ +class MetadataBindingWorkersBindingKindWorkflow(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["workflow"]] + """The kind of resource that the binding provides.""" + + workflow_name: Required[str] + """Name of the Workflow to bind to.""" + + class_name: str + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: str + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + MetadataBinding: TypeAlias = Union[ MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, @@ -375,6 +399,7 @@ class MetadataBindingWorkersBindingKindSecretKey(TypedDict, total=False): MetadataBindingWorkersBindingKindVersionMetadata, MetadataBindingWorkersBindingKindSecretsStoreSecret, MetadataBindingWorkersBindingKindSecretKey, + MetadataBindingWorkersBindingKindWorkflow, ] diff --git a/src/cloudflare/types/workers/scripts/version_create_response.py b/src/cloudflare/types/workers/scripts/version_create_response.py index 64ab094033a..117ad7b82ab 100644 --- a/src/cloudflare/types/workers/scripts/version_create_response.py +++ b/src/cloudflare/types/workers/scripts/version_create_response.py @@ -1,18 +1,468 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from ...._utils import PropertyInfo from ...._models import BaseModel -__all__ = ["VersionCreateResponse"] +__all__ = [ + "VersionCreateResponse", + "Resources", + "ResourcesBindings", + "ResourcesBindingsResult", + "ResourcesBindingsResultWorkersBindingKindAI", + "ResourcesBindingsResultWorkersBindingKindAnalyticsEngine", + "ResourcesBindingsResultWorkersBindingKindAssets", + "ResourcesBindingsResultWorkersBindingKindBrowser", + "ResourcesBindingsResultWorkersBindingKindD1", + "ResourcesBindingsResultWorkersBindingKindDispatchNamespace", + "ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutbound", + "ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutboundWorker", + "ResourcesBindingsResultWorkersBindingKindDurableObjectNamespace", + "ResourcesBindingsResultWorkersBindingKindHyperdrive", + "ResourcesBindingsResultWorkersBindingKindJson", + "ResourcesBindingsResultWorkersBindingKindKVNamespace", + "ResourcesBindingsResultWorkersBindingKindMTLSCertificate", + "ResourcesBindingsResultWorkersBindingKindPlainText", + "ResourcesBindingsResultWorkersBindingKindPipelines", + "ResourcesBindingsResultWorkersBindingKindQueue", + "ResourcesBindingsResultWorkersBindingKindR2Bucket", + "ResourcesBindingsResultWorkersBindingKindSecretText", + "ResourcesBindingsResultWorkersBindingKindService", + "ResourcesBindingsResultWorkersBindingKindTailConsumer", + "ResourcesBindingsResultWorkersBindingKindVectorize", + "ResourcesBindingsResultWorkersBindingKindVersionMetadata", + "ResourcesBindingsResultWorkersBindingKindSecretsStoreSecret", + "ResourcesBindingsResultWorkersBindingKindSecretKey", + "ResourcesBindingsResultWorkersBindingKindWorkflow", + "ResourcesScript", + "ResourcesScriptNamedHandler", + "ResourcesScriptRuntime", + "ResourcesScriptRuntimeLimits", + "Metadata", +] + + +class ResourcesBindingsResultWorkersBindingKindAI(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["ai"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindAnalyticsEngine(BaseModel): + dataset: str + """The name of the dataset to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["analytics_engine"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindAssets(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["assets"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindBrowser(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["browser"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindD1(BaseModel): + id: str + """Identifier of the D1 database to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["d1"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): + environment: Optional[str] = None + """Environment of the outbound worker.""" + + service: Optional[str] = None + """Name of the outbound worker.""" + + +class ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutbound(BaseModel): + params: Optional[List[str]] = None + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: Optional[ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutboundWorker] = None + """Outbound worker.""" + + +class ResourcesBindingsResultWorkersBindingKindDispatchNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace: str + """Namespace to bind to.""" + + type: Literal["dispatch_namespace"] + """The kind of resource that the binding provides.""" + + outbound: Optional[ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutbound] = None + """Outbound worker.""" + + +class ResourcesBindingsResultWorkersBindingKindDurableObjectNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["durable_object_namespace"] + """The kind of resource that the binding provides.""" + + class_name: Optional[str] = None + """The exported class name of the Durable Object.""" + + environment: Optional[str] = None + """The environment of the script_name to bind to.""" + + namespace_id: Optional[str] = None + """Namespace identifier tag.""" + + script_name: Optional[str] = None + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class ResourcesBindingsResultWorkersBindingKindHyperdrive(BaseModel): + id: str + """Identifier of the Hyperdrive connection to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["hyperdrive"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindJson(BaseModel): + json_: str = FieldInfo(alias="json") + """JSON data to use.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["json"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindKVNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace_id: str + """Namespace identifier tag.""" + + type: Literal["kv_namespace"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindMTLSCertificate(BaseModel): + certificate_id: str + """Identifier of the certificate to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["mtls_certificate"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindPlainText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The text value to use.""" + + type: Literal["plain_text"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindPipelines(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + pipeline: str + """Name of the Pipeline to bind to.""" + + type: Literal["pipelines"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindQueue(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + queue_name: str + """Name of the Queue to bind to.""" + + type: Literal["queue"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindR2Bucket(BaseModel): + bucket_name: str + """R2 bucket to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["r2_bucket"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindSecretText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["secret_text"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindService(BaseModel): + environment: str + """Optional environment if the Worker utilizes one.""" + + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Worker to bind to.""" + + type: Literal["service"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindTailConsumer(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Tail Worker to bind to.""" + + type: Literal["tail_consumer"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindVectorize(BaseModel): + index_name: str + """Name of the Vectorize index to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["vectorize"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindVersionMetadata(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["version_metadata"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindSecretsStoreSecret(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + secret_name: str + """Name of the secret in the store.""" + + store_id: str + """ID of the store containing the secret.""" + + type: Literal["secrets_store_secret"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindSecretKey(BaseModel): + algorithm: object + """Algorithm-specific key parameters. + + [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). + """ + + format: Literal["raw", "pkcs8", "spki", "jwk"] + """Data format of the key. + + [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). + """ + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["secret_key"] + """The kind of resource that the binding provides.""" + + usages: List[Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"]] + """Allowed operations with the key. + + [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). + """ + + +class ResourcesBindingsResultWorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + +ResourcesBindingsResult: TypeAlias = Annotated[ + Union[ + ResourcesBindingsResultWorkersBindingKindAI, + ResourcesBindingsResultWorkersBindingKindAnalyticsEngine, + ResourcesBindingsResultWorkersBindingKindAssets, + ResourcesBindingsResultWorkersBindingKindBrowser, + ResourcesBindingsResultWorkersBindingKindD1, + ResourcesBindingsResultWorkersBindingKindDispatchNamespace, + ResourcesBindingsResultWorkersBindingKindDurableObjectNamespace, + ResourcesBindingsResultWorkersBindingKindHyperdrive, + ResourcesBindingsResultWorkersBindingKindJson, + ResourcesBindingsResultWorkersBindingKindKVNamespace, + ResourcesBindingsResultWorkersBindingKindMTLSCertificate, + ResourcesBindingsResultWorkersBindingKindPlainText, + ResourcesBindingsResultWorkersBindingKindPipelines, + ResourcesBindingsResultWorkersBindingKindQueue, + ResourcesBindingsResultWorkersBindingKindR2Bucket, + ResourcesBindingsResultWorkersBindingKindSecretText, + ResourcesBindingsResultWorkersBindingKindService, + ResourcesBindingsResultWorkersBindingKindTailConsumer, + ResourcesBindingsResultWorkersBindingKindVectorize, + ResourcesBindingsResultWorkersBindingKindVersionMetadata, + ResourcesBindingsResultWorkersBindingKindSecretsStoreSecret, + ResourcesBindingsResultWorkersBindingKindSecretKey, + ResourcesBindingsResultWorkersBindingKindWorkflow, + ], + PropertyInfo(discriminator="type"), +] + + +class ResourcesBindings(BaseModel): + result: Optional[List[ResourcesBindingsResult]] = None + """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. + """ + + +class ResourcesScriptNamedHandler(BaseModel): + handlers: Optional[List[str]] = None + + name: Optional[str] = None + + +class ResourcesScript(BaseModel): + etag: Optional[str] = None + + handlers: Optional[List[str]] = None + + last_deployed_from: Optional[str] = None + + named_handlers: Optional[List[ResourcesScriptNamedHandler]] = None + + +class ResourcesScriptRuntimeLimits(BaseModel): + cpu_ms: Optional[int] = None + + +class ResourcesScriptRuntime(BaseModel): + compatibility_date: Optional[str] = None + + compatibility_flags: Optional[List[str]] = None + + limits: Optional[ResourcesScriptRuntimeLimits] = None + + migration_tag: Optional[str] = None + + usage_model: Optional[Literal["bundled", "unbound", "standard"]] = None + + +class Resources(BaseModel): + bindings: Optional[ResourcesBindings] = None + + script: Optional[ResourcesScript] = None + + script_runtime: Optional[ResourcesScriptRuntime] = None + + +class Metadata(BaseModel): + author_email: Optional[str] = None + + author_id: Optional[str] = None + + created_on: Optional[str] = None + + has_preview: Optional[bool] = FieldInfo(alias="hasPreview", default=None) + + modified_on: Optional[str] = None + + source: Optional[ + Literal[ + "unknown", + "api", + "wrangler", + "terraform", + "dash", + "dash_template", + "integration", + "quick_editor", + "playground", + "workersci", + ] + ] = None class VersionCreateResponse(BaseModel): - resources: object + resources: Resources id: Optional[str] = None - metadata: Optional[object] = None + metadata: Optional[Metadata] = None number: Optional[float] = None diff --git a/src/cloudflare/types/workers/scripts/version_get_response.py b/src/cloudflare/types/workers/scripts/version_get_response.py index 9a0dbd121eb..739189bd1ac 100644 --- a/src/cloudflare/types/workers/scripts/version_get_response.py +++ b/src/cloudflare/types/workers/scripts/version_get_response.py @@ -1,17 +1,467 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from ...._utils import PropertyInfo from ...._models import BaseModel -__all__ = ["VersionGetResponse"] +__all__ = [ + "VersionGetResponse", + "Resources", + "ResourcesBindings", + "ResourcesBindingsResult", + "ResourcesBindingsResultWorkersBindingKindAI", + "ResourcesBindingsResultWorkersBindingKindAnalyticsEngine", + "ResourcesBindingsResultWorkersBindingKindAssets", + "ResourcesBindingsResultWorkersBindingKindBrowser", + "ResourcesBindingsResultWorkersBindingKindD1", + "ResourcesBindingsResultWorkersBindingKindDispatchNamespace", + "ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutbound", + "ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutboundWorker", + "ResourcesBindingsResultWorkersBindingKindDurableObjectNamespace", + "ResourcesBindingsResultWorkersBindingKindHyperdrive", + "ResourcesBindingsResultWorkersBindingKindJson", + "ResourcesBindingsResultWorkersBindingKindKVNamespace", + "ResourcesBindingsResultWorkersBindingKindMTLSCertificate", + "ResourcesBindingsResultWorkersBindingKindPlainText", + "ResourcesBindingsResultWorkersBindingKindPipelines", + "ResourcesBindingsResultWorkersBindingKindQueue", + "ResourcesBindingsResultWorkersBindingKindR2Bucket", + "ResourcesBindingsResultWorkersBindingKindSecretText", + "ResourcesBindingsResultWorkersBindingKindService", + "ResourcesBindingsResultWorkersBindingKindTailConsumer", + "ResourcesBindingsResultWorkersBindingKindVectorize", + "ResourcesBindingsResultWorkersBindingKindVersionMetadata", + "ResourcesBindingsResultWorkersBindingKindSecretsStoreSecret", + "ResourcesBindingsResultWorkersBindingKindSecretKey", + "ResourcesBindingsResultWorkersBindingKindWorkflow", + "ResourcesScript", + "ResourcesScriptNamedHandler", + "ResourcesScriptRuntime", + "ResourcesScriptRuntimeLimits", + "Metadata", +] + + +class ResourcesBindingsResultWorkersBindingKindAI(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["ai"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindAnalyticsEngine(BaseModel): + dataset: str + """The name of the dataset to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["analytics_engine"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindAssets(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["assets"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindBrowser(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["browser"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindD1(BaseModel): + id: str + """Identifier of the D1 database to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["d1"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): + environment: Optional[str] = None + """Environment of the outbound worker.""" + + service: Optional[str] = None + """Name of the outbound worker.""" + + +class ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutbound(BaseModel): + params: Optional[List[str]] = None + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: Optional[ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutboundWorker] = None + """Outbound worker.""" + + +class ResourcesBindingsResultWorkersBindingKindDispatchNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace: str + """Namespace to bind to.""" + + type: Literal["dispatch_namespace"] + """The kind of resource that the binding provides.""" + + outbound: Optional[ResourcesBindingsResultWorkersBindingKindDispatchNamespaceOutbound] = None + """Outbound worker.""" + + +class ResourcesBindingsResultWorkersBindingKindDurableObjectNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["durable_object_namespace"] + """The kind of resource that the binding provides.""" + + class_name: Optional[str] = None + """The exported class name of the Durable Object.""" + + environment: Optional[str] = None + """The environment of the script_name to bind to.""" + + namespace_id: Optional[str] = None + """Namespace identifier tag.""" + + script_name: Optional[str] = None + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class ResourcesBindingsResultWorkersBindingKindHyperdrive(BaseModel): + id: str + """Identifier of the Hyperdrive connection to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["hyperdrive"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindJson(BaseModel): + json_: str = FieldInfo(alias="json") + """JSON data to use.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["json"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindKVNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace_id: str + """Namespace identifier tag.""" + + type: Literal["kv_namespace"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindMTLSCertificate(BaseModel): + certificate_id: str + """Identifier of the certificate to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["mtls_certificate"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindPlainText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The text value to use.""" + + type: Literal["plain_text"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindPipelines(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + pipeline: str + """Name of the Pipeline to bind to.""" + + type: Literal["pipelines"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindQueue(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + queue_name: str + """Name of the Queue to bind to.""" + + type: Literal["queue"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindR2Bucket(BaseModel): + bucket_name: str + """R2 bucket to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["r2_bucket"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindSecretText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["secret_text"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindService(BaseModel): + environment: str + """Optional environment if the Worker utilizes one.""" + + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Worker to bind to.""" + + type: Literal["service"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindTailConsumer(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Tail Worker to bind to.""" + + type: Literal["tail_consumer"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindVectorize(BaseModel): + index_name: str + """Name of the Vectorize index to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["vectorize"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindVersionMetadata(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["version_metadata"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindSecretsStoreSecret(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + secret_name: str + """Name of the secret in the store.""" + + store_id: str + """ID of the store containing the secret.""" + + type: Literal["secrets_store_secret"] + """The kind of resource that the binding provides.""" + + +class ResourcesBindingsResultWorkersBindingKindSecretKey(BaseModel): + algorithm: object + """Algorithm-specific key parameters. + + [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). + """ + + format: Literal["raw", "pkcs8", "spki", "jwk"] + """Data format of the key. + + [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). + """ + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["secret_key"] + """The kind of resource that the binding provides.""" + + usages: List[Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"]] + """Allowed operations with the key. + + [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). + """ + + +class ResourcesBindingsResultWorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + +ResourcesBindingsResult: TypeAlias = Annotated[ + Union[ + ResourcesBindingsResultWorkersBindingKindAI, + ResourcesBindingsResultWorkersBindingKindAnalyticsEngine, + ResourcesBindingsResultWorkersBindingKindAssets, + ResourcesBindingsResultWorkersBindingKindBrowser, + ResourcesBindingsResultWorkersBindingKindD1, + ResourcesBindingsResultWorkersBindingKindDispatchNamespace, + ResourcesBindingsResultWorkersBindingKindDurableObjectNamespace, + ResourcesBindingsResultWorkersBindingKindHyperdrive, + ResourcesBindingsResultWorkersBindingKindJson, + ResourcesBindingsResultWorkersBindingKindKVNamespace, + ResourcesBindingsResultWorkersBindingKindMTLSCertificate, + ResourcesBindingsResultWorkersBindingKindPlainText, + ResourcesBindingsResultWorkersBindingKindPipelines, + ResourcesBindingsResultWorkersBindingKindQueue, + ResourcesBindingsResultWorkersBindingKindR2Bucket, + ResourcesBindingsResultWorkersBindingKindSecretText, + ResourcesBindingsResultWorkersBindingKindService, + ResourcesBindingsResultWorkersBindingKindTailConsumer, + ResourcesBindingsResultWorkersBindingKindVectorize, + ResourcesBindingsResultWorkersBindingKindVersionMetadata, + ResourcesBindingsResultWorkersBindingKindSecretsStoreSecret, + ResourcesBindingsResultWorkersBindingKindSecretKey, + ResourcesBindingsResultWorkersBindingKindWorkflow, + ], + PropertyInfo(discriminator="type"), +] + + +class ResourcesBindings(BaseModel): + result: Optional[List[ResourcesBindingsResult]] = None + """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. + """ + + +class ResourcesScriptNamedHandler(BaseModel): + handlers: Optional[List[str]] = None + + name: Optional[str] = None + + +class ResourcesScript(BaseModel): + etag: Optional[str] = None + + handlers: Optional[List[str]] = None + + last_deployed_from: Optional[str] = None + + named_handlers: Optional[List[ResourcesScriptNamedHandler]] = None + + +class ResourcesScriptRuntimeLimits(BaseModel): + cpu_ms: Optional[int] = None + + +class ResourcesScriptRuntime(BaseModel): + compatibility_date: Optional[str] = None + + compatibility_flags: Optional[List[str]] = None + + limits: Optional[ResourcesScriptRuntimeLimits] = None + + migration_tag: Optional[str] = None + + usage_model: Optional[Literal["bundled", "unbound", "standard"]] = None + + +class Resources(BaseModel): + bindings: Optional[ResourcesBindings] = None + + script: Optional[ResourcesScript] = None + + script_runtime: Optional[ResourcesScriptRuntime] = None + + +class Metadata(BaseModel): + author_email: Optional[str] = None + + author_id: Optional[str] = None + + created_on: Optional[str] = None + + has_preview: Optional[bool] = FieldInfo(alias="hasPreview", default=None) + + modified_on: Optional[str] = None + + source: Optional[ + Literal[ + "unknown", + "api", + "wrangler", + "terraform", + "dash", + "dash_template", + "integration", + "quick_editor", + "playground", + "workersci", + ] + ] = None class VersionGetResponse(BaseModel): - resources: object + resources: Resources id: Optional[str] = None - metadata: Optional[object] = None + metadata: Optional[Metadata] = None number: Optional[float] = None diff --git a/src/cloudflare/types/workers/scripts/version_list_response.py b/src/cloudflare/types/workers/scripts/version_list_response.py index b992e3fab59..465294967c4 100644 --- a/src/cloudflare/types/workers/scripts/version_list_response.py +++ b/src/cloudflare/types/workers/scripts/version_list_response.py @@ -1,15 +1,45 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["VersionListResponse"] +__all__ = ["VersionListResponse", "Metadata"] + + +class Metadata(BaseModel): + author_email: Optional[str] = None + + author_id: Optional[str] = None + + created_on: Optional[str] = None + + has_preview: Optional[bool] = FieldInfo(alias="hasPreview", default=None) + + modified_on: Optional[str] = None + + source: Optional[ + Literal[ + "unknown", + "api", + "wrangler", + "terraform", + "dash", + "dash_template", + "integration", + "quick_editor", + "playground", + "workersci", + ] + ] = None class VersionListResponse(BaseModel): id: Optional[str] = None - metadata: Optional[object] = None + metadata: Optional[Metadata] = None number: Optional[float] = None diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 240247e29b5..64b5d00a594 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -39,6 +39,7 @@ "MetadataBindingWorkersBindingKindVersionMetadata", "MetadataBindingWorkersBindingKindSecretsStoreSecret", "MetadataBindingWorkersBindingKindSecretKey", + "MetadataBindingWorkersBindingKindWorkflow", "MetadataMigrations", "MetadataMigrationsWorkersMultipleStepMigrations", "MetadataObservability", @@ -80,18 +81,12 @@ class MetadataAssetsConfig(TypedDict, total=False): is no Worker script. """ - run_worker_first: bool - """When true, requests will always invoke the Worker script. + run_worker_first: List[str] + """Contains a list path rules to control routing to either the Worker or assets. - Otherwise, attempt to serve an asset matching the request, falling back to the - Worker script. - """ - - serve_directly: bool - """ - When true and the incoming request matches an asset, that will be served instead - of invoking the Worker script. When false, requests will always invoke the - Worker script. + Glob (\\**) and negative (!) rules are supported. Rules must start with either '/' + or '!/'. At least one non-negative rule must be provided, and negative rules + have higher precedence than non-negative rules. """ @@ -400,6 +395,29 @@ class MetadataBindingWorkersBindingKindSecretKey(TypedDict, total=False): """ +class MetadataBindingWorkersBindingKindWorkflow(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["workflow"]] + """The kind of resource that the binding provides.""" + + workflow_name: Required[str] + """Name of the Workflow to bind to.""" + + class_name: str + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: str + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + MetadataBinding: TypeAlias = Union[ MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, @@ -423,6 +441,7 @@ class MetadataBindingWorkersBindingKindSecretKey(TypedDict, total=False): MetadataBindingWorkersBindingKindVersionMetadata, MetadataBindingWorkersBindingKindSecretsStoreSecret, MetadataBindingWorkersBindingKindSecretKey, + MetadataBindingWorkersBindingKindWorkflow, ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index 0bc48f41c82..41075e5416a 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -34,6 +34,7 @@ "WorkersBindingKindVersionMetadata", "WorkersBindingKindSecretsStoreSecret", "WorkersBindingKindSecretKey", + "WorkersBindingKindWorkflow", ] @@ -319,6 +320,29 @@ class WorkersBindingKindSecretKey(BaseModel): """ +class WorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + BindingGetResponse: TypeAlias = Annotated[ Union[ WorkersBindingKindAI, @@ -343,6 +367,7 @@ class WorkersBindingKindSecretKey(BaseModel): WorkersBindingKindVersionMetadata, WorkersBindingKindSecretsStoreSecret, WorkersBindingKindSecretKey, + WorkersBindingKindWorkflow, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index de63e504734..567df15f6e7 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -37,6 +37,7 @@ "SettingsBindingWorkersBindingKindVersionMetadata", "SettingsBindingWorkersBindingKindSecretsStoreSecret", "SettingsBindingWorkersBindingKindSecretKey", + "SettingsBindingWorkersBindingKindWorkflow", "SettingsLimits", "SettingsMigrations", "SettingsMigrationsWorkersMultipleStepMigrations", @@ -353,6 +354,29 @@ class SettingsBindingWorkersBindingKindSecretKey(TypedDict, total=False): """ +class SettingsBindingWorkersBindingKindWorkflow(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["workflow"]] + """The kind of resource that the binding provides.""" + + workflow_name: Required[str] + """Name of the Workflow to bind to.""" + + class_name: str + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: str + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + SettingsBinding: TypeAlias = Union[ SettingsBindingWorkersBindingKindAI, SettingsBindingWorkersBindingKindAnalyticsEngine, @@ -376,6 +400,7 @@ class SettingsBindingWorkersBindingKindSecretKey(TypedDict, total=False): SettingsBindingWorkersBindingKindVersionMetadata, SettingsBindingWorkersBindingKindSecretsStoreSecret, SettingsBindingWorkersBindingKindSecretKey, + SettingsBindingWorkersBindingKindWorkflow, ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py index 959ac19a94b..ef0ea53dbf9 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -38,6 +38,7 @@ "BindingWorkersBindingKindVersionMetadata", "BindingWorkersBindingKindSecretsStoreSecret", "BindingWorkersBindingKindSecretKey", + "BindingWorkersBindingKindWorkflow", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -329,6 +330,29 @@ class BindingWorkersBindingKindSecretKey(BaseModel): """ +class BindingWorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -353,6 +377,7 @@ class BindingWorkersBindingKindSecretKey(BaseModel): BindingWorkersBindingKindVersionMetadata, BindingWorkersBindingKindSecretsStoreSecret, BindingWorkersBindingKindSecretKey, + BindingWorkersBindingKindWorkflow, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py index 85f5ca0b3bc..f82f3b0ae97 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -38,6 +38,7 @@ "BindingWorkersBindingKindVersionMetadata", "BindingWorkersBindingKindSecretsStoreSecret", "BindingWorkersBindingKindSecretKey", + "BindingWorkersBindingKindWorkflow", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -329,6 +330,29 @@ class BindingWorkersBindingKindSecretKey(BaseModel): """ +class BindingWorkersBindingKindWorkflow(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["workflow"] + """The kind of resource that the binding provides.""" + + workflow_name: str + """Name of the Workflow to bind to.""" + + class_name: Optional[str] = None + """Class name of the Workflow. + + Should only be provided if the Workflow belongs to this script. + """ + + script_name: Optional[str] = None + """Script name that contains the Workflow. + + If not provided, defaults to this script name. + """ + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -353,6 +377,7 @@ class BindingWorkersBindingKindSecretKey(BaseModel): BindingWorkersBindingKindVersionMetadata, BindingWorkersBindingKindSecretsStoreSecret, BindingWorkersBindingKindSecretKey, + BindingWorkersBindingKindWorkflow, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workflows/instance_list_params.py b/src/cloudflare/types/workflows/instance_list_params.py index 5e33a7c8975..0dd242878d8 100644 --- a/src/cloudflare/types/workflows/instance_list_params.py +++ b/src/cloudflare/types/workflows/instance_list_params.py @@ -15,10 +15,10 @@ class InstanceListParams(TypedDict, total=False): account_id: Required[str] date_end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """In ISO 8601 with no timezone offsets and in UTC.""" + """Accepts ISO 8601 with no timezone offsets and in UTC.""" date_start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """In ISO 8601 with no timezone offsets and in UTC.""" + """Accepts ISO 8601 with no timezone offsets and in UTC.""" page: float diff --git a/src/cloudflare/types/workflows/instances/status_edit_params.py b/src/cloudflare/types/workflows/instances/status_edit_params.py index fbcfd3b64e8..4ef6c2e9e98 100644 --- a/src/cloudflare/types/workflows/instances/status_edit_params.py +++ b/src/cloudflare/types/workflows/instances/status_edit_params.py @@ -13,4 +13,4 @@ class StatusEditParams(TypedDict, total=False): workflow_name: Required[str] status: Required[Literal["resume", "pause", "terminate"]] - """Possible actions to apply to instance.""" + """Apply action to instance.""" diff --git a/src/cloudflare/types/workflows/instances/status_edit_response.py b/src/cloudflare/types/workflows/instances/status_edit_response.py index abdf604bf5e..67d6f6e98c2 100644 --- a/src/cloudflare/types/workflows/instances/status_edit_response.py +++ b/src/cloudflare/types/workflows/instances/status_edit_response.py @@ -12,4 +12,4 @@ class StatusEditResponse(BaseModel): status: Literal["queued", "running", "paused", "errored", "terminated", "complete", "waitingForPause", "waiting"] timestamp: datetime - """In ISO 8601 with no timezone offsets and in UTC.""" + """Accepts ISO 8601 with no timezone offsets and in UTC.""" diff --git a/src/cloudflare/types/workflows/workflow_list_params.py b/src/cloudflare/types/workflows/workflow_list_params.py index 42796652b5e..8c5c598864e 100644 --- a/src/cloudflare/types/workflows/workflow_list_params.py +++ b/src/cloudflare/types/workflows/workflow_list_params.py @@ -15,4 +15,4 @@ class WorkflowListParams(TypedDict, total=False): per_page: float search: str - """Filter workflows by name.""" + """Allows filtering workflows` name.""" diff --git a/src/cloudflare/types/zaraz/config_update_params.py b/src/cloudflare/types/zaraz/config_update_params.py index c230e12d56e..f193e938753 100644 --- a/src/cloudflare/types/zaraz/config_update_params.py +++ b/src/cloudflare/types/zaraz/config_update_params.py @@ -60,7 +60,7 @@ class ConfigUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" data_layer: Required[Annotated[bool, PropertyInfo(alias="dataLayer")]] """Data layer compatibility mode enabled.""" diff --git a/src/cloudflare/types/zaraz/history/config_get_params.py b/src/cloudflare/types/zaraz/history/config_get_params.py index da17eaa30e7..5cdff0e7b1c 100644 --- a/src/cloudflare/types/zaraz/history/config_get_params.py +++ b/src/cloudflare/types/zaraz/history/config_get_params.py @@ -10,7 +10,7 @@ class ConfigGetParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" ids: Required[Iterable[int]] """Comma separated list of Zaraz configuration IDs""" diff --git a/src/cloudflare/types/zaraz/history_list_params.py b/src/cloudflare/types/zaraz/history_list_params.py index 38cfc5d54c0..c7b5fb731e6 100644 --- a/src/cloudflare/types/zaraz/history_list_params.py +++ b/src/cloudflare/types/zaraz/history_list_params.py @@ -11,7 +11,7 @@ class HistoryListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" limit: int """Maximum amount of results to list. Default value is 10.""" diff --git a/src/cloudflare/types/zaraz/history_update_params.py b/src/cloudflare/types/zaraz/history_update_params.py index 59b7e9dd565..7f6f60d5cff 100644 --- a/src/cloudflare/types/zaraz/history_update_params.py +++ b/src/cloudflare/types/zaraz/history_update_params.py @@ -9,7 +9,7 @@ class HistoryUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" body: Required[int] """ID of the Zaraz configuration to restore.""" diff --git a/src/cloudflare/types/zaraz/publish_create_params.py b/src/cloudflare/types/zaraz/publish_create_params.py index 17aaad3ed76..574d851996f 100644 --- a/src/cloudflare/types/zaraz/publish_create_params.py +++ b/src/cloudflare/types/zaraz/publish_create_params.py @@ -9,7 +9,7 @@ class PublishCreateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" body: str """Zaraz configuration description.""" diff --git a/src/cloudflare/types/zaraz/zaraz_update_params.py b/src/cloudflare/types/zaraz/zaraz_update_params.py index b5ece4f2285..171ceaa428b 100644 --- a/src/cloudflare/types/zaraz/zaraz_update_params.py +++ b/src/cloudflare/types/zaraz/zaraz_update_params.py @@ -11,7 +11,7 @@ class ZarazUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" workflow: Required[Workflow] """Zaraz workflow""" diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index bf5fcd8efcd..a77d4a12744 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -134,7 +134,7 @@ class SelfHostedApplication(TypedDict, total=False): This domain will be displayed if the app is visible in the App Launcher. """ - type: Required[str] + type: Required[ApplicationType] """The application type.""" account_id: str @@ -528,7 +528,7 @@ class SaaSApplication(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ - type: str + type: ApplicationType """The application type.""" @@ -682,7 +682,21 @@ class BrowserSSHApplication(TypedDict, total=False): This domain will be displayed if the app is visible in the App Launcher. """ - type: Required[str] + type: Required[ + Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] + ] """The application type.""" account_id: str @@ -1029,7 +1043,21 @@ class BrowserVNCApplication(TypedDict, total=False): This domain will be displayed if the app is visible in the App Launcher. """ - type: Required[str] + type: Required[ + Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] + ] """The application type.""" account_id: str @@ -1370,7 +1398,21 @@ class BrowserVNCApplicationSCIMConfig(TypedDict, total=False): class AppLauncherApplication(TypedDict, total=False): - type: Required[ApplicationType] + type: Required[ + Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] + ] """The application type.""" account_id: str @@ -2097,7 +2139,7 @@ class BookmarkApplication(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ - type: str + type: ApplicationType """The application type.""" @@ -2214,7 +2256,7 @@ class InfrastructureApplicationTargetCriterion(TypedDict, total=False): A port cannot be assigned to multiple protocols. """ - protocol: Required[Literal["ssh"]] + protocol: Required[Literal["SSH"]] """The communication protocol your application secures.""" target_attributes: Required[Dict[str, List[str]]] @@ -2281,7 +2323,7 @@ class BrowserRdpApplication(TypedDict, total=False): target_criteria: Required[Iterable[BrowserRdpApplicationTargetCriterion]] - type: Required[str] + type: Required[ApplicationType] """The application type.""" account_id: str @@ -2444,7 +2486,7 @@ class BrowserRdpApplicationTargetCriterion(TypedDict, total=False): A port cannot be assigned to multiple protocols. """ - protocol: Required[Literal["ssh"]] + protocol: Required[Literal["SSH"]] """The communication protocol your application secures.""" target_attributes: Required[Dict[str, List[str]]] diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index df22b0054ad..61463c42b09 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -320,7 +320,7 @@ class SelfHostedApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None @@ -685,7 +685,7 @@ class SaaSApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -895,7 +895,19 @@ class BrowserSSHApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1254,7 +1266,19 @@ class BrowserVNCApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1591,7 +1615,19 @@ class AppLauncherApplicationSCIMConfig(BaseModel): class AppLauncherApplication(BaseModel): - type: ApplicationType + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -2287,7 +2323,7 @@ class BookmarkApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -2300,7 +2336,7 @@ class InfrastructureApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2485,7 +2521,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2698,7 +2734,7 @@ class BrowserRdpApplication(BaseModel): target_criteria: List[BrowserRdpApplicationTargetCriterion] - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 3817a5c919c..5daecc65e9e 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -320,7 +320,7 @@ class SelfHostedApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None @@ -685,7 +685,7 @@ class SaaSApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -895,7 +895,19 @@ class BrowserSSHApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1254,7 +1266,19 @@ class BrowserVNCApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1591,7 +1615,19 @@ class AppLauncherApplicationSCIMConfig(BaseModel): class AppLauncherApplication(BaseModel): - type: ApplicationType + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -2287,7 +2323,7 @@ class BookmarkApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -2300,7 +2336,7 @@ class InfrastructureApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2485,7 +2521,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2698,7 +2734,7 @@ class BrowserRdpApplication(BaseModel): target_criteria: List[BrowserRdpApplicationTargetCriterion] - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 334fb45fc8d..bccb59ec4fb 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -320,7 +320,7 @@ class SelfHostedApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None @@ -685,7 +685,7 @@ class SaaSApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -895,7 +895,19 @@ class BrowserSSHApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1254,7 +1266,19 @@ class BrowserVNCApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1591,7 +1615,19 @@ class AppLauncherApplicationSCIMConfig(BaseModel): class AppLauncherApplication(BaseModel): - type: ApplicationType + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -2287,7 +2323,7 @@ class BookmarkApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -2300,7 +2336,7 @@ class InfrastructureApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2485,7 +2521,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2698,7 +2734,7 @@ class BrowserRdpApplication(BaseModel): target_criteria: List[BrowserRdpApplicationTargetCriterion] - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index 0aafb200b64..4cfd0257427 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -134,7 +134,7 @@ class SelfHostedApplication(TypedDict, total=False): This domain will be displayed if the app is visible in the App Launcher. """ - type: Required[str] + type: Required[ApplicationType] """The application type.""" account_id: str @@ -528,7 +528,7 @@ class SaaSApplication(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ - type: str + type: ApplicationType """The application type.""" @@ -682,7 +682,21 @@ class BrowserSSHApplication(TypedDict, total=False): This domain will be displayed if the app is visible in the App Launcher. """ - type: Required[str] + type: Required[ + Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] + ] """The application type.""" account_id: str @@ -1029,7 +1043,21 @@ class BrowserVNCApplication(TypedDict, total=False): This domain will be displayed if the app is visible in the App Launcher. """ - type: Required[str] + type: Required[ + Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] + ] """The application type.""" account_id: str @@ -1370,7 +1398,21 @@ class BrowserVNCApplicationSCIMConfig(TypedDict, total=False): class AppLauncherApplication(TypedDict, total=False): - type: Required[ApplicationType] + type: Required[ + Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] + ] """The application type.""" account_id: str @@ -2097,7 +2139,7 @@ class BookmarkApplication(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ - type: str + type: ApplicationType """The application type.""" @@ -2214,7 +2256,7 @@ class InfrastructureApplicationTargetCriterion(TypedDict, total=False): A port cannot be assigned to multiple protocols. """ - protocol: Required[Literal["ssh"]] + protocol: Required[Literal["SSH"]] """The communication protocol your application secures.""" target_attributes: Required[Dict[str, List[str]]] @@ -2281,7 +2323,7 @@ class BrowserRdpApplication(TypedDict, total=False): target_criteria: Required[Iterable[BrowserRdpApplicationTargetCriterion]] - type: Required[str] + type: Required[ApplicationType] """The application type.""" account_id: str @@ -2444,7 +2486,7 @@ class BrowserRdpApplicationTargetCriterion(TypedDict, total=False): A port cannot be assigned to multiple protocols. """ - protocol: Required[Literal["ssh"]] + protocol: Required[Literal["SSH"]] """The communication protocol your application secures.""" target_attributes: Required[Dict[str, List[str]]] diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 36bb83ad41f..7ec6b8c8187 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -320,7 +320,7 @@ class SelfHostedApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None @@ -685,7 +685,7 @@ class SaaSApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -895,7 +895,19 @@ class BrowserSSHApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1254,7 +1266,19 @@ class BrowserVNCApplication(BaseModel): This domain will be displayed if the app is visible in the App Launcher. """ - type: str + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -1591,7 +1615,19 @@ class AppLauncherApplicationSCIMConfig(BaseModel): class AppLauncherApplication(BaseModel): - type: ApplicationType + type: Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + ] """The application type.""" id: Optional[str] = None @@ -2287,7 +2323,7 @@ class BookmarkApplication(BaseModel): Tags are used to filter applications in the App Launcher dashboard. """ - type: Optional[str] = None + type: Optional[ApplicationType] = None """The application type.""" updated_at: Optional[datetime] = None @@ -2300,7 +2336,7 @@ class InfrastructureApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2485,7 +2521,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): A port cannot be assigned to multiple protocols. """ - protocol: Literal["ssh"] + protocol: Literal["SSH"] """The communication protocol your application secures.""" target_attributes: Dict[str, List[str]] @@ -2698,7 +2734,7 @@ class BrowserRdpApplication(BaseModel): target_criteria: List[BrowserRdpApplicationTargetCriterion] - type: str + type: ApplicationType """The application type.""" id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/__init__.py b/src/cloudflare/types/zero_trust/access/infrastructure/__init__.py index 132ad5ee5cf..d1c28a04c09 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/__init__.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/__init__.py @@ -11,3 +11,4 @@ from .target_update_response import TargetUpdateResponse as TargetUpdateResponse from .target_bulk_update_params import TargetBulkUpdateParams as TargetBulkUpdateParams from .target_bulk_update_response import TargetBulkUpdateResponse as TargetBulkUpdateResponse +from .target_bulk_delete_v2_params import TargetBulkDeleteV2Params as TargetBulkDeleteV2Params diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py new file mode 100644 index 00000000000..5664de3b4b4 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py @@ -0,0 +1,16 @@ +# 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 Required, TypedDict + +__all__ = ["TargetBulkDeleteV2Params"] + + +class TargetBulkDeleteV2Params(TypedDict, total=False): + account_id: Required[str] + """Account identifier""" + + target_ids: Required[List[str]] + """List of target IDs to bulk delete""" diff --git a/src/cloudflare/types/zero_trust/devices/__init__.py b/src/cloudflare/types/zero_trust/devices/__init__.py index 1d3fe929404..68769f0f0c7 100644 --- a/src/cloudflare/types/zero_trust/devices/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/__init__.py @@ -34,6 +34,7 @@ from .revoke_create_params import RevokeCreateParams as RevokeCreateParams from .split_tunnel_exclude import SplitTunnelExclude as SplitTunnelExclude from .split_tunnel_include import SplitTunnelInclude as SplitTunnelInclude +from .dex_test_get_response import DEXTestGetResponse as DEXTestGetResponse from .disk_encryption_input import DiskEncryptionInput as DiskEncryptionInput from .fallback_domain_param import FallbackDomainParam as FallbackDomainParam from .network_create_params import NetworkCreateParams as NetworkCreateParams @@ -42,6 +43,9 @@ from .posture_update_params import PostureUpdateParams as PostureUpdateParams from .sentinelone_s2s_input import SentineloneS2sInput as SentineloneS2sInput from .setting_update_params import SettingUpdateParams as SettingUpdateParams +from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams +from .dex_test_list_response import DEXTestListResponse as DEXTestListResponse +from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams from .os_version_input_param import OSVersionInputParam as OSVersionInputParam from .revoke_create_response import RevokeCreateResponse as RevokeCreateResponse from .unique_client_id_input import UniqueClientIDInput as UniqueClientIDInput @@ -51,6 +55,9 @@ from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse from .sentinelone_input_param import SentineloneInputParam as SentineloneInputParam from .client_certificate_input import ClientCertificateInput as ClientCertificateInput +from .dex_test_create_response import DEXTestCreateResponse as DEXTestCreateResponse +from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse +from .dex_test_update_response import DEXTestUpdateResponse as DEXTestUpdateResponse from .registration_list_params import RegistrationListParams as RegistrationListParams from .unrevoke_create_response import UnrevokeCreateResponse as UnrevokeCreateResponse from .domain_joined_input_param import DomainJoinedInputParam as DomainJoinedInputParam diff --git a/src/cloudflare/types/zero_trust/devices/device_get_response.py b/src/cloudflare/types/zero_trust/devices/device_get_response.py index e7a38dca2a0..f2f5e707cd3 100644 --- a/src/cloudflare/types/zero_trust/devices/device_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/device_get_response.py @@ -53,7 +53,7 @@ class DeviceGetResponse(BaseModel): """A string that uniquely identifies the hardware or virtual machine (VM).""" last_seen_user: Optional[LastSeenUser] = None - """The last Access user to use the WARP device.""" + """The last user to use the WARP device.""" mac_address: Optional[str] = None """The device MAC address.""" diff --git a/src/cloudflare/types/zero_trust/devices/device_input.py b/src/cloudflare/types/zero_trust/devices/device_input.py index b16b425e811..28d5ef91845 100644 --- a/src/cloudflare/types/zero_trust/devices/device_input.py +++ b/src/cloudflare/types/zero_trust/devices/device_input.py @@ -86,7 +86,7 @@ class TeamsDevicesClientCertificateV2InputRequest(BaseModel): """Operating system.""" cn: Optional[str] = None - """Common Name that is protected by the client certificate. + """Certificate Common Name. This may include one or more variables in the ${ } notation. Only ${serial_number} and ${hostname} are valid variables. @@ -100,6 +100,9 @@ class TeamsDevicesClientCertificateV2InputRequest(BaseModel): locations: Optional[TeamsDevicesClientCertificateV2InputRequestLocations] = None + subject_alternative_names: Optional[List[str]] = None + """List of certificate Subject Alternative Names.""" + class TeamsDevicesCustomS2sInputRequest(BaseModel): connection_id: str diff --git a/src/cloudflare/types/zero_trust/devices/device_input_param.py b/src/cloudflare/types/zero_trust/devices/device_input_param.py index ad3fc048baa..86ae210cb3f 100644 --- a/src/cloudflare/types/zero_trust/devices/device_input_param.py +++ b/src/cloudflare/types/zero_trust/devices/device_input_param.py @@ -87,7 +87,7 @@ class TeamsDevicesClientCertificateV2InputRequest(TypedDict, total=False): """Operating system.""" cn: str - """Common Name that is protected by the client certificate. + """Certificate Common Name. This may include one or more variables in the ${ } notation. Only ${serial_number} and ${hostname} are valid variables. @@ -101,6 +101,9 @@ class TeamsDevicesClientCertificateV2InputRequest(TypedDict, total=False): locations: TeamsDevicesClientCertificateV2InputRequestLocations + subject_alternative_names: List[str] + """List of certificate Subject Alternative Names.""" + class TeamsDevicesCustomS2sInputRequest(TypedDict, total=False): connection_id: Required[str] diff --git a/src/cloudflare/types/zero_trust/devices/device_list_response.py b/src/cloudflare/types/zero_trust/devices/device_list_response.py index 6dd24eaf773..a0b3b13c76a 100644 --- a/src/cloudflare/types/zero_trust/devices/device_list_response.py +++ b/src/cloudflare/types/zero_trust/devices/device_list_response.py @@ -53,7 +53,7 @@ class DeviceListResponse(BaseModel): """A string that uniquely identifies the hardware or virtual machine (VM).""" last_seen_user: Optional[LastSeenUser] = None - """The last Access user to use the WARP device.""" + """The last user to use the WARP device.""" mac_address: Optional[str] = None """The device MAC address.""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py new file mode 100644 index 00000000000..99c48d5814c --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["DEXTestCreateParams", "Data", "TargetPolicy"] + + +class DEXTestCreateParams(TypedDict, total=False): + account_id: Required[str] + + data: Required[Data] + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: Required[bool] + """Determines whether or not the test is active.""" + + interval: Required[str] + """How often the test will run.""" + + name: Required[str] + """The name of the DEX test. Must be unique.""" + + description: str + """Additional details about the test.""" + + target_policies: Iterable[TargetPolicy] + """DEX rules targeted by this test""" + + targeted: bool + + +class Data(TypedDict, total=False): + host: str + """The desired endpoint to test.""" + + kind: str + """The type of test.""" + + method: str + """The HTTP request method type.""" + + +class TargetPolicy(TypedDict, total=False): + id: str + """The id of the DEX rule""" + + default: bool + """Whether the DEX rule is the account default""" + + name: str + """The name of the DEX rule""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_create_response.py b/src/cloudflare/types/zero_trust/devices/dex_test_create_response.py new file mode 100644 index 00000000000..d8931a56ce8 --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_create_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["DEXTestCreateResponse", "Data", "TargetPolicy"] + + +class Data(BaseModel): + host: Optional[str] = None + """The desired endpoint to test.""" + + kind: Optional[str] = None + """The type of test.""" + + method: Optional[str] = None + """The HTTP request method type.""" + + +class TargetPolicy(BaseModel): + id: Optional[str] = None + """The id of the DEX rule""" + + default: Optional[bool] = None + """Whether the DEX rule is the account default""" + + name: Optional[str] = None + """The name of the DEX rule""" + + +class DEXTestCreateResponse(BaseModel): + data: Data + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + """Determines whether or not the test is active.""" + + interval: str + """How often the test will run.""" + + name: str + """The name of the DEX test. Must be unique.""" + + description: Optional[str] = None + """Additional details about the test.""" + + target_policies: Optional[List[TargetPolicy]] = None + """DEX rules targeted by this test""" + + targeted: Optional[bool] = None + + test_id: Optional[str] = None + """The unique identifier for the test.""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_delete_response.py b/src/cloudflare/types/zero_trust/devices/dex_test_delete_response.py new file mode 100644 index 00000000000..91dc2d74c84 --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_delete_response.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["DEXTestDeleteResponse", "DEXTest", "DEXTestData", "DEXTestTargetPolicy"] + + +class DEXTestData(BaseModel): + host: Optional[str] = None + """The desired endpoint to test.""" + + kind: Optional[str] = None + """The type of test.""" + + method: Optional[str] = None + """The HTTP request method type.""" + + +class DEXTestTargetPolicy(BaseModel): + id: Optional[str] = None + """The id of the DEX rule""" + + default: Optional[bool] = None + """Whether the DEX rule is the account default""" + + name: Optional[str] = None + """The name of the DEX rule""" + + +class DEXTest(BaseModel): + data: DEXTestData + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + """Determines whether or not the test is active.""" + + interval: str + """How often the test will run.""" + + name: str + """The name of the DEX test. Must be unique.""" + + description: Optional[str] = None + """Additional details about the test.""" + + target_policies: Optional[List[DEXTestTargetPolicy]] = None + """DEX rules targeted by this test""" + + targeted: Optional[bool] = None + + test_id: Optional[str] = None + """The unique identifier for the test.""" + + +class DEXTestDeleteResponse(BaseModel): + dex_tests: Optional[List[DEXTest]] = None diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_get_response.py b/src/cloudflare/types/zero_trust/devices/dex_test_get_response.py new file mode 100644 index 00000000000..3b159f70b5e --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_get_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["DEXTestGetResponse", "Data", "TargetPolicy"] + + +class Data(BaseModel): + host: Optional[str] = None + """The desired endpoint to test.""" + + kind: Optional[str] = None + """The type of test.""" + + method: Optional[str] = None + """The HTTP request method type.""" + + +class TargetPolicy(BaseModel): + id: Optional[str] = None + """The id of the DEX rule""" + + default: Optional[bool] = None + """Whether the DEX rule is the account default""" + + name: Optional[str] = None + """The name of the DEX rule""" + + +class DEXTestGetResponse(BaseModel): + data: Data + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + """Determines whether or not the test is active.""" + + interval: str + """How often the test will run.""" + + name: str + """The name of the DEX test. Must be unique.""" + + description: Optional[str] = None + """Additional details about the test.""" + + target_policies: Optional[List[TargetPolicy]] = None + """DEX rules targeted by this test""" + + targeted: Optional[bool] = None + + test_id: Optional[str] = None + """The unique identifier for the test.""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_list_response.py b/src/cloudflare/types/zero_trust/devices/dex_test_list_response.py new file mode 100644 index 00000000000..32353cdd0a5 --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_list_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["DEXTestListResponse", "Data", "TargetPolicy"] + + +class Data(BaseModel): + host: Optional[str] = None + """The desired endpoint to test.""" + + kind: Optional[str] = None + """The type of test.""" + + method: Optional[str] = None + """The HTTP request method type.""" + + +class TargetPolicy(BaseModel): + id: Optional[str] = None + """The id of the DEX rule""" + + default: Optional[bool] = None + """Whether the DEX rule is the account default""" + + name: Optional[str] = None + """The name of the DEX rule""" + + +class DEXTestListResponse(BaseModel): + data: Data + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + """Determines whether or not the test is active.""" + + interval: str + """How often the test will run.""" + + name: str + """The name of the DEX test. Must be unique.""" + + description: Optional[str] = None + """Additional details about the test.""" + + target_policies: Optional[List[TargetPolicy]] = None + """DEX rules targeted by this test""" + + targeted: Optional[bool] = None + + test_id: Optional[str] = None + """The unique identifier for the test.""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py new file mode 100644 index 00000000000..562affbc0ef --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["DEXTestUpdateParams", "Data", "TargetPolicy"] + + +class DEXTestUpdateParams(TypedDict, total=False): + account_id: Required[str] + + data: Required[Data] + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: Required[bool] + """Determines whether or not the test is active.""" + + interval: Required[str] + """How often the test will run.""" + + name: Required[str] + """The name of the DEX test. Must be unique.""" + + description: str + """Additional details about the test.""" + + target_policies: Iterable[TargetPolicy] + """DEX rules targeted by this test""" + + targeted: bool + + +class Data(TypedDict, total=False): + host: str + """The desired endpoint to test.""" + + kind: str + """The type of test.""" + + method: str + """The HTTP request method type.""" + + +class TargetPolicy(TypedDict, total=False): + id: str + """The id of the DEX rule""" + + default: bool + """Whether the DEX rule is the account default""" + + name: str + """The name of the DEX rule""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_update_response.py b/src/cloudflare/types/zero_trust/devices/dex_test_update_response.py new file mode 100644 index 00000000000..478d96d46be --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/dex_test_update_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["DEXTestUpdateResponse", "Data", "TargetPolicy"] + + +class Data(BaseModel): + host: Optional[str] = None + """The desired endpoint to test.""" + + kind: Optional[str] = None + """The type of test.""" + + method: Optional[str] = None + """The HTTP request method type.""" + + +class TargetPolicy(BaseModel): + id: Optional[str] = None + """The id of the DEX rule""" + + default: Optional[bool] = None + """Whether the DEX rule is the account default""" + + name: Optional[str] = None + """The name of the DEX rule""" + + +class DEXTestUpdateResponse(BaseModel): + data: Data + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + """Determines whether or not the test is active.""" + + interval: str + """How often the test will run.""" + + name: str + """The name of the DEX test. Must be unique.""" + + description: Optional[str] = None + """Additional details about the test.""" + + target_policies: Optional[List[TargetPolicy]] = None + """DEX rules targeted by this test""" + + targeted: Optional[bool] = None + + test_id: Optional[str] = None + """The unique identifier for the test.""" diff --git a/src/cloudflare/types/zero_trust/devices/registration_list_params.py b/src/cloudflare/types/zero_trust/devices/registration_list_params.py index 0e3ada5ea8b..28abde847d5 100644 --- a/src/cloudflare/types/zero_trust/devices/registration_list_params.py +++ b/src/cloudflare/types/zero_trust/devices/registration_list_params.py @@ -62,4 +62,4 @@ class Device(TypedDict, total=False): class User(TypedDict, total=False): id: List[str] - """Filter by Access user ID.""" + """Filter by user ID.""" diff --git a/src/cloudflare/types/zero_trust/dex/__init__.py b/src/cloudflare/types/zero_trust/dex/__init__.py index cd977b0b14c..f2ff29ec9eb 100644 --- a/src/cloudflare/types/zero_trust/dex/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/__init__.py @@ -17,7 +17,9 @@ from .fleet_status_live_params import FleetStatusLiveParams as FleetStatusLiveParams from .fleet_status_live_response import FleetStatusLiveResponse as FleetStatusLiveResponse from .traceroute_test_get_params import TracerouteTestGetParams as TracerouteTestGetParams +from .warp_change_event_get_params import WARPChangeEventGetParams as WARPChangeEventGetParams from .fleet_status_over_time_params import FleetStatusOverTimeParams as FleetStatusOverTimeParams +from .warp_change_event_get_response import WARPChangeEventGetResponse as WARPChangeEventGetResponse from .traceroute_test_percentiles_params import TracerouteTestPercentilesParams as TracerouteTestPercentilesParams from .traceroute_test_network_path_params import TracerouteTestNetworkPathParams as TracerouteTestNetworkPathParams from .traceroute_test_percentiles_response import TracerouteTestPercentilesResponse as TracerouteTestPercentilesResponse diff --git a/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py b/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py new file mode 100644 index 00000000000..33c691637a0 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["WARPChangeEventGetParams"] + + +class WARPChangeEventGetParams(TypedDict, total=False): + account_id: Required[str] + + from_: Required[Annotated[str, PropertyInfo(alias="from")]] + """Start time for the query in ISO (RFC3339 - ISO 8601) format""" + + page: Required[float] + """Page number of paginated results""" + + per_page: Required[float] + """Number of items per page""" + + to: Required[str] + """End time for the query in ISO (RFC3339 - ISO 8601) format""" + + account_name: str + """Filter events by account name.""" + + config_name: str + """Filter events by WARP configuration name changed from or to. + + Applicable to type='config' events only. + """ + + sort_order: Literal["ASC", "DESC"] + """Sort response by event timestamp.""" + + toggle: Literal["on", "off"] + """Filter events by type toggle value. Applicable to type='toggle' events only.""" + + type: Literal["config", "toggle"] + """Filter events by type 'config' or 'toggle'""" diff --git a/src/cloudflare/types/zero_trust/dex/warp_change_event_get_response.py b/src/cloudflare/types/zero_trust/dex/warp_change_event_get_response.py new file mode 100644 index 00000000000..5341f285b73 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/warp_change_event_get_response.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "WARPChangeEventGetResponse", + "WARPChangeEventGetResponseItem", + "WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPToggleChangeEvent", + "WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEvent", + "WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventFrom", + "WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventTo", +] + + +class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPToggleChangeEvent(BaseModel): + account_name: Optional[str] = None + """The account name.""" + + account_tag: Optional[str] = None + """The public account identifier.""" + + device_id: Optional[str] = None + """API Resource UUID tag.""" + + device_registration: Optional[str] = None + """API Resource UUID tag.""" + + hostname: Optional[str] = None + """The hostname of the machine the event is from""" + + serial_number: Optional[str] = None + """The serial number of the machine the event is from""" + + timestamp: Optional[str] = None + """Timestamp in ISO format""" + + toggle: Optional[Literal["on", "off"]] = None + """The state of the WARP toggle.""" + + user_email: Optional[str] = None + """Email tied to the device""" + + +class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventFrom(BaseModel): + account_name: Optional[str] = None + """The account name.""" + + account_tag: Optional[str] = None + """API Resource UUID tag.""" + + config_name: Optional[str] = None + """The name of the WARP configuration.""" + + +class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventTo(BaseModel): + account_name: Optional[str] = None + """The account name.""" + + account_tag: Optional[str] = None + """API Resource UUID tag.""" + + config_name: Optional[str] = None + """The name of the WARP configuration.""" + + +class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEvent(BaseModel): + device_id: Optional[str] = None + """API Resource UUID tag.""" + + device_registration: Optional[str] = None + """API Resource UUID tag.""" + + from_: Optional[WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventFrom] = FieldInfo( + alias="from", default=None + ) + + hostname: Optional[str] = None + """The hostname of the machine the event is from""" + + serial_number: Optional[str] = None + """The serial number of the machine the event is from""" + + timestamp: Optional[str] = None + """Timestamp in ISO format""" + + to: Optional[WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventTo] = None + + user_email: Optional[str] = None + """Email tied to the device""" + + +WARPChangeEventGetResponseItem: TypeAlias = Union[ + WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPToggleChangeEvent, + WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEvent, +] + +WARPChangeEventGetResponse: TypeAlias = List[WARPChangeEventGetResponseItem] diff --git a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py index 83fdfc4e61d..7fb2662045d 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py @@ -14,6 +14,7 @@ "PredefinedEntryConfidence", "IntegrationEntry", "ExactDataEntry", + "DocumentTemplateEntry", "WordListEntry", ] @@ -99,6 +100,20 @@ class ExactDataEntry(BaseModel): updated_at: datetime +class DocumentTemplateEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_template"] + + updated_at: datetime + + class WordListEntry(BaseModel): id: str @@ -117,4 +132,6 @@ class WordListEntry(BaseModel): profile_id: Optional[str] = None -EntryGetResponse: TypeAlias = Union[CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, WordListEntry] +EntryGetResponse: TypeAlias = Union[ + CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentTemplateEntry, WordListEntry +] diff --git a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py index 4d30c71eb6a..1da2b70ca38 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py @@ -14,6 +14,7 @@ "PredefinedEntryConfidence", "IntegrationEntry", "ExactDataEntry", + "DocumentTemplateEntry", "WordListEntry", ] @@ -99,6 +100,20 @@ class ExactDataEntry(BaseModel): updated_at: datetime +class DocumentTemplateEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_template"] + + updated_at: datetime + + class WordListEntry(BaseModel): id: str @@ -117,4 +132,6 @@ class WordListEntry(BaseModel): profile_id: Optional[str] = None -EntryListResponse: TypeAlias = Union[CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, WordListEntry] +EntryListResponse: TypeAlias = Union[ + CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentTemplateEntry, WordListEntry +] diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py index d912ab9f679..dcece8b3638 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py @@ -14,6 +14,7 @@ "PredefinedEntryConfidence", "IntegrationEntry", "ExactDataEntry", + "DocumentTemplateEntry", "WordListEntry", ] @@ -99,6 +100,20 @@ class ExactDataEntry(BaseModel): updated_at: datetime +class DocumentTemplateEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_template"] + + updated_at: datetime + + class WordListEntry(BaseModel): id: str @@ -117,4 +132,6 @@ class WordListEntry(BaseModel): profile_id: Optional[str] = None -EntryUpdateResponse: TypeAlias = Union[CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, WordListEntry] +EntryUpdateResponse: TypeAlias = Union[ + CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentTemplateEntry, WordListEntry +] diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py index 9fbb6a64bc2..b1042788f99 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -18,6 +18,7 @@ "CustomProfileEntryPredefinedEntryConfidence", "CustomProfileEntryIntegrationEntry", "CustomProfileEntryExactDataEntry", + "CustomProfileEntryDocumentTemplateEntry", "CustomProfileEntryWordListEntry", "PredefinedProfile", "PredefinedProfileEntry", @@ -26,6 +27,7 @@ "PredefinedProfileEntryPredefinedEntryConfidence", "PredefinedProfileEntryIntegrationEntry", "PredefinedProfileEntryExactDataEntry", + "PredefinedProfileEntryDocumentTemplateEntry", "PredefinedProfileEntryWordListEntry", "IntegrationProfile", "IntegrationProfileEntry", @@ -34,6 +36,7 @@ "IntegrationProfileEntryPredefinedEntryConfidence", "IntegrationProfileEntryIntegrationEntry", "IntegrationProfileEntryExactDataEntry", + "IntegrationProfileEntryDocumentTemplateEntry", "IntegrationProfileEntryWordListEntry", ] @@ -119,6 +122,20 @@ class CustomProfileEntryExactDataEntry(BaseModel): updated_at: datetime +class CustomProfileEntryDocumentTemplateEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_template"] + + updated_at: datetime + + class CustomProfileEntryWordListEntry(BaseModel): id: str @@ -142,6 +159,7 @@ class CustomProfileEntryWordListEntry(BaseModel): CustomProfileEntryPredefinedEntry, CustomProfileEntryIntegrationEntry, CustomProfileEntryExactDataEntry, + CustomProfileEntryDocumentTemplateEntry, CustomProfileEntryWordListEntry, ] @@ -263,6 +281,20 @@ class PredefinedProfileEntryExactDataEntry(BaseModel): updated_at: datetime +class PredefinedProfileEntryDocumentTemplateEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_template"] + + updated_at: datetime + + class PredefinedProfileEntryWordListEntry(BaseModel): id: str @@ -286,6 +318,7 @@ class PredefinedProfileEntryWordListEntry(BaseModel): PredefinedProfileEntryPredefinedEntry, PredefinedProfileEntryIntegrationEntry, PredefinedProfileEntryExactDataEntry, + PredefinedProfileEntryDocumentTemplateEntry, PredefinedProfileEntryWordListEntry, ] @@ -400,6 +433,20 @@ class IntegrationProfileEntryExactDataEntry(BaseModel): updated_at: datetime +class IntegrationProfileEntryDocumentTemplateEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_template"] + + updated_at: datetime + + class IntegrationProfileEntryWordListEntry(BaseModel): id: str @@ -423,6 +470,7 @@ class IntegrationProfileEntryWordListEntry(BaseModel): IntegrationProfileEntryPredefinedEntry, IntegrationProfileEntryIntegrationEntry, IntegrationProfileEntryExactDataEntry, + IntegrationProfileEntryDocumentTemplateEntry, IntegrationProfileEntryWordListEntry, ] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py b/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py index 4929dee8cf2..48d09684f7b 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py @@ -6,5 +6,4 @@ from .pattern_param import PatternParam as PatternParam from .custom_create_params import CustomCreateParams as CustomCreateParams from .custom_update_params import CustomUpdateParams as CustomUpdateParams -from .custom_create_response import CustomCreateResponse as CustomCreateResponse from .predefined_update_params import PredefinedUpdateParams as PredefinedUpdateParams diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py index 1a6171c4f47..09dfda22c00 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py @@ -10,95 +10,21 @@ __all__ = [ "CustomCreateParams", - "Variant0", - "Variant0Profile", - "Variant0ProfileEntry", - "Variant0ProfileEntryDLPNewCustomEntry", - "Variant0ProfileEntryDLPNewWordListEntry", - "Variant0ProfileSharedEntry", - "Variant0ProfileSharedEntryUnionMember0", - "Variant0ProfileSharedEntryUnionMember1", - "Variant0ProfileSharedEntryUnionMember2", - "Variant0ProfileSharedEntryUnionMember3", - "DLPNewCustomProfile", - "DLPNewCustomProfileEntry", - "DLPNewCustomProfileEntryDLPNewCustomEntry", - "DLPNewCustomProfileEntryDLPNewWordListEntry", - "DLPNewCustomProfileSharedEntry", - "DLPNewCustomProfileSharedEntryUnionMember0", - "DLPNewCustomProfileSharedEntryUnionMember1", - "DLPNewCustomProfileSharedEntryUnionMember2", - "DLPNewCustomProfileSharedEntryUnionMember3", + "Entry", + "EntryDLPNewCustomEntry", + "EntryDLPNewWordListEntry", + "SharedEntry", + "SharedEntryCustom", + "SharedEntryPredefined", + "SharedEntryIntegration", + "SharedEntryExactData", ] -class Variant0(TypedDict, total=False): +class CustomCreateParams(TypedDict, total=False): account_id: Required[str] - profiles: Required[Iterable[Variant0Profile]] - - -class Variant0ProfileEntryDLPNewCustomEntry(TypedDict, total=False): - enabled: Required[bool] - - name: Required[str] - - pattern: Required[PatternParam] - - -class Variant0ProfileEntryDLPNewWordListEntry(TypedDict, total=False): - enabled: Required[bool] - - name: Required[str] - - words: Required[List[str]] - - -Variant0ProfileEntry: TypeAlias = Union[Variant0ProfileEntryDLPNewCustomEntry, Variant0ProfileEntryDLPNewWordListEntry] - - -class Variant0ProfileSharedEntryUnionMember0(TypedDict, total=False): - enabled: Required[bool] - - entry_id: Required[str] - - entry_type: Required[Literal["custom"]] - - -class Variant0ProfileSharedEntryUnionMember1(TypedDict, total=False): - enabled: Required[bool] - - entry_id: Required[str] - - entry_type: Required[Literal["predefined"]] - - -class Variant0ProfileSharedEntryUnionMember2(TypedDict, total=False): - enabled: Required[bool] - - entry_id: Required[str] - - entry_type: Required[Literal["integration"]] - - -class Variant0ProfileSharedEntryUnionMember3(TypedDict, total=False): - enabled: Required[bool] - - entry_id: Required[str] - - entry_type: Required[Literal["exact_data"]] - - -Variant0ProfileSharedEntry: TypeAlias = Union[ - Variant0ProfileSharedEntryUnionMember0, - Variant0ProfileSharedEntryUnionMember1, - Variant0ProfileSharedEntryUnionMember2, - Variant0ProfileSharedEntryUnionMember3, -] - - -class Variant0Profile(TypedDict, total=False): - entries: Required[Iterable[Variant0ProfileEntry]] + entries: Required[Iterable[Entry]] name: Required[str] @@ -120,7 +46,7 @@ class Variant0Profile(TypedDict, total=False): ocr_enabled: bool - shared_entries: Iterable[Variant0ProfileSharedEntry] + shared_entries: Iterable[SharedEntry] """Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your Microsoft Information Protection @@ -128,40 +54,7 @@ class Variant0Profile(TypedDict, total=False): """ -class DLPNewCustomProfile(TypedDict, total=False): - account_id: Required[str] - - entries: Required[Iterable[DLPNewCustomProfileEntry]] - - name: Required[str] - - ai_context_enabled: bool - - allowed_match_count: int - """Related DLP policies will trigger when the match count exceeds the number set.""" - - confidence_threshold: Optional[str] - - context_awareness: ContextAwarenessParam - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - description: Optional[str] - """The description of the profile.""" - - ocr_enabled: bool - - shared_entries: Iterable[DLPNewCustomProfileSharedEntry] - """Entries from other profiles (e.g. - - pre-defined Cloudflare profiles, or your Microsoft Information Protection - profiles). - """ - - -class DLPNewCustomProfileEntryDLPNewCustomEntry(TypedDict, total=False): +class EntryDLPNewCustomEntry(TypedDict, total=False): enabled: Required[bool] name: Required[str] @@ -169,7 +62,7 @@ class DLPNewCustomProfileEntryDLPNewCustomEntry(TypedDict, total=False): pattern: Required[PatternParam] -class DLPNewCustomProfileEntryDLPNewWordListEntry(TypedDict, total=False): +class EntryDLPNewWordListEntry(TypedDict, total=False): enabled: Required[bool] name: Required[str] @@ -177,12 +70,10 @@ class DLPNewCustomProfileEntryDLPNewWordListEntry(TypedDict, total=False): words: Required[List[str]] -DLPNewCustomProfileEntry: TypeAlias = Union[ - DLPNewCustomProfileEntryDLPNewCustomEntry, DLPNewCustomProfileEntryDLPNewWordListEntry -] +Entry: TypeAlias = Union[EntryDLPNewCustomEntry, EntryDLPNewWordListEntry] -class DLPNewCustomProfileSharedEntryUnionMember0(TypedDict, total=False): +class SharedEntryCustom(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -190,7 +81,7 @@ class DLPNewCustomProfileSharedEntryUnionMember0(TypedDict, total=False): entry_type: Required[Literal["custom"]] -class DLPNewCustomProfileSharedEntryUnionMember1(TypedDict, total=False): +class SharedEntryPredefined(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -198,7 +89,7 @@ class DLPNewCustomProfileSharedEntryUnionMember1(TypedDict, total=False): entry_type: Required[Literal["predefined"]] -class DLPNewCustomProfileSharedEntryUnionMember2(TypedDict, total=False): +class SharedEntryIntegration(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -206,7 +97,7 @@ class DLPNewCustomProfileSharedEntryUnionMember2(TypedDict, total=False): entry_type: Required[Literal["integration"]] -class DLPNewCustomProfileSharedEntryUnionMember3(TypedDict, total=False): +class SharedEntryExactData(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -214,11 +105,4 @@ class DLPNewCustomProfileSharedEntryUnionMember3(TypedDict, total=False): entry_type: Required[Literal["exact_data"]] -DLPNewCustomProfileSharedEntry: TypeAlias = Union[ - DLPNewCustomProfileSharedEntryUnionMember0, - DLPNewCustomProfileSharedEntryUnionMember1, - DLPNewCustomProfileSharedEntryUnionMember2, - DLPNewCustomProfileSharedEntryUnionMember3, -] - -CustomCreateParams: TypeAlias = Union[Variant0, DLPNewCustomProfile] +SharedEntry: TypeAlias = Union[SharedEntryCustom, SharedEntryPredefined, SharedEntryIntegration, SharedEntryExactData] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py deleted file mode 100644 index ec9b43f4cd9..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py +++ /dev/null @@ -1,447 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from .pattern import Pattern -from ..profile import Profile -from ....._models import BaseModel -from ..context_awareness import ContextAwareness - -__all__ = [ - "CustomCreateResponse", - "CustomProfile", - "CustomProfileEntry", - "CustomProfileEntryCustomEntry", - "CustomProfileEntryPredefinedEntry", - "CustomProfileEntryPredefinedEntryConfidence", - "CustomProfileEntryIntegrationEntry", - "CustomProfileEntryExactDataEntry", - "CustomProfileEntryWordListEntry", - "PredefinedProfile", - "PredefinedProfileEntry", - "PredefinedProfileEntryCustomEntry", - "PredefinedProfileEntryPredefinedEntry", - "PredefinedProfileEntryPredefinedEntryConfidence", - "PredefinedProfileEntryIntegrationEntry", - "PredefinedProfileEntryExactDataEntry", - "PredefinedProfileEntryWordListEntry", - "IntegrationProfile", - "IntegrationProfileEntry", - "IntegrationProfileEntryCustomEntry", - "IntegrationProfileEntryPredefinedEntry", - "IntegrationProfileEntryPredefinedEntryConfidence", - "IntegrationProfileEntryIntegrationEntry", - "IntegrationProfileEntryExactDataEntry", - "IntegrationProfileEntryWordListEntry", -] - - -class CustomProfileEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomProfileEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomProfileEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomProfileEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - -class CustomProfileEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomProfileEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomProfileEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomProfileEntry: TypeAlias = Union[ - CustomProfileEntryCustomEntry, - CustomProfileEntryPredefinedEntry, - CustomProfileEntryIntegrationEntry, - CustomProfileEntryExactDataEntry, - CustomProfileEntryWordListEntry, -] - - -class CustomProfile(BaseModel): - id: str - """The id of the profile (uuid).""" - - allowed_match_count: int - """Related DLP policies will trigger when the match count exceeds the number set.""" - - context_awareness: ContextAwareness - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - created_at: datetime - """When the profile was created.""" - - entries: List[CustomProfileEntry] - - name: str - """The name of the profile.""" - - ocr_enabled: bool - - type: Literal["custom"] - - updated_at: datetime - """When the profile was lasted updated.""" - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - description: Optional[str] = None - """The description of the profile.""" - - -class PredefinedProfileEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class PredefinedProfileEntryPredefinedEntry(BaseModel): - id: str - - confidence: PredefinedProfileEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - -class PredefinedProfileEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class PredefinedProfileEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class PredefinedProfileEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -PredefinedProfileEntry: TypeAlias = Union[ - PredefinedProfileEntryCustomEntry, - PredefinedProfileEntryPredefinedEntry, - PredefinedProfileEntryIntegrationEntry, - PredefinedProfileEntryExactDataEntry, - PredefinedProfileEntryWordListEntry, -] - - -class PredefinedProfile(BaseModel): - id: str - """The id of the predefined profile (uuid).""" - - allowed_match_count: int - - entries: List[PredefinedProfileEntry] - - name: str - """The name of the predefined profile.""" - - type: Literal["predefined"] - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - ocr_enabled: Optional[bool] = None - - open_access: Optional[bool] = None - """Whether this profile can be accessed by anyone.""" - - -class IntegrationProfileEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationProfileEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationProfileEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - -class IntegrationProfileEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationProfileEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationProfileEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationProfileEntry: TypeAlias = Union[ - IntegrationProfileEntryCustomEntry, - IntegrationProfileEntryPredefinedEntry, - IntegrationProfileEntryIntegrationEntry, - IntegrationProfileEntryExactDataEntry, - IntegrationProfileEntryWordListEntry, -] - - -class IntegrationProfile(BaseModel): - id: str - - created_at: datetime - - entries: List[IntegrationProfileEntry] - - name: str - - type: Literal["integration"] - - updated_at: datetime - - description: Optional[str] = None - """The description of the profile.""" - - -CustomCreateResponse: TypeAlias = Union[CustomProfile, PredefinedProfile, IntegrationProfile, List[Profile]] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py index 6a2f6a50731..9bfb604a4b2 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py @@ -14,9 +14,9 @@ "EntryDLPNewCustomEntryWithID", "EntryDLPNewCustomEntry", "SharedEntry", - "SharedEntryUnionMember0", - "SharedEntryUnionMember1", - "SharedEntryUnionMember2", + "SharedEntryPredefined", + "SharedEntryIntegration", + "SharedEntryExactData", ] @@ -73,7 +73,7 @@ class EntryDLPNewCustomEntry(TypedDict, total=False): Entry: TypeAlias = Union[EntryDLPNewCustomEntryWithID, EntryDLPNewCustomEntry] -class SharedEntryUnionMember0(TypedDict, total=False): +class SharedEntryPredefined(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -81,7 +81,7 @@ class SharedEntryUnionMember0(TypedDict, total=False): entry_type: Required[Literal["predefined"]] -class SharedEntryUnionMember1(TypedDict, total=False): +class SharedEntryIntegration(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -89,7 +89,7 @@ class SharedEntryUnionMember1(TypedDict, total=False): entry_type: Required[Literal["integration"]] -class SharedEntryUnionMember2(TypedDict, total=False): +class SharedEntryExactData(TypedDict, total=False): enabled: Required[bool] entry_id: Required[str] @@ -97,4 +97,4 @@ class SharedEntryUnionMember2(TypedDict, total=False): entry_type: Required[Literal["exact_data"]] -SharedEntry: TypeAlias = Union[SharedEntryUnionMember0, SharedEntryUnionMember1, SharedEntryUnionMember2] +SharedEntry: TypeAlias = Union[SharedEntryPredefined, SharedEntryIntegration, SharedEntryExactData] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py index 0085792d8df..9a6191ed0f9 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py @@ -13,8 +13,6 @@ class PredefinedUpdateParams(TypedDict, total=False): account_id: Required[str] - entries: Required[Iterable[Entry]] - ai_context_enabled: bool allowed_match_count: Optional[int] @@ -27,6 +25,8 @@ class PredefinedUpdateParams(TypedDict, total=False): keywords. """ + entries: Iterable[Entry] + ocr_enabled: bool diff --git a/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings.py b/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings.py index 147a995e673..33632f6afc7 100644 --- a/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings.py @@ -3,6 +3,8 @@ from typing import Optional from typing_extensions import Literal +from pydantic import Field as FieldInfo + from ...._models import BaseModel from .tls_settings import TLSSettings from .fips_settings import FipsSettings @@ -15,7 +17,12 @@ from .browser_isolation_settings import BrowserIsolationSettings from .custom_certificate_settings import CustomCertificateSettings -__all__ = ["GatewayConfigurationSettings", "Certificate", "HostSelector", "Sandbox"] +__all__ = ["GatewayConfigurationSettings", "AppControlSettings", "Certificate", "HostSelector", "Sandbox"] + + +class AppControlSettings(BaseModel): + enabled: Optional[bool] = None + """Enable App Control""" class Certificate(BaseModel): @@ -47,6 +54,9 @@ class GatewayConfigurationSettings(BaseModel): antivirus: Optional[AntiVirusSettings] = None """Anti-virus settings.""" + app_control_settings: Optional[AppControlSettings] = FieldInfo(alias="app-control-settings", default=None) + """Setting to enable App Control""" + block_page: Optional[BlockPageSettings] = None """Block page layout settings.""" diff --git a/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings_param.py b/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings_param.py index 3e9c6571c5a..b3d391ed319 100644 --- a/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings_param.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings_param.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict +from ...._utils import PropertyInfo from .tls_settings_param import TLSSettingsParam from .fips_settings_param import FipsSettingsParam from .protocol_detection_param import ProtocolDetectionParam @@ -16,7 +17,12 @@ from .browser_isolation_settings_param import BrowserIsolationSettingsParam from .custom_certificate_settings_param import CustomCertificateSettingsParam -__all__ = ["GatewayConfigurationSettingsParam", "Certificate", "HostSelector", "Sandbox"] +__all__ = ["GatewayConfigurationSettingsParam", "AppControlSettings", "Certificate", "HostSelector", "Sandbox"] + + +class AppControlSettings(TypedDict, total=False): + enabled: bool + """Enable App Control""" class Certificate(TypedDict, total=False): @@ -48,6 +54,9 @@ class GatewayConfigurationSettingsParam(TypedDict, total=False): antivirus: Optional[AntiVirusSettingsParam] """Anti-virus settings.""" + app_control_settings: Annotated[Optional[AppControlSettings], PropertyInfo(alias="app-control-settings")] + """Setting to enable App Control""" + block_page: Optional[BlockPageSettingsParam] """Block page layout settings.""" diff --git a/src/cloudflare/types/zero_trust/gateway/gateway_rule.py b/src/cloudflare/types/zero_trust/gateway/gateway_rule.py index 9e97c13acbd..411a06e4c77 100644 --- a/src/cloudflare/types/zero_trust/gateway/gateway_rule.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_rule.py @@ -123,3 +123,6 @@ class GatewayRule(BaseModel): version: Optional[int] = None """version number of the rule""" + + warning_status: Optional[str] = None + """Warning for a misconfigured rule, if any.""" diff --git a/src/cloudflare/types/zero_trust/gateway/list_edit_params.py b/src/cloudflare/types/zero_trust/gateway/list_edit_params.py index bdc08db33cc..e3da0983271 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_edit_params.py @@ -5,16 +5,22 @@ from typing import List, Iterable from typing_extensions import Required, TypedDict -from .gateway_item_param import GatewayItemParam - -__all__ = ["ListEditParams"] +__all__ = ["ListEditParams", "Append"] class ListEditParams(TypedDict, total=False): account_id: Required[str] - append: Iterable[GatewayItemParam] - """The items in the list.""" + append: Iterable[Append] + """items to add to the list.""" remove: List[str] """A list of the item values you want to remove.""" + + +class Append(TypedDict, total=False): + description: str + """The description of the list item, if present""" + + value: str + """The value of the item in a list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py index b224b4561c1..84432d8e0bb 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -50,10 +50,11 @@ class BISOAdminControls(BaseModel): dk: Optional[bool] = None """Set to false to enable keyboard usage. Only applies when `version == "v1"`.""" - download: Optional[Literal["enabled", "disabled"]] = None + download: Optional[Literal["enabled", "disabled", "remote_only"]] = None """Configure whether downloading enabled or not. - When absent, downloading is enabled. Only applies when `version == "v2"`. + When set with "remote_only", downloads are only available for viewing. Only + applies when `version == "v2"`. """ dp: Optional[bool] = None diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 3de22e9895e..ce610ff6660 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -49,10 +49,11 @@ class BISOAdminControls(TypedDict, total=False): dk: bool """Set to false to enable keyboard usage. Only applies when `version == "v1"`.""" - download: Literal["enabled", "disabled"] + download: Literal["enabled", "disabled", "remote_only"] """Configure whether downloading enabled or not. - When absent, downloading is enabled. Only applies when `version == "v2"`. + When set with "remote_only", downloads are only available for viewing. Only + applies when `version == "v2"`. """ dp: bool diff --git a/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py b/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py index b4ddaed53fc..2ffa581aed1 100644 --- a/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py @@ -19,3 +19,6 @@ class VirtualNetworkCreateParams(TypedDict, total=False): is_default: bool """If `true`, this virtual network is the default for the account.""" + + is_default_network: bool + """If `true`, this virtual network is the default for the account.""" diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index 5288057feb0..7e056c15dca 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -74,14 +74,9 @@ from .automatic_https_rewrites import AutomaticHTTPSRewrites as AutomaticHTTPSRewrites from .opportunistic_encryption import OpportunisticEncryption as OpportunisticEncryption from .response_buffering_param import ResponseBufferingParam as ResponseBufferingParam -from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse -from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams -from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .origin_error_page_pass_thru import OriginErrorPagePassThru as OriginErrorPagePassThru from .sort_query_string_for_cache import SortQueryStringForCache as SortQueryStringForCache from .true_client_ip_header_param import TrueClientIPHeaderParam as TrueClientIPHeaderParam -from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse -from .subscription_update_response import SubscriptionUpdateResponse as SubscriptionUpdateResponse from .automatic_https_rewrites_param import AutomaticHTTPSRewritesParam as AutomaticHTTPSRewritesParam from .custom_nameserver_get_response import CustomNameserverGetResponse as CustomNameserverGetResponse from .opportunistic_encryption_param import OpportunisticEncryptionParam as OpportunisticEncryptionParam diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py index 20e00c32e01..82695d01e01 100644 --- a/src/cloudflare/types/zones/setting_edit_response.py +++ b/src/cloudflare/types/zones/setting_edit_response.py @@ -320,7 +320,7 @@ class ZonesMaxUpload(BaseModel): id: Literal["max_upload"] """identifier of the zone setting.""" - value: Literal[100, 200, 500] + value: Literal[100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 1000] """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None diff --git a/src/cloudflare/types/zones/setting_get_response.py b/src/cloudflare/types/zones/setting_get_response.py index c745779b31e..a2e82b89e4d 100644 --- a/src/cloudflare/types/zones/setting_get_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -320,7 +320,7 @@ class ZonesMaxUpload(BaseModel): id: Literal["max_upload"] """identifier of the zone setting.""" - value: Literal[100, 200, 500] + value: Literal[100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500, 1000] """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None diff --git a/src/cloudflare/types/zones/subscription_create_params.py b/src/cloudflare/types/zones/subscription_create_params.py deleted file mode 100644 index df36fa035e2..00000000000 --- a/src/cloudflare/types/zones/subscription_create_params.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -from ..shared_params.rate_plan import RatePlan - -__all__ = ["SubscriptionCreateParams"] - - -class SubscriptionCreateParams(TypedDict, total=False): - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] - """How often the subscription is renewed automatically.""" - - rate_plan: RatePlan - """The rate plan applied to the subscription.""" diff --git a/src/cloudflare/types/zones/subscription_create_response.py b/src/cloudflare/types/zones/subscription_create_response.py deleted file mode 100644 index 5ba8b499d96..00000000000 --- a/src/cloudflare/types/zones/subscription_create_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -__all__ = ["SubscriptionCreateResponse"] - -SubscriptionCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zones/subscription_get_response.py b/src/cloudflare/types/zones/subscription_get_response.py deleted file mode 100644 index 88f2f2b2875..00000000000 --- a/src/cloudflare/types/zones/subscription_get_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -__all__ = ["SubscriptionGetResponse"] - -SubscriptionGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zones/subscription_update_params.py b/src/cloudflare/types/zones/subscription_update_params.py deleted file mode 100644 index 88ee258388f..00000000000 --- a/src/cloudflare/types/zones/subscription_update_params.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -from ..shared_params.rate_plan import RatePlan - -__all__ = ["SubscriptionUpdateParams"] - - -class SubscriptionUpdateParams(TypedDict, total=False): - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] - """How often the subscription is renewed automatically.""" - - rate_plan: RatePlan - """The rate plan applied to the subscription.""" diff --git a/src/cloudflare/types/zones/subscription_update_response.py b/src/cloudflare/types/zones/subscription_update_response.py deleted file mode 100644 index 71628cdb370..00000000000 --- a/src/cloudflare/types/zones/subscription_update_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -__all__ = ["SubscriptionUpdateResponse"] - -SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zones/zone.py b/src/cloudflare/types/zones/zone.py index 142dd297b5f..c42c7fcf62d 100644 --- a/src/cloudflare/types/zones/zone.py +++ b/src/cloudflare/types/zones/zone.py @@ -15,27 +15,27 @@ class Account(BaseModel): """Identifier""" name: Optional[str] = None - """The name of the account""" + """The name of the account.""" class Meta(BaseModel): cdn_only: Optional[bool] = None - """The zone is only configured for CDN""" + """The zone is only configured for CDN.""" custom_certificate_quota: Optional[int] = None - """Number of Custom Certificates the zone can have""" + """Number of Custom Certificates the zone can have.""" dns_only: Optional[bool] = None - """The zone is only configured for DNS""" + """The zone is only configured for DNS.""" foundation_dns: Optional[bool] = None - """The zone is setup with Foundation DNS""" + """The zone is setup with Foundation DNS.""" page_rule_quota: Optional[int] = None - """Number of Page Rules a zone can have""" + """Number of Page Rules a zone can have.""" phishing_detected: Optional[bool] = None - """The zone has been flagged for phishing""" + """The zone has been flagged for phishing.""" step: Optional[int] = None @@ -45,10 +45,10 @@ class Owner(BaseModel): """Identifier""" name: Optional[str] = None - """Name of the owner""" + """Name of the owner.""" type: Optional[str] = None - """The type of owner""" + """The type of owner.""" class Plan(BaseModel): @@ -77,7 +77,7 @@ class Plan(BaseModel): """The legacy name of the plan.""" name: Optional[str] = None - """Name of the owner""" + """Name of the owner.""" price: Optional[float] = None """How much the customer is paying.""" @@ -101,13 +101,13 @@ class Zone(BaseModel): """Identifier""" account: Account - """The account the zone belongs to""" + """The account the zone belongs to.""" activated_on: Optional[datetime] = None - """The last time proof of ownership was detected and the zone was made active""" + """The last time proof of ownership was detected and the zone was made active.""" created_on: datetime - """When the zone was created""" + """When the zone was created.""" development_mode: float """ @@ -117,28 +117,28 @@ class Zone(BaseModel): """ meta: Meta - """Metadata about the zone""" + """Metadata about the zone.""" modified_on: datetime - """When the zone was last modified""" + """When the zone was last modified.""" name: str - """The domain name""" + """The domain name.""" name_servers: List[str] - """The name servers Cloudflare assigns to a zone""" + """The name servers Cloudflare assigns to a zone.""" original_dnshost: Optional[str] = None - """DNS host at the time of switching to Cloudflare""" + """DNS host at the time of switching to Cloudflare.""" original_name_servers: Optional[List[str]] = None - """Original name servers before moving to Cloudflare""" + """Original name servers before moving to Cloudflare.""" original_registrar: Optional[str] = None - """Registrar for the domain at the time of switching to Cloudflare""" + """Registrar for the domain at the time of switching to Cloudflare.""" owner: Owner - """The owner of the zone""" + """The owner of the zone.""" plan: Plan """A Zones subscription information.""" diff --git a/src/cloudflare/types/zones/zone_create_params.py b/src/cloudflare/types/zones/zone_create_params.py index 9500909dced..209f8e0d0a5 100644 --- a/src/cloudflare/types/zones/zone_create_params.py +++ b/src/cloudflare/types/zones/zone_create_params.py @@ -13,7 +13,7 @@ class ZoneCreateParams(TypedDict, total=False): account: Required[Account] name: Required[str] - """The domain name""" + """The domain name.""" type: Type """A full zone implies that DNS is hosted with Cloudflare. diff --git a/src/cloudflare/types/zones/zone_list_params.py b/src/cloudflare/types/zones/zone_list_params.py index 0b53d561d10..8e6985ebfe1 100644 --- a/src/cloudflare/types/zones/zone_list_params.py +++ b/src/cloudflare/types/zones/zone_list_params.py @@ -41,12 +41,12 @@ class ZoneListParams(TypedDict, total=False): """Number of zones per page.""" status: Literal["initializing", "pending", "active", "moved"] - """A zone status""" + """Specify a zone status to filter by.""" class Account(TypedDict, total=False): id: str - """An account ID""" + """Filter by an account ID.""" name: str """An account Name. diff --git a/tests/api_resources/accounts/logs/test_audit.py b/tests/api_resources/accounts/logs/test_audit.py index 8e9d2c5219b..492d0ca3521 100644 --- a/tests/api_resources/accounts/logs/test_audit.py +++ b/tests/api_resources/accounts/logs/test_audit.py @@ -36,30 +36,30 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="a67e14daa5f8dceeb91fe5449ba496ef", before=parse_date("2024-10-31"), since=parse_date("2024-10-30"), - account_name="account_name", - action_result="success", - action_type="create", - actor_context="api_key", - actor_email="alice@example.com", - actor_id="1d20c3afe174f18b642710cec6298a9d", - actor_ip_address="17.168.228.63", - actor_token_id="144cdb2e39c55e203cf225d8d8208647", - actor_token_name="Test Token", - actor_type="account", - audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db", + account_name={"not": ["string"]}, + action_result={"not": ["success"]}, + action_type={"not": ["create"]}, + actor_context={"not": ["api_key"]}, + actor_email={"not": ["alice@example.com"]}, + actor_id={"not": ["1d20c3afe174f18b642710cec6298a9d"]}, + actor_ip_address={"not": ["17.168.228.63"]}, + actor_token_id={"not": ["144cdb2e39c55e203cf225d8d8208647"]}, + actor_token_name={"not": ["Test Token"]}, + actor_type={"not": ["account"]}, + audit_log_id={"not": ["f174be97-19b1-40d6-954d-70cd5fbd52db"]}, cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", direction="desc", limit=25, - raw_cf_rayid="8e8dd2156ef28414", - raw_method="GET", - raw_status_code=200, - raw_uri="raw_uri", - resource_id="resource_id", - resource_product="Stream", - resource_scope="accounts", - resource_type="Video", - zone_id="zone_id", - zone_name="example.com", + raw_cf_rayid={"not": ["8e8dd2156ef28414"]}, + raw_method={"not": ["GET"]}, + raw_status_code={"not": [200]}, + raw_uri={"not": ["string"]}, + resource_id={"not": ["string"]}, + resource_product={"not": ["Stream"]}, + resource_scope={"not": ["accounts"]}, + resource_type={"not": ["Video"]}, + zone_id={"not": ["string"]}, + zone_name={"not": ["example.com"]}, ) assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) @@ -124,30 +124,30 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="a67e14daa5f8dceeb91fe5449ba496ef", before=parse_date("2024-10-31"), since=parse_date("2024-10-30"), - account_name="account_name", - action_result="success", - action_type="create", - actor_context="api_key", - actor_email="alice@example.com", - actor_id="1d20c3afe174f18b642710cec6298a9d", - actor_ip_address="17.168.228.63", - actor_token_id="144cdb2e39c55e203cf225d8d8208647", - actor_token_name="Test Token", - actor_type="account", - audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db", + account_name={"not": ["string"]}, + action_result={"not": ["success"]}, + action_type={"not": ["create"]}, + actor_context={"not": ["api_key"]}, + actor_email={"not": ["alice@example.com"]}, + actor_id={"not": ["1d20c3afe174f18b642710cec6298a9d"]}, + actor_ip_address={"not": ["17.168.228.63"]}, + actor_token_id={"not": ["144cdb2e39c55e203cf225d8d8208647"]}, + actor_token_name={"not": ["Test Token"]}, + actor_type={"not": ["account"]}, + audit_log_id={"not": ["f174be97-19b1-40d6-954d-70cd5fbd52db"]}, cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", direction="desc", limit=25, - raw_cf_rayid="8e8dd2156ef28414", - raw_method="GET", - raw_status_code=200, - raw_uri="raw_uri", - resource_id="resource_id", - resource_product="Stream", - resource_scope="accounts", - resource_type="Video", - zone_id="zone_id", - zone_name="example.com", + raw_cf_rayid={"not": ["8e8dd2156ef28414"]}, + raw_method={"not": ["GET"]}, + raw_status_code={"not": [200]}, + raw_uri={"not": ["string"]}, + resource_id={"not": ["string"]}, + resource_product={"not": ["Stream"]}, + resource_scope={"not": ["accounts"]}, + resource_type={"not": ["Video"]}, + zone_id={"not": ["string"]}, + zone_name={"not": ["example.com"]}, ) assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) diff --git a/tests/api_resources/accounts/test_members.py b/tests/api_resources/accounts/test_members.py index df175df822b..f35d0e13841 100644 --- a/tests/api_resources/accounts/test_members.py +++ b/tests/api_resources/accounts/test_members.py @@ -25,7 +25,7 @@ class TestMembers: @parametrize def test_method_create_overload_1(self, client: Cloudflare) -> None: member = client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], ) @@ -35,7 +35,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: member = client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], status="accepted", @@ -46,7 +46,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N @parametrize def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], ) @@ -60,7 +60,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], ) as response: @@ -86,7 +86,7 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: @parametrize def test_method_create_overload_2(self, client: Cloudflare) -> None: member = client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -105,7 +105,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: member = client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -125,7 +125,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N @parametrize def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -148,7 +148,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -193,7 +193,7 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: def test_method_update_overload_1(self, client: Cloudflare) -> None: member = client.accounts.members.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Member], member, path=["response"]) @@ -202,7 +202,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: member = client.accounts.members.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", roles=[{"id": "3536bcfad5faccb999b47003c79917fb"}], ) assert_matches_type(Optional[Member], member, path=["response"]) @@ -212,7 +212,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -225,7 +225,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -247,7 +247,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): client.accounts.members.with_raw_response.update( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -255,7 +255,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: def test_method_update_overload_2(self, client: Cloudflare) -> None: member = client.accounts.members.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -274,7 +274,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -297,7 +297,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -339,7 +339,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): client.accounts.members.with_raw_response.update( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -355,14 +355,14 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: member = client.accounts.members.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[Member], member, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: member = client.accounts.members.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", direction="desc", order="status", page=1, @@ -374,7 +374,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -385,7 +385,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -407,7 +407,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: member = client.accounts.members.delete( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) @@ -416,7 +416,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.delete( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -429,7 +429,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.delete( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -451,7 +451,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): client.accounts.members.with_raw_response.delete( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="HTTP 422 error from prism") @@ -459,7 +459,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: member = client.accounts.members.get( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Member], member, path=["response"]) @@ -468,7 +468,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.accounts.members.with_raw_response.get( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -481,7 +481,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.accounts.members.with_streaming_response.get( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -503,7 +503,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): client.accounts.members.with_raw_response.get( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -514,7 +514,7 @@ class TestAsyncMembers: @parametrize async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], ) @@ -524,7 +524,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], status="accepted", @@ -535,7 +535,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], ) @@ -549,7 +549,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", roles=["3536bcfad5faccb999b47003c79917fb"], ) as response: @@ -575,7 +575,7 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare @parametrize async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -594,7 +594,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -614,7 +614,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -637,7 +637,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", policies=[ { @@ -682,7 +682,7 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Member], member, path=["response"]) @@ -691,7 +691,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", roles=[{"id": "3536bcfad5faccb999b47003c79917fb"}], ) assert_matches_type(Optional[Member], member, path=["response"]) @@ -701,7 +701,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -714,7 +714,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -736,7 +736,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): await async_client.accounts.members.with_raw_response.update( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -744,7 +744,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -763,7 +763,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -786,7 +786,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.update( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -828,7 +828,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): await async_client.accounts.members.with_raw_response.update( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", policies=[ { "access": "allow", @@ -844,14 +844,14 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[Member], member, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", direction="desc", order="status", page=1, @@ -863,7 +863,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -874,7 +874,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -896,7 +896,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.delete( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) @@ -905,7 +905,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.delete( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -918,7 +918,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.delete( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -940,7 +940,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): await async_client.accounts.members.with_raw_response.delete( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="HTTP 422 error from prism") @@ -948,7 +948,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: member = await async_client.accounts.members.get( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Member], member, path=["response"]) @@ -957,7 +957,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.members.with_raw_response.get( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -970,7 +970,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.members.with_streaming_response.get( member_id="4536bcfad5faccb111b47003c79917fa", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -992,5 +992,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): await async_client.accounts.members.with_raw_response.get( member_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/accounts/test_roles.py b/tests/api_resources/accounts/test_roles.py index 18aac24e26f..6a97d8c4b31 100644 --- a/tests/api_resources/accounts/test_roles.py +++ b/tests/api_resources/accounts/test_roles.py @@ -21,14 +21,14 @@ class TestRoles: @parametrize def test_method_list(self, client: Cloudflare) -> None: role = client.accounts.roles.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[Role], role, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: role = client.accounts.roles.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=5, ) @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.accounts.roles.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.accounts.roles.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,7 +69,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: role = client.accounts.roles.get( role_id="3536bcfad5faccb999b47003c79917fb", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Role], role, path=["response"]) @@ -77,7 +77,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.accounts.roles.with_raw_response.get( role_id="3536bcfad5faccb999b47003c79917fb", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -89,7 +89,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.accounts.roles.with_streaming_response.get( role_id="3536bcfad5faccb999b47003c79917fb", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,7 +110,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `role_id` but received ''"): client.accounts.roles.with_raw_response.get( role_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -120,14 +120,14 @@ class TestAsyncRoles: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: role = await async_client.accounts.roles.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[Role], role, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: role = await async_client.accounts.roles.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=5, ) @@ -136,7 +136,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.roles.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -147,7 +147,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.roles.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -168,7 +168,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: role = await async_client.accounts.roles.get( role_id="3536bcfad5faccb999b47003c79917fb", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Role], role, path=["response"]) @@ -176,7 +176,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.roles.with_raw_response.get( role_id="3536bcfad5faccb999b47003c79917fb", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -188,7 +188,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.roles.with_streaming_response.get( role_id="3536bcfad5faccb999b47003c79917fb", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -209,5 +209,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `role_id` but received ''"): await async_client.accounts.roles.with_raw_response.get( role_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/accounts/test_subscriptions.py b/tests/api_resources/accounts/test_subscriptions.py index 7a6796f04a3..b09e6c11610 100644 --- a/tests/api_resources/accounts/test_subscriptions.py +++ b/tests/api_resources/accounts/test_subscriptions.py @@ -11,11 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import Subscription -from cloudflare.types.accounts import ( - SubscriptionCreateResponse, - SubscriptionDeleteResponse, - SubscriptionUpdateResponse, -) +from cloudflare.types.accounts import SubscriptionDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: subscription = client.accounts.subscriptions.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -45,7 +41,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "sets": ["string"], }, ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -56,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -67,7 +63,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -84,7 +80,7 @@ def test_method_update(self, client: Cloudflare) -> None: subscription_identifier="506e3185e9c882d175a2d0cb0093d9f2", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -102,7 +98,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "sets": ["string"], }, ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -114,7 +110,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -126,7 +122,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -243,7 +239,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.accounts.subscriptions.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -260,7 +256,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "sets": ["string"], }, ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -271,7 +267,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -282,7 +278,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -299,7 +295,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: subscription_identifier="506e3185e9c882d175a2d0cb0093d9f2", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -317,7 +313,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "sets": ["string"], }, ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -329,7 +325,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -341,7 +337,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/accounts/test_tokens.py b/tests/api_resources/accounts/test_tokens.py index e4aa45c1360..6b17512734d 100644 --- a/tests/api_resources/accounts/test_tokens.py +++ b/tests/api_resources/accounts/test_tokens.py @@ -28,7 +28,7 @@ class TestTokens: @parametrize def test_method_create(self, client: Cloudflare) -> None: token = client.accounts.tokens.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -50,7 +50,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: token = client.accounts.tokens.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -92,7 +92,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -118,7 +118,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -169,7 +169,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: def test_method_update(self, client: Cloudflare) -> None: token = client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -193,7 +193,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: token = client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -237,7 +237,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -265,7 +265,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -317,7 +317,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.accounts.tokens.with_raw_response.update( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -339,7 +339,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: token = client.accounts.tokens.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[Token], token, path=["response"]) @@ -347,7 +347,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: token = client.accounts.tokens.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", direction="desc", page=1, per_page=5, @@ -358,7 +358,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -370,7 +370,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -393,7 +393,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: token = client.accounts.tokens.delete( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[TokenDeleteResponse], token, path=["response"]) @@ -402,7 +402,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.delete( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -415,7 +415,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.delete( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -437,7 +437,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.accounts.tokens.with_raw_response.delete( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -445,7 +445,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: token = client.accounts.tokens.get( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -454,7 +454,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.get( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -467,7 +467,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.get( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -489,14 +489,14 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.accounts.tokens.with_raw_response.get( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_verify(self, client: Cloudflare) -> None: token = client.accounts.tokens.verify( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[TokenVerifyResponse], token, path=["response"]) @@ -504,7 +504,7 @@ def test_method_verify(self, client: Cloudflare) -> None: @parametrize def test_raw_response_verify(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.verify( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -516,7 +516,7 @@ def test_raw_response_verify(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_verify(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.verify( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -542,7 +542,7 @@ class TestAsyncTokens: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -564,7 +564,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -606,7 +606,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -632,7 +632,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -683,7 +683,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: async def test_method_update(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -707,7 +707,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -751,7 +751,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -779,7 +779,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -831,7 +831,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.accounts.tokens.with_raw_response.update( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="readonly token", policies=[ { @@ -853,7 +853,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[Token], token, path=["response"]) @@ -861,7 +861,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", direction="desc", page=1, per_page=5, @@ -872,7 +872,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -884,7 +884,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -907,7 +907,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.delete( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[TokenDeleteResponse], token, path=["response"]) @@ -916,7 +916,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.delete( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -929,7 +929,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.with_streaming_response.delete( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -951,7 +951,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.accounts.tokens.with_raw_response.delete( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -959,7 +959,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.get( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -968,7 +968,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.get( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -981,7 +981,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.with_streaming_response.get( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1003,14 +1003,14 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.accounts.tokens.with_raw_response.get( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_verify(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.verify( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[TokenVerifyResponse], token, path=["response"]) @@ -1018,7 +1018,7 @@ async def test_method_verify(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_verify(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.verify( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -1030,7 +1030,7 @@ async def test_raw_response_verify(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_verify(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.with_streaming_response.verify( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/accounts/tokens/test_permission_groups.py b/tests/api_resources/accounts/tokens/test_permission_groups.py index d6d6a731a9f..bd764c44569 100644 --- a/tests/api_resources/accounts/tokens/test_permission_groups.py +++ b/tests/api_resources/accounts/tokens/test_permission_groups.py @@ -22,7 +22,7 @@ class TestPermissionGroups: @parametrize def test_method_list(self, client: Cloudflare) -> None: permission_group = client.accounts.tokens.permission_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @@ -30,7 +30,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.accounts.tokens.permission_groups.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -42,7 +42,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.accounts.tokens.permission_groups.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,7 +64,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: permission_group = client.accounts.tokens.permission_groups.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) @@ -72,7 +72,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.accounts.tokens.permission_groups.with_raw_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -84,7 +84,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.accounts.tokens.permission_groups.with_streaming_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,7 +110,7 @@ class TestAsyncPermissionGroups: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.accounts.tokens.permission_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @@ -118,7 +118,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.permission_groups.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -130,7 +130,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.permission_groups.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,7 +152,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.accounts.tokens.permission_groups.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) @@ -160,7 +160,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.permission_groups.with_raw_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -172,7 +172,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.permission_groups.with_streaming_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/accounts/tokens/test_value.py b/tests/api_resources/accounts/tokens/test_value.py index f9e36030d8c..00a709c212b 100644 --- a/tests/api_resources/accounts/tokens/test_value.py +++ b/tests/api_resources/accounts/tokens/test_value.py @@ -21,7 +21,7 @@ class TestValue: def test_method_update(self, client: Cloudflare) -> None: value = client.accounts.tokens.value.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(str, value, path=["response"]) @@ -31,7 +31,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.accounts.tokens.value.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -45,7 +45,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.accounts.tokens.value.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -69,7 +69,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.accounts.tokens.value.with_raw_response.update( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -82,7 +82,7 @@ class TestAsyncValue: async def test_method_update(self, async_client: AsyncCloudflare) -> None: value = await async_client.accounts.tokens.value.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(str, value, path=["response"]) @@ -92,7 +92,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.value.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -106,7 +106,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.tokens.value.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -130,6 +130,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.accounts.tokens.value.with_raw_response.update( token_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) diff --git a/tests/api_resources/addressing/prefixes/test_advertisement_status.py b/tests/api_resources/addressing/prefixes/test_advertisement_status.py index 49a7236d5d7..23ecde2d395 100644 --- a/tests/api_resources/addressing/prefixes/test_advertisement_status.py +++ b/tests/api_resources/addressing/prefixes/test_advertisement_status.py @@ -14,6 +14,8 @@ AdvertisementStatusEditResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,20 +24,23 @@ class TestAdvertisementStatus: @parametrize def test_method_edit(self, client: Cloudflare) -> None: - advertisement_status = client.addressing.prefixes.advertisement_status.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) + with pytest.warns(DeprecationWarning): + advertisement_status = client.addressing.prefixes.advertisement_status.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) + with pytest.warns(DeprecationWarning): + response = client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -44,49 +49,54 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.addressing.prefixes.advertisement_status.with_streaming_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.addressing.prefixes.advertisement_status.with_streaming_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = response.parse() - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + advertisement_status = response.parse() + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - advertised=True, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + advertised=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="", + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + advertisement_status = client.addressing.prefixes.advertisement_status.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, ) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - advertisement_status = client.addressing.prefixes.advertisement_status.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) + with pytest.warns(DeprecationWarning): + response = client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -95,31 +105,33 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.advertisement_status.with_streaming_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.addressing.prefixes.advertisement_status.with_streaming_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = response.parse() - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + advertisement_status = response.parse() + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) class TestAsyncAdvertisementStatus: @@ -127,20 +139,23 @@ class TestAsyncAdvertisementStatus: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - advertisement_status = await async_client.addressing.prefixes.advertisement_status.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) + with pytest.warns(DeprecationWarning): + advertisement_status = await async_client.addressing.prefixes.advertisement_status.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,49 +164,54 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = await response.parse() - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + advertisement_status = await response.parse() + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - advertised=True, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + advertised=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="", + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + advertisement_status = await async_client.addressing.prefixes.advertisement_status.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, ) - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - advertisement_status = await async_client.addressing.prefixes.advertisement_status.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -200,28 +220,30 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = await response.parse() - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + advertisement_status = await response.parse() + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) diff --git a/tests/api_resources/billing/test_profiles.py b/tests/api_resources/billing/test_profiles.py index 4975c71cc06..b30605d06b8 100644 --- a/tests/api_resources/billing/test_profiles.py +++ b/tests/api_resources/billing/test_profiles.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.billing import ProfileGetResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,16 +21,19 @@ class TestProfiles: @parametrize def test_method_get(self, client: Cloudflare) -> None: - profile = client.billing.profiles.get( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + profile = client.billing.profiles.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.billing.profiles.with_raw_response.get( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.billing.profiles.with_raw_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -37,23 +42,25 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.billing.profiles.with_streaming_response.get( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.billing.profiles.with_streaming_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - profile = response.parse() - assert_matches_type(ProfileGetResponse, profile, path=["response"]) + profile = response.parse() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.billing.profiles.with_raw_response.get( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.billing.profiles.with_raw_response.get( + account_id="", + ) class TestAsyncProfiles: @@ -61,16 +68,19 @@ class TestAsyncProfiles: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - profile = await async_client.billing.profiles.get( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + profile = await async_client.billing.profiles.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.billing.profiles.with_raw_response.get( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.billing.profiles.with_raw_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -79,20 +89,22 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.billing.profiles.with_streaming_response.get( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.billing.profiles.with_streaming_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - profile = await response.parse() - assert_matches_type(ProfileGetResponse, profile, path=["response"]) + profile = await response.parse() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.billing.profiles.with_raw_response.get( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.billing.profiles.with_raw_response.get( + account_id="", + ) diff --git a/tests/api_resources/cloudforce_one/test_threat_events.py b/tests/api_resources/cloudforce_one/test_threat_events.py index ef1a9616630..3a48d8f5a58 100644 --- a/tests/api_resources/cloudforce_one/test_threat_events.py +++ b/tests/api_resources/cloudforce_one/test_threat_events.py @@ -29,7 +29,7 @@ class TestThreatEvents: @parametrize def test_method_create(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -45,7 +45,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -71,7 +71,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.with_raw_response.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -91,7 +91,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.with_streaming_response.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -109,11 +109,27 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_account_id` but received ''"): + client.cloudforce_one.threat_events.with_raw_response.create( + path_account_id="", + attacker="Flying Yeti", + attacker_country="CN", + category="Domain Resolution", + date=parse_datetime("2022-04-01T00:00:00Z"), + event="An attacker registered the domain domain.com", + indicator_type="domain", + raw={"data": {"foo": "bar"}}, + tlp="amber", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_list(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.list( - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventListResponse, threat_event, path=["response"]) @@ -121,7 +137,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.list( - account_id=0, + account_id="account_id", dataset_id=["string"], force_refresh=True, order="asc", @@ -142,7 +158,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -154,7 +170,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -164,12 +180,20 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_delete(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) @@ -178,7 +202,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.with_raw_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -191,7 +215,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.with_streaming_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -204,17 +228,23 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.with_raw_response.delete( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.with_raw_response.delete( event_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_bulk_create(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.bulk_create( - account_id=0, + account_id="account_id", data=[ { "attacker": "Flying Yeti", @@ -235,7 +265,7 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.with_raw_response.bulk_create( - account_id=0, + account_id="account_id", data=[ { "attacker": "Flying Yeti", @@ -260,7 +290,7 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.with_streaming_response.bulk_create( - account_id=0, + account_id="account_id", data=[ { "attacker": "Flying Yeti", @@ -283,12 +313,33 @@ def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_bulk_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.with_raw_response.bulk_create( + account_id="", + data=[ + { + "attacker": "Flying Yeti", + "attacker_country": "CN", + "category": "Domain Resolution", + "date": parse_datetime("2022-04-01T00:00:00Z"), + "event": "An attacker registered the domain domain.com", + "indicator_type": "domain", + "raw": {"data": {"foo": "bar"}}, + "tlp": "amber", + } + ], + dataset_id="durableObjectName", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_edit(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.edit( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventEditResponse, threat_event, path=["response"]) @@ -297,7 +348,7 @@ def test_method_edit(self, client: Cloudflare) -> None: def test_method_edit_with_all_params(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.edit( event_id="event_id", - account_id=0, + account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -316,7 +367,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.with_raw_response.edit( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -329,7 +380,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.with_streaming_response.edit( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -342,10 +393,16 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.with_raw_response.edit( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.with_raw_response.edit( event_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @@ -353,7 +410,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: threat_event = client.cloudforce_one.threat_events.get( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventGetResponse, threat_event, path=["response"]) @@ -362,7 +419,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.with_raw_response.get( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -375,7 +432,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.with_streaming_response.get( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -388,10 +445,16 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.with_raw_response.get( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.with_raw_response.get( event_id="", - account_id=0, + account_id="account_id", ) @@ -402,7 +465,7 @@ class TestAsyncThreatEvents: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -418,7 +481,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -444,7 +507,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.with_raw_response.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -464,7 +527,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.with_streaming_response.create( - path_account_id=0, + path_account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -482,11 +545,27 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_account_id` but received ''"): + await async_client.cloudforce_one.threat_events.with_raw_response.create( + path_account_id="", + attacker="Flying Yeti", + attacker_country="CN", + category="Domain Resolution", + date=parse_datetime("2022-04-01T00:00:00Z"), + event="An attacker registered the domain domain.com", + indicator_type="domain", + raw={"data": {"foo": "bar"}}, + tlp="amber", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.list( - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventListResponse, threat_event, path=["response"]) @@ -494,7 +573,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.list( - account_id=0, + account_id="account_id", dataset_id=["string"], force_refresh=True, order="asc", @@ -515,7 +594,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -527,7 +606,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -537,12 +616,20 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) @@ -551,7 +638,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.with_raw_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -564,7 +651,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.with_streaming_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -577,17 +664,23 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.with_raw_response.delete( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.with_raw_response.delete( event_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.bulk_create( - account_id=0, + account_id="account_id", data=[ { "attacker": "Flying Yeti", @@ -608,7 +701,7 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.with_raw_response.bulk_create( - account_id=0, + account_id="account_id", data=[ { "attacker": "Flying Yeti", @@ -633,7 +726,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.with_streaming_response.bulk_create( - account_id=0, + account_id="account_id", data=[ { "attacker": "Flying Yeti", @@ -656,12 +749,33 @@ async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflar assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.with_raw_response.bulk_create( + account_id="", + data=[ + { + "attacker": "Flying Yeti", + "attacker_country": "CN", + "category": "Domain Resolution", + "date": parse_datetime("2022-04-01T00:00:00Z"), + "event": "An attacker registered the domain domain.com", + "indicator_type": "domain", + "raw": {"data": {"foo": "bar"}}, + "tlp": "amber", + } + ], + dataset_id="durableObjectName", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.edit( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventEditResponse, threat_event, path=["response"]) @@ -670,7 +784,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.edit( event_id="event_id", - account_id=0, + account_id="account_id", attacker="Flying Yeti", attacker_country="CN", category="Domain Resolution", @@ -689,7 +803,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.with_raw_response.edit( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -702,7 +816,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.with_streaming_response.edit( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -715,10 +829,16 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.with_raw_response.edit( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.with_raw_response.edit( event_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @@ -726,7 +846,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: threat_event = await async_client.cloudforce_one.threat_events.get( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(ThreatEventGetResponse, threat_event, path=["response"]) @@ -735,7 +855,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.with_raw_response.get( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -748,7 +868,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.with_streaming_response.get( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -761,8 +881,14 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.with_raw_response.get( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.with_raw_response.get( event_id="", - account_id=0, + account_id="account_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/datasets/__init__.py b/tests/api_resources/cloudforce_one/threat_events/datasets/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/cloudforce_one/threat_events/datasets/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/cloudforce_one/threat_events/datasets/test_health.py b/tests/api_resources/cloudforce_one/threat_events/datasets/test_health.py new file mode 100644 index 00000000000..4351d3e7fe2 --- /dev/null +++ b/tests/api_resources/cloudforce_one/threat_events/datasets/test_health.py @@ -0,0 +1,118 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.cloudforce_one.threat_events.datasets import HealthGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestHealth: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + health = client.cloudforce_one.threat_events.datasets.health.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(HealthGetResponse, health, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.cloudforce_one.threat_events.datasets.health.with_raw_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + health = response.parse() + assert_matches_type(HealthGetResponse, health, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.cloudforce_one.threat_events.datasets.health.with_streaming_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + health = response.parse() + assert_matches_type(HealthGetResponse, health, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.datasets.health.with_raw_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): + client.cloudforce_one.threat_events.datasets.health.with_raw_response.get( + dataset_id="", + account_id="account_id", + ) + + +class TestAsyncHealth: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + health = await async_client.cloudforce_one.threat_events.datasets.health.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(HealthGetResponse, health, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cloudforce_one.threat_events.datasets.health.with_raw_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + health = await response.parse() + assert_matches_type(HealthGetResponse, health, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.cloudforce_one.threat_events.datasets.health.with_streaming_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + health = await response.parse() + assert_matches_type(HealthGetResponse, health, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.health.with_raw_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.health.with_raw_response.get( + dataset_id="", + account_id="account_id", + ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_attackers.py b/tests/api_resources/cloudforce_one/threat_events/test_attackers.py index cbd2c16ac29..2b780d97b65 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_attackers.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_attackers.py @@ -21,7 +21,7 @@ class TestAttackers: @parametrize def test_method_list(self, client: Cloudflare) -> None: attacker = client.cloudforce_one.threat_events.attackers.list( - account_id=0, + account_id="account_id", ) assert_matches_type(AttackerListResponse, attacker, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.attackers.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.attackers.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,6 +51,14 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.attackers.with_raw_response.list( + account_id="", + ) + class TestAsyncAttackers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -59,7 +67,7 @@ class TestAsyncAttackers: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: attacker = await async_client.cloudforce_one.threat_events.attackers.list( - account_id=0, + account_id="account_id", ) assert_matches_type(AttackerListResponse, attacker, path=["response"]) @@ -67,7 +75,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.attackers.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -79,7 +87,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.attackers.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -88,3 +96,11 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert_matches_type(AttackerListResponse, attacker, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.attackers.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_categories.py b/tests/api_resources/cloudforce_one/threat_events/test_categories.py index b1f8500a700..983168b5bdf 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_categories.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_categories.py @@ -27,7 +27,7 @@ class TestCategories: @parametrize def test_method_create(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", ) @@ -37,7 +37,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", mitre_attack=["T1234"], @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.categories.with_raw_response.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", ) @@ -63,7 +63,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.categories.with_streaming_response.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", ) as response: @@ -75,11 +75,21 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.categories.with_raw_response.create( + account_id="", + kill_chain=0, + name="name", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_list(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.list( - account_id=0, + account_id="account_id", ) assert_matches_type(CategoryListResponse, category, path=["response"]) @@ -87,7 +97,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.categories.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -99,7 +109,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.categories.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,12 +119,20 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.categories.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_delete(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.delete( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(CategoryDeleteResponse, category, path=["response"]) @@ -122,8 +140,8 @@ def test_method_delete(self, client: Cloudflare) -> None: @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.categories.with_raw_response.delete( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -135,8 +153,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.categories.with_streaming_response.delete( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,18 +167,24 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.categories.with_raw_response.delete( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"): client.cloudforce_one.threat_events.categories.with_raw_response.delete( category_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_edit(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(CategoryEditResponse, category, path=["response"]) @@ -168,8 +192,8 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", kill_chain=0, mitre_attack=["T1234"], name="name", @@ -181,8 +205,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.categories.with_raw_response.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -194,8 +218,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.categories.with_streaming_response.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -208,18 +232,24 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.categories.with_raw_response.edit( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"): client.cloudforce_one.threat_events.categories.with_raw_response.edit( category_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_get(self, client: Cloudflare) -> None: category = client.cloudforce_one.threat_events.categories.get( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(CategoryGetResponse, category, path=["response"]) @@ -227,8 +257,8 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.categories.with_raw_response.get( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -240,8 +270,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.categories.with_streaming_response.get( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,10 +284,16 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.categories.with_raw_response.get( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"): client.cloudforce_one.threat_events.categories.with_raw_response.get( category_id="", - account_id=0, + account_id="account_id", ) @@ -268,7 +304,7 @@ class TestAsyncCategories: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", ) @@ -278,7 +314,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", mitre_attack=["T1234"], @@ -290,7 +326,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.categories.with_raw_response.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", ) @@ -304,7 +340,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.categories.with_streaming_response.create( - account_id=0, + account_id="account_id", kill_chain=0, name="name", ) as response: @@ -316,11 +352,21 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.categories.with_raw_response.create( + account_id="", + kill_chain=0, + name="name", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.list( - account_id=0, + account_id="account_id", ) assert_matches_type(CategoryListResponse, category, path=["response"]) @@ -328,7 +374,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.categories.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -340,7 +386,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.categories.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -350,12 +396,20 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.categories.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.delete( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(CategoryDeleteResponse, category, path=["response"]) @@ -363,8 +417,8 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.categories.with_raw_response.delete( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -376,8 +430,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.categories.with_streaming_response.delete( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -390,18 +444,24 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.categories.with_raw_response.delete( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"): await async_client.cloudforce_one.threat_events.categories.with_raw_response.delete( category_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(CategoryEditResponse, category, path=["response"]) @@ -409,8 +469,8 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", kill_chain=0, mitre_attack=["T1234"], name="name", @@ -422,8 +482,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.categories.with_raw_response.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -435,8 +495,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.categories.with_streaming_response.edit( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -449,18 +509,24 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.categories.with_raw_response.edit( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"): await async_client.cloudforce_one.threat_events.categories.with_raw_response.edit( category_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: category = await async_client.cloudforce_one.threat_events.categories.get( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(CategoryGetResponse, category, path=["response"]) @@ -468,8 +534,8 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.categories.with_raw_response.get( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -481,8 +547,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.categories.with_streaming_response.get( - category_id="category_id", - account_id=0, + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -495,8 +561,14 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.categories.with_raw_response.get( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"): await async_client.cloudforce_one.threat_events.categories.with_raw_response.get( category_id="", - account_id=0, + account_id="account_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_countries.py b/tests/api_resources/cloudforce_one/threat_events/test_countries.py index bad4cd2c4a0..948f95a73a0 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_countries.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_countries.py @@ -21,7 +21,7 @@ class TestCountries: @parametrize def test_method_list(self, client: Cloudflare) -> None: country = client.cloudforce_one.threat_events.countries.list( - account_id=0, + account_id="account_id", ) assert_matches_type(CountryListResponse, country, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.countries.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.countries.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,6 +51,14 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.countries.with_raw_response.list( + account_id="", + ) + class TestAsyncCountries: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -59,7 +67,7 @@ class TestAsyncCountries: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: country = await async_client.cloudforce_one.threat_events.countries.list( - account_id=0, + account_id="account_id", ) assert_matches_type(CountryListResponse, country, path=["response"]) @@ -67,7 +75,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.countries.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -79,7 +87,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.countries.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -88,3 +96,11 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert_matches_type(CountryListResponse, country, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.countries.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_crons.py b/tests/api_resources/cloudforce_one/threat_events/test_crons.py index c64e9104a08..7ba6a371d53 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_crons.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_crons.py @@ -21,7 +21,7 @@ class TestCrons: @parametrize def test_method_list(self, client: Cloudflare) -> None: cron = client.cloudforce_one.threat_events.crons.list( - account_id=0, + account_id="account_id", ) assert_matches_type(CronListResponse, cron, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.crons.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.crons.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,11 +51,19 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.crons.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_edit(self, client: Cloudflare) -> None: cron = client.cloudforce_one.threat_events.crons.edit( - account_id=0, + account_id="account_id", ) assert_matches_type(CronEditResponse, cron, path=["response"]) @@ -63,7 +71,7 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.crons.with_raw_response.edit( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -75,7 +83,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.crons.with_streaming_response.edit( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,6 +93,14 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.crons.with_raw_response.edit( + account_id="", + ) + class TestAsyncCrons: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -93,7 +109,7 @@ class TestAsyncCrons: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: cron = await async_client.cloudforce_one.threat_events.crons.list( - account_id=0, + account_id="account_id", ) assert_matches_type(CronListResponse, cron, path=["response"]) @@ -101,7 +117,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.crons.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -113,7 +129,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.crons.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -123,11 +139,19 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.crons.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: cron = await async_client.cloudforce_one.threat_events.crons.edit( - account_id=0, + account_id="account_id", ) assert_matches_type(CronEditResponse, cron, path=["response"]) @@ -135,7 +159,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.crons.with_raw_response.edit( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -147,7 +171,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.crons.with_streaming_response.edit( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,3 +180,11 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert_matches_type(CronEditResponse, cron, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.crons.with_raw_response.edit( + account_id="", + ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_datasets.py b/tests/api_resources/cloudforce_one/threat_events/test_datasets.py index 42aa9ae3127..06e97ba80c1 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_datasets.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_datasets.py @@ -27,7 +27,7 @@ class TestDatasets: @parametrize def test_method_create(self, client: Cloudflare) -> None: dataset = client.cloudforce_one.threat_events.datasets.create( - account_id=0, + account_id="account_id", is_public=True, name="x", ) @@ -37,7 +37,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.datasets.with_raw_response.create( - account_id=0, + account_id="account_id", is_public=True, name="x", ) @@ -51,7 +51,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.datasets.with_streaming_response.create( - account_id=0, + account_id="account_id", is_public=True, name="x", ) as response: @@ -63,11 +63,21 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.datasets.with_raw_response.create( + account_id="", + is_public=True, + name="x", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_list(self, client: Cloudflare) -> None: dataset = client.cloudforce_one.threat_events.datasets.list( - account_id=0, + account_id="account_id", ) assert_matches_type(DatasetListResponse, dataset, path=["response"]) @@ -75,7 +85,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.datasets.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -87,7 +97,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.datasets.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -97,12 +107,20 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.datasets.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_edit(self, client: Cloudflare) -> None: dataset = client.cloudforce_one.threat_events.datasets.edit( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", is_public=True, name="x", ) @@ -112,8 +130,8 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.datasets.with_raw_response.edit( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", is_public=True, name="x", ) @@ -127,8 +145,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.datasets.with_streaming_response.edit( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", is_public=True, name="x", ) as response: @@ -143,10 +161,18 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.datasets.with_raw_response.edit( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + is_public=True, + name="x", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): client.cloudforce_one.threat_events.datasets.with_raw_response.edit( dataset_id="", - account_id=0, + account_id="account_id", is_public=True, name="x", ) @@ -155,8 +181,8 @@ def test_path_params_edit(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: dataset = client.cloudforce_one.threat_events.datasets.get( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(DatasetGetResponse, dataset, path=["response"]) @@ -164,8 +190,8 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.datasets.with_raw_response.get( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -177,8 +203,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.datasets.with_streaming_response.get( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -191,10 +217,16 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.datasets.with_raw_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): client.cloudforce_one.threat_events.datasets.with_raw_response.get( dataset_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @@ -202,7 +234,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: def test_method_raw(self, client: Cloudflare) -> None: dataset = client.cloudforce_one.threat_events.datasets.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) assert_matches_type(DatasetRawResponse, dataset, path=["response"]) @@ -212,7 +244,7 @@ def test_method_raw(self, client: Cloudflare) -> None: def test_raw_response_raw(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.datasets.with_raw_response.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) @@ -226,7 +258,7 @@ def test_raw_response_raw(self, client: Cloudflare) -> None: def test_streaming_response_raw(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.datasets.with_streaming_response.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) as response: assert not response.is_closed @@ -240,17 +272,24 @@ def test_streaming_response_raw(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_raw(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.datasets.with_raw_response.raw( + event_id="event_id", + account_id="", + dataset_id="dataset_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): client.cloudforce_one.threat_events.datasets.with_raw_response.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.datasets.with_raw_response.raw( event_id="", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) @@ -262,7 +301,7 @@ class TestAsyncDatasets: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: dataset = await async_client.cloudforce_one.threat_events.datasets.create( - account_id=0, + account_id="account_id", is_public=True, name="x", ) @@ -272,7 +311,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.datasets.with_raw_response.create( - account_id=0, + account_id="account_id", is_public=True, name="x", ) @@ -286,7 +325,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.datasets.with_streaming_response.create( - account_id=0, + account_id="account_id", is_public=True, name="x", ) as response: @@ -298,11 +337,21 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.with_raw_response.create( + account_id="", + is_public=True, + name="x", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: dataset = await async_client.cloudforce_one.threat_events.datasets.list( - account_id=0, + account_id="account_id", ) assert_matches_type(DatasetListResponse, dataset, path=["response"]) @@ -310,7 +359,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.datasets.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -322,7 +371,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.datasets.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -332,12 +381,20 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.with_raw_response.list( + account_id="", + ) + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: dataset = await async_client.cloudforce_one.threat_events.datasets.edit( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", is_public=True, name="x", ) @@ -347,8 +404,8 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.datasets.with_raw_response.edit( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", is_public=True, name="x", ) @@ -362,8 +419,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.datasets.with_streaming_response.edit( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", is_public=True, name="x", ) as response: @@ -378,10 +435,18 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.with_raw_response.edit( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + is_public=True, + name="x", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): await async_client.cloudforce_one.threat_events.datasets.with_raw_response.edit( dataset_id="", - account_id=0, + account_id="account_id", is_public=True, name="x", ) @@ -390,8 +455,8 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: dataset = await async_client.cloudforce_one.threat_events.datasets.get( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert_matches_type(DatasetGetResponse, dataset, path=["response"]) @@ -399,8 +464,8 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.datasets.with_raw_response.get( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) assert response.is_closed is True @@ -412,8 +477,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.datasets.with_streaming_response.get( - dataset_id="dataset_id", - account_id=0, + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -426,10 +491,16 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.with_raw_response.get( + dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): await async_client.cloudforce_one.threat_events.datasets.with_raw_response.get( dataset_id="", - account_id=0, + account_id="account_id", ) @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @@ -437,7 +508,7 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: async def test_method_raw(self, async_client: AsyncCloudflare) -> None: dataset = await async_client.cloudforce_one.threat_events.datasets.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) assert_matches_type(DatasetRawResponse, dataset, path=["response"]) @@ -447,7 +518,7 @@ async def test_method_raw(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_raw(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.datasets.with_raw_response.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) @@ -461,7 +532,7 @@ async def test_raw_response_raw(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_raw(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.datasets.with_streaming_response.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) as response: assert not response.is_closed @@ -475,16 +546,23 @@ async def test_streaming_response_raw(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_raw(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.datasets.with_raw_response.raw( + event_id="event_id", + account_id="", + dataset_id="dataset_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): await async_client.cloudforce_one.threat_events.datasets.with_raw_response.raw( event_id="event_id", - account_id=0, + account_id="account_id", dataset_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.datasets.with_raw_response.raw( event_id="", - account_id=0, + account_id="account_id", dataset_id="dataset_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_event_tags.py b/tests/api_resources/cloudforce_one/threat_events/test_event_tags.py index 57058e0d73e..6c5a0829c6f 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_event_tags.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_event_tags.py @@ -25,7 +25,7 @@ class TestEventTags: def test_method_create(self, client: Cloudflare) -> None: event_tag = client.cloudforce_one.threat_events.event_tags.create( event_id="event_id", - account_id=0, + account_id="account_id", tags=["botnet"], ) assert_matches_type(EventTagCreateResponse, event_tag, path=["response"]) @@ -35,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.event_tags.with_raw_response.create( event_id="event_id", - account_id=0, + account_id="account_id", tags=["botnet"], ) @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.event_tags.with_streaming_response.create( event_id="event_id", - account_id=0, + account_id="account_id", tags=["botnet"], ) as response: assert not response.is_closed @@ -63,10 +63,17 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.event_tags.with_raw_response.create( + event_id="event_id", + account_id="", + tags=["botnet"], + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.event_tags.with_raw_response.create( event_id="", - account_id=0, + account_id="account_id", tags=["botnet"], ) @@ -75,7 +82,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: event_tag = client.cloudforce_one.threat_events.event_tags.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(EventTagDeleteResponse, event_tag, path=["response"]) @@ -84,7 +91,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.event_tags.with_raw_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -97,7 +104,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.event_tags.with_streaming_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,10 +117,16 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.event_tags.with_raw_response.delete( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.event_tags.with_raw_response.delete( event_id="", - account_id=0, + account_id="account_id", ) @@ -125,7 +138,7 @@ class TestAsyncEventTags: async def test_method_create(self, async_client: AsyncCloudflare) -> None: event_tag = await async_client.cloudforce_one.threat_events.event_tags.create( event_id="event_id", - account_id=0, + account_id="account_id", tags=["botnet"], ) assert_matches_type(EventTagCreateResponse, event_tag, path=["response"]) @@ -135,7 +148,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.event_tags.with_raw_response.create( event_id="event_id", - account_id=0, + account_id="account_id", tags=["botnet"], ) @@ -149,7 +162,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.event_tags.with_streaming_response.create( event_id="event_id", - account_id=0, + account_id="account_id", tags=["botnet"], ) as response: assert not response.is_closed @@ -163,10 +176,17 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.event_tags.with_raw_response.create( + event_id="event_id", + account_id="", + tags=["botnet"], + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.event_tags.with_raw_response.create( event_id="", - account_id=0, + account_id="account_id", tags=["botnet"], ) @@ -175,7 +195,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: event_tag = await async_client.cloudforce_one.threat_events.event_tags.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(EventTagDeleteResponse, event_tag, path=["response"]) @@ -184,7 +204,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.event_tags.with_raw_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -197,7 +217,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.event_tags.with_streaming_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -210,8 +230,14 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.event_tags.with_raw_response.delete( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.event_tags.with_raw_response.delete( event_id="", - account_id=0, + account_id="account_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_indicator_types.py b/tests/api_resources/cloudforce_one/threat_events/test_indicator_types.py index 6e354ba143b..27f277dfd80 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_indicator_types.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_indicator_types.py @@ -21,7 +21,7 @@ class TestIndicatorTypes: @parametrize def test_method_list(self, client: Cloudflare) -> None: indicator_type = client.cloudforce_one.threat_events.indicator_types.list( - account_id=0, + account_id="account_id", ) assert_matches_type(IndicatorTypeListResponse, indicator_type, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.indicator_types.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.indicator_types.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,6 +51,14 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.indicator_types.with_raw_response.list( + account_id="", + ) + class TestAsyncIndicatorTypes: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -59,7 +67,7 @@ class TestAsyncIndicatorTypes: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: indicator_type = await async_client.cloudforce_one.threat_events.indicator_types.list( - account_id=0, + account_id="account_id", ) assert_matches_type(IndicatorTypeListResponse, indicator_type, path=["response"]) @@ -67,7 +75,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.indicator_types.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -79,7 +87,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.indicator_types.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -88,3 +96,11 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert_matches_type(IndicatorTypeListResponse, indicator_type, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.indicator_types.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_insights.py b/tests/api_resources/cloudforce_one/threat_events/test_insights.py index 28d6bf1413f..2e8442fa611 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_insights.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_insights.py @@ -27,7 +27,7 @@ class TestInsights: def test_method_create(self, client: Cloudflare) -> None: insight = client.cloudforce_one.threat_events.insights.create( event_id="event_id", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) assert_matches_type(InsightCreateResponse, insight, path=["response"]) @@ -37,7 +37,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.insights.with_raw_response.create( event_id="event_id", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) @@ -51,7 +51,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.insights.with_streaming_response.create( event_id="event_id", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) as response: assert not response.is_closed @@ -65,10 +65,17 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.insights.with_raw_response.create( + event_id="event_id", + account_id="", + content="Here is some additional context _in markdown_", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.create( event_id="", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) @@ -77,7 +84,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: insight = client.cloudforce_one.threat_events.insights.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(InsightDeleteResponse, insight, path=["response"]) @@ -87,7 +94,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.insights.with_raw_response.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -101,7 +108,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.insights.with_streaming_response.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -115,17 +122,24 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.insights.with_raw_response.delete( + insight_id="insight_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `insight_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.delete( insight_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -134,7 +148,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: def test_method_edit(self, client: Cloudflare) -> None: insight = client.cloudforce_one.threat_events.insights.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) @@ -145,7 +159,7 @@ def test_method_edit(self, client: Cloudflare) -> None: def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.insights.with_raw_response.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) @@ -160,7 +174,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.insights.with_streaming_response.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) as response: @@ -175,10 +189,18 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.insights.with_raw_response.edit( + insight_id="insight_id", + account_id="", + event_id="event_id", + content="Updated: Here is some additional context _in markdown_", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="", content="Updated: Here is some additional context _in markdown_", ) @@ -186,7 +208,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `insight_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.edit( insight_id="", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) @@ -196,7 +218,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: insight = client.cloudforce_one.threat_events.insights.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(InsightGetResponse, insight, path=["response"]) @@ -206,7 +228,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.insights.with_raw_response.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -220,7 +242,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.insights.with_streaming_response.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -234,17 +256,24 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.insights.with_raw_response.get( + insight_id="insight_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `insight_id` but received ''"): client.cloudforce_one.threat_events.insights.with_raw_response.get( insight_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -257,7 +286,7 @@ class TestAsyncInsights: async def test_method_create(self, async_client: AsyncCloudflare) -> None: insight = await async_client.cloudforce_one.threat_events.insights.create( event_id="event_id", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) assert_matches_type(InsightCreateResponse, insight, path=["response"]) @@ -267,7 +296,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.insights.with_raw_response.create( event_id="event_id", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) @@ -281,7 +310,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.insights.with_streaming_response.create( event_id="event_id", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) as response: assert not response.is_closed @@ -295,10 +324,17 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.insights.with_raw_response.create( + event_id="event_id", + account_id="", + content="Here is some additional context _in markdown_", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.create( event_id="", - account_id=0, + account_id="account_id", content="Here is some additional context _in markdown_", ) @@ -307,7 +343,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: insight = await async_client.cloudforce_one.threat_events.insights.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(InsightDeleteResponse, insight, path=["response"]) @@ -317,7 +353,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.insights.with_raw_response.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -331,7 +367,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.insights.with_streaming_response.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -345,17 +381,24 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.insights.with_raw_response.delete( + insight_id="insight_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.delete( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `insight_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.delete( insight_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -364,7 +407,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: async def test_method_edit(self, async_client: AsyncCloudflare) -> None: insight = await async_client.cloudforce_one.threat_events.insights.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) @@ -375,7 +418,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.insights.with_raw_response.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) @@ -390,7 +433,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.insights.with_streaming_response.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) as response: @@ -405,10 +448,18 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.insights.with_raw_response.edit( + insight_id="insight_id", + account_id="", + event_id="event_id", + content="Updated: Here is some additional context _in markdown_", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.edit( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="", content="Updated: Here is some additional context _in markdown_", ) @@ -416,7 +467,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `insight_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.edit( insight_id="", - account_id=0, + account_id="account_id", event_id="event_id", content="Updated: Here is some additional context _in markdown_", ) @@ -426,7 +477,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: insight = await async_client.cloudforce_one.threat_events.insights.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(InsightGetResponse, insight, path=["response"]) @@ -436,7 +487,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.insights.with_raw_response.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -450,7 +501,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.insights.with_streaming_response.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -464,16 +515,23 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.insights.with_raw_response.get( + insight_id="insight_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.get( insight_id="insight_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `insight_id` but received ''"): await async_client.cloudforce_one.threat_events.insights.with_raw_response.get( insight_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_raw.py b/tests/api_resources/cloudforce_one/threat_events/test_raw.py index eed4ceb498c..b854f2753fa 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_raw.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_raw.py @@ -22,7 +22,7 @@ class TestRaw: def test_method_edit(self, client: Cloudflare) -> None: raw = client.cloudforce_one.threat_events.raw.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(RawEditResponse, raw, path=["response"]) @@ -32,7 +32,7 @@ def test_method_edit(self, client: Cloudflare) -> None: def test_method_edit_with_all_params(self, client: Cloudflare) -> None: raw = client.cloudforce_one.threat_events.raw.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", data={}, source="example.com", @@ -45,7 +45,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.raw.with_raw_response.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -59,7 +59,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.raw.with_streaming_response.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -73,17 +73,24 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.raw.with_raw_response.edit( + raw_id="raw_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.raw.with_raw_response.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `raw_id` but received ''"): client.cloudforce_one.threat_events.raw.with_raw_response.edit( raw_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -92,7 +99,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: raw = client.cloudforce_one.threat_events.raw.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(RawGetResponse, raw, path=["response"]) @@ -102,7 +109,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.raw.with_raw_response.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -116,7 +123,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.raw.with_streaming_response.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -130,17 +137,24 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.raw.with_raw_response.get( + raw_id="raw_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.raw.with_raw_response.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `raw_id` but received ''"): client.cloudforce_one.threat_events.raw.with_raw_response.get( raw_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -153,7 +167,7 @@ class TestAsyncRaw: async def test_method_edit(self, async_client: AsyncCloudflare) -> None: raw = await async_client.cloudforce_one.threat_events.raw.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(RawEditResponse, raw, path=["response"]) @@ -163,7 +177,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: raw = await async_client.cloudforce_one.threat_events.raw.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", data={}, source="example.com", @@ -176,7 +190,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.raw.with_raw_response.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -190,7 +204,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.raw.with_streaming_response.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -204,17 +218,24 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.raw.with_raw_response.edit( + raw_id="raw_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.raw.with_raw_response.edit( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `raw_id` but received ''"): await async_client.cloudforce_one.threat_events.raw.with_raw_response.edit( raw_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -223,7 +244,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: raw = await async_client.cloudforce_one.threat_events.raw.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) assert_matches_type(RawGetResponse, raw, path=["response"]) @@ -233,7 +254,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.raw.with_raw_response.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) @@ -247,7 +268,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.raw.with_streaming_response.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="event_id", ) as response: assert not response.is_closed @@ -261,16 +282,23 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.raw.with_raw_response.get( + raw_id="raw_id", + account_id="", + event_id="event_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.raw.with_raw_response.get( raw_id="raw_id", - account_id=0, + account_id="account_id", event_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `raw_id` but received ''"): await async_client.cloudforce_one.threat_events.raw.with_raw_response.get( raw_id="", - account_id=0, + account_id="account_id", event_id="event_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_relate.py b/tests/api_resources/cloudforce_one/threat_events/test_relate.py index 6d774b70187..42bf9925c6d 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_relate.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_relate.py @@ -22,7 +22,7 @@ class TestRelate: def test_method_delete(self, client: Cloudflare) -> None: relate = client.cloudforce_one.threat_events.relate.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(RelateDeleteResponse, relate, path=["response"]) @@ -31,7 +31,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.relate.with_raw_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -44,7 +44,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.relate.with_streaming_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,10 +57,16 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.relate.with_raw_response.delete( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): client.cloudforce_one.threat_events.relate.with_raw_response.delete( event_id="", - account_id=0, + account_id="account_id", ) @@ -72,7 +78,7 @@ class TestAsyncRelate: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: relate = await async_client.cloudforce_one.threat_events.relate.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert_matches_type(RelateDeleteResponse, relate, path=["response"]) @@ -81,7 +87,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.relate.with_raw_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -94,7 +100,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.relate.with_streaming_response.delete( event_id="event_id", - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -107,8 +113,14 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.relate.with_raw_response.delete( + event_id="event_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): await async_client.cloudforce_one.threat_events.relate.with_raw_response.delete( event_id="", - account_id=0, + account_id="account_id", ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_tags.py b/tests/api_resources/cloudforce_one/threat_events/test_tags.py index 5daf31ab14c..9fd56ab430b 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_tags.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_tags.py @@ -21,7 +21,7 @@ class TestTags: @parametrize def test_method_create(self, client: Cloudflare) -> None: tag = client.cloudforce_one.threat_events.tags.create( - account_id=0, + account_id="account_id", name="name", ) assert_matches_type(TagCreateResponse, tag, path=["response"]) @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.tags.with_raw_response.create( - account_id=0, + account_id="account_id", name="name", ) @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.tags.with_streaming_response.create( - account_id=0, + account_id="account_id", name="name", ) as response: assert not response.is_closed @@ -54,6 +54,15 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.tags.with_raw_response.create( + account_id="", + name="name", + ) + class TestAsyncTags: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -62,7 +71,7 @@ class TestAsyncTags: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: tag = await async_client.cloudforce_one.threat_events.tags.create( - account_id=0, + account_id="account_id", name="name", ) assert_matches_type(TagCreateResponse, tag, path=["response"]) @@ -71,7 +80,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.tags.with_raw_response.create( - account_id=0, + account_id="account_id", name="name", ) @@ -84,7 +93,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.tags.with_streaming_response.create( - account_id=0, + account_id="account_id", name="name", ) as response: assert not response.is_closed @@ -94,3 +103,12 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert_matches_type(TagCreateResponse, tag, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.tags.with_raw_response.create( + account_id="", + name="name", + ) diff --git a/tests/api_resources/cloudforce_one/threat_events/test_target_industries.py b/tests/api_resources/cloudforce_one/threat_events/test_target_industries.py index ff9c030e3eb..ffdc0a02b83 100644 --- a/tests/api_resources/cloudforce_one/threat_events/test_target_industries.py +++ b/tests/api_resources/cloudforce_one/threat_events/test_target_industries.py @@ -21,7 +21,7 @@ class TestTargetIndustries: @parametrize def test_method_list(self, client: Cloudflare) -> None: target_industry = client.cloudforce_one.threat_events.target_industries.list( - account_id=0, + account_id="account_id", ) assert_matches_type(TargetIndustryListResponse, target_industry, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.cloudforce_one.threat_events.target_industries.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.cloudforce_one.threat_events.target_industries.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,6 +51,14 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.cloudforce_one.threat_events.target_industries.with_raw_response.list( + account_id="", + ) + class TestAsyncTargetIndustries: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -59,7 +67,7 @@ class TestAsyncTargetIndustries: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: target_industry = await async_client.cloudforce_one.threat_events.target_industries.list( - account_id=0, + account_id="account_id", ) assert_matches_type(TargetIndustryListResponse, target_industry, path=["response"]) @@ -67,7 +75,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloudforce_one.threat_events.target_industries.with_raw_response.list( - account_id=0, + account_id="account_id", ) assert response.is_closed is True @@ -79,7 +87,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.cloudforce_one.threat_events.target_industries.with_streaming_response.list( - account_id=0, + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -88,3 +96,11 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert_matches_type(TargetIndustryListResponse, target_industry, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: HTTP 401 from prism") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.cloudforce_one.threat_events.target_industries.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index 673513324c9..19f3b30479b 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -29,6 +29,8 @@ class TestRecords: def test_method_create_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -37,9 +39,10 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", comment="Domain verification record", content="198.51.100.4", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -47,7 +50,6 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -56,6 +58,8 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert response.is_closed is True @@ -68,6 +72,8 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -83,6 +89,8 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="A", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -90,6 +98,8 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: def test_method_create_overload_2(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -98,9 +108,10 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", comment="Domain verification record", content="2400:cb00:2049::1", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -108,7 +119,6 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -117,6 +127,8 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert response.is_closed is True @@ -129,6 +141,8 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -144,6 +158,8 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="AAAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -151,6 +167,8 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: def test_method_create_overload_3(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -159,21 +177,18 @@ def test_method_create_overload_3(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "flags": 1, - "tag": "issue", - "value": "value", - }, name="example.com", + type="CNAME", + comment="Domain verification record", + content="content", proxied=True, settings={ + "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -182,6 +197,8 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert response.is_closed is True @@ -194,6 +211,8 @@ def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -209,6 +228,8 @@ def test_path_params_create_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="CNAME", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -216,6 +237,8 @@ def test_path_params_create_overload_3(self, client: Cloudflare) -> None: def test_method_create_overload_4(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -224,14 +247,11 @@ def test_method_create_overload_4(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 8, - "certificate": "certificate", - "key_tag": 1, - "type": 9, - }, name="example.com", + type="MX", + comment="Domain verification record", + content="mx.example.com", + priority=10, proxied=True, settings={ "ipv4_only": True, @@ -239,7 +259,6 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -248,6 +267,8 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert response.is_closed is True @@ -260,6 +281,8 @@ def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -275,6 +298,8 @@ def test_path_params_create_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="MX", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -282,6 +307,8 @@ def test_path_params_create_overload_4(self, client: Cloudflare) -> None: def test_method_create_overload_5(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -290,18 +317,17 @@ def test_method_create_overload_5(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="NS", + comment="Domain verification record", + content="ns1.example.com", proxied=True, settings={ - "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -310,6 +336,8 @@ def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> N def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert response.is_closed is True @@ -322,6 +350,8 @@ def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -337,6 +367,8 @@ def test_path_params_create_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="NS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -344,6 +376,8 @@ def test_path_params_create_overload_5(self, client: Cloudflare) -> None: def test_method_create_overload_6(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -352,14 +386,10 @@ def test_method_create_overload_6(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 5, - "flags": 1, - "protocol": 3, - "public_key": "public_key", - }, name="example.com", + type="OPENPGPKEY", + comment="Domain verification record", + content="content", proxied=True, settings={ "ipv4_only": True, @@ -367,7 +397,6 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -376,6 +405,8 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert response.is_closed is True @@ -388,6 +419,8 @@ def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,6 +436,8 @@ def test_path_params_create_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="OPENPGPKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -410,6 +445,8 @@ def test_path_params_create_overload_6(self, client: Cloudflare) -> None: def test_method_create_overload_7(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -418,14 +455,10 @@ def test_method_create_overload_7(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 3, - "digest": "digest", - "digest_type": 1, - "key_tag": 1, - }, name="example.com", + type="PTR", + comment="Domain verification record", + content="example.com", proxied=True, settings={ "ipv4_only": True, @@ -433,7 +466,6 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -442,6 +474,8 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert response.is_closed is True @@ -454,6 +488,8 @@ def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -469,6 +505,8 @@ def test_path_params_create_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="PTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -476,6 +514,8 @@ def test_path_params_create_overload_7(self, client: Cloudflare) -> None: def test_method_create_overload_8(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -484,13 +524,10 @@ def test_method_create_overload_8(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, name="example.com", + type="TXT", + comment="Domain verification record", + content='"v=spf1 include:example.com -all"', proxied=True, settings={ "ipv4_only": True, @@ -498,7 +535,6 @@ def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -507,6 +543,8 @@ def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> N def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert response.is_closed is True @@ -519,6 +557,8 @@ def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -534,6 +574,8 @@ def test_path_params_create_overload_8(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="TXT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -541,6 +583,8 @@ def test_path_params_create_overload_8(self, client: Cloudflare) -> None: def test_method_create_overload_9(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -549,22 +593,14 @@ def test_method_create_overload_9(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", comment="Domain verification record", data={ - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, + "flags": 1, + "tag": "issue", + "value": "value", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -572,7 +608,6 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -581,6 +616,8 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert response.is_closed is True @@ -593,6 +630,8 @@ def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -608,6 +647,8 @@ def test_path_params_create_overload_9(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="CAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -615,6 +656,8 @@ def test_path_params_create_overload_9(self, client: Cloudflare) -> None: def test_method_create_overload_10(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -623,10 +666,15 @@ def test_method_create_overload_10(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="mx.example.com", name="example.com", - priority=10, + type="CERT", + comment="Domain verification record", + data={ + "algorithm": 8, + "certificate": "certificate", + "key_tag": 1, + "type": 9, + }, proxied=True, settings={ "ipv4_only": True, @@ -634,7 +682,6 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -643,6 +690,8 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert response.is_closed is True @@ -655,6 +704,8 @@ def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -670,6 +721,8 @@ def test_path_params_create_overload_10(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="CERT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -677,6 +730,8 @@ def test_path_params_create_overload_10(self, client: Cloudflare) -> None: def test_method_create_overload_11(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -685,16 +740,15 @@ def test_method_create_overload_11(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", comment="Domain verification record", data={ - "flags": "flags", - "order": 100, - "preference": 10, - "regex": "regex", - "replacement": "replacement", - "service": "service", + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "public_key", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -702,7 +756,6 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -711,6 +764,8 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert response.is_closed is True @@ -723,6 +778,8 @@ def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -738,6 +795,8 @@ def test_path_params_create_overload_11(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="DNSKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -745,6 +804,8 @@ def test_path_params_create_overload_11(self, client: Cloudflare) -> None: def test_method_create_overload_12(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -753,9 +814,15 @@ def test_method_create_overload_12(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="ns1.example.com", name="example.com", + type="DS", + comment="Domain verification record", + data={ + "algorithm": 3, + "digest": "digest", + "digest_type": 1, + "key_tag": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -763,7 +830,6 @@ def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -772,6 +838,8 @@ def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert response.is_closed is True @@ -784,6 +852,8 @@ def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -799,6 +869,8 @@ def test_path_params_create_overload_12(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="DS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -806,6 +878,8 @@ def test_path_params_create_overload_12(self, client: Cloudflare) -> None: def test_method_create_overload_13(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -814,9 +888,14 @@ def test_method_create_overload_13(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="HTTPS", + comment="Domain verification record", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, proxied=True, settings={ "ipv4_only": True, @@ -824,7 +903,6 @@ def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -833,6 +911,8 @@ def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert response.is_closed is True @@ -845,6 +925,8 @@ def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -860,6 +942,8 @@ def test_path_params_create_overload_13(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="HTTPS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -867,6 +951,8 @@ def test_path_params_create_overload_13(self, client: Cloudflare) -> None: def test_method_create_overload_14(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -875,9 +961,23 @@ def test_method_create_overload_14(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="example.com", name="example.com", + type="LOC", + comment="Domain verification record", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, proxied=True, settings={ "ipv4_only": True, @@ -885,7 +985,6 @@ def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -894,6 +993,8 @@ def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert response.is_closed is True @@ -906,6 +1007,8 @@ def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -921,6 +1024,8 @@ def test_path_params_create_overload_14(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="LOC", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -928,6 +1033,8 @@ def test_path_params_create_overload_14(self, client: Cloudflare) -> None: def test_method_create_overload_15(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -936,14 +1043,17 @@ def test_method_create_overload_15(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 0, - "selector": 0, - "usage": 3, + "flags": "flags", + "order": 100, + "preference": 10, + "regex": "regex", + "replacement": "replacement", + "service": "service", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -951,7 +1061,6 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -960,7 +1069,9 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> def test_raw_response_create_overload_15(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + name="example.com", + type="NAPTR", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -972,6 +1083,8 @@ def test_raw_response_create_overload_15(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_15(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -987,6 +1100,8 @@ def test_path_params_create_overload_15(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="NAPTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -994,6 +1109,8 @@ def test_path_params_create_overload_15(self, client: Cloudflare) -> None: def test_method_create_overload_16(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1002,14 +1119,15 @@ def test_method_create_overload_16(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", comment="Domain verification record", data={ - "port": 8806, - "priority": 10, - "target": "example.com", - "weight": 5, + "certificate": "certificate", + "matching_type": 0, + "selector": 0, + "usage": 3, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1017,7 +1135,6 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1026,6 +1143,8 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert response.is_closed is True @@ -1038,6 +1157,8 @@ def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1053,6 +1174,8 @@ def test_path_params_create_overload_16(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SMIMEA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1060,6 +1183,8 @@ def test_path_params_create_overload_16(self, client: Cloudflare) -> None: def test_method_create_overload_17(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1068,13 +1193,15 @@ def test_method_create_overload_17(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", comment="Domain verification record", data={ - "algorithm": 2, - "fingerprint": "fingerprint", - "type": 1, + "port": 8806, + "priority": 10, + "target": "example.com", + "weight": 5, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1082,7 +1209,6 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1091,6 +1217,8 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert response.is_closed is True @@ -1103,6 +1231,8 @@ def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1118,6 +1248,8 @@ def test_path_params_create_overload_17(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SRV", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1125,6 +1257,8 @@ def test_path_params_create_overload_17(self, client: Cloudflare) -> None: def test_method_create_overload_18(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1133,13 +1267,14 @@ def test_method_create_overload_18(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", comment="Domain verification record", data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + "algorithm": 2, + "fingerprint": "fingerprint", + "type": 1, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1147,7 +1282,6 @@ def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1156,6 +1290,8 @@ def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert response.is_closed is True @@ -1168,6 +1304,8 @@ def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1183,6 +1321,8 @@ def test_path_params_create_overload_18(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SSHFP", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1190,6 +1330,8 @@ def test_path_params_create_overload_18(self, client: Cloudflare) -> None: def test_method_create_overload_19(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1198,14 +1340,14 @@ def test_method_create_overload_19(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 1, - "selector": 0, - "usage": 0, + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1213,7 +1355,6 @@ def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1222,6 +1363,8 @@ def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> def test_raw_response_create_overload_19(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert response.is_closed is True @@ -1234,6 +1377,8 @@ def test_raw_response_create_overload_19(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_19(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1249,6 +1394,8 @@ def test_path_params_create_overload_19(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SVCB", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1256,6 +1403,8 @@ def test_path_params_create_overload_19(self, client: Cloudflare) -> None: def test_method_create_overload_20(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1264,9 +1413,15 @@ def test_method_create_overload_20(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content='"v=spf1 include:example.com -all"', name="example.com", + type="TLSA", + comment="Domain verification record", + data={ + "certificate": "certificate", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, proxied=True, settings={ "ipv4_only": True, @@ -1274,7 +1429,6 @@ def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1283,6 +1437,8 @@ def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> def test_raw_response_create_overload_20(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert response.is_closed is True @@ -1295,6 +1451,8 @@ def test_raw_response_create_overload_20(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_20(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1310,6 +1468,8 @@ def test_path_params_create_overload_20(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="TLSA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1317,6 +1477,8 @@ def test_path_params_create_overload_20(self, client: Cloudflare) -> None: def test_method_create_overload_21(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1325,12 +1487,13 @@ def test_method_create_overload_21(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_21(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", comment="Domain verification record", data={ "target": "http://example.com/example.html", "weight": 20, }, - name="example.com", priority=10, proxied=True, settings={ @@ -1339,7 +1502,6 @@ def test_method_create_with_all_params_overload_21(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1348,6 +1510,8 @@ def test_method_create_with_all_params_overload_21(self, client: Cloudflare) -> def test_raw_response_create_overload_21(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert response.is_closed is True @@ -1360,6 +1524,8 @@ def test_raw_response_create_overload_21(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_21(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1375,6 +1541,8 @@ def test_path_params_create_overload_21(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="URI", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1383,6 +1551,8 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1392,9 +1562,10 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", comment="Domain verification record", content="198.51.100.4", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1402,7 +1573,6 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1412,6 +1582,8 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert response.is_closed is True @@ -1425,6 +1597,8 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1441,12 +1615,16 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="A", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1455,6 +1633,8 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1464,9 +1644,10 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", comment="Domain verification record", content="2400:cb00:2049::1", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1474,7 +1655,6 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1484,6 +1664,8 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert response.is_closed is True @@ -1497,6 +1679,8 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1513,12 +1697,16 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="AAAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1527,6 +1715,8 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1536,21 +1726,18 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "flags": 1, - "tag": "issue", - "value": "value", - }, name="example.com", + type="CNAME", + comment="Domain verification record", + content="content", proxied=True, settings={ + "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1560,6 +1747,8 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert response.is_closed is True @@ -1573,6 +1762,8 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1589,12 +1780,16 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CNAME", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1603,6 +1798,8 @@ def test_method_update_overload_4(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1612,14 +1809,11 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 8, - "certificate": "certificate", - "key_tag": 1, - "type": 9, - }, name="example.com", + type="MX", + comment="Domain verification record", + content="mx.example.com", + priority=10, proxied=True, settings={ "ipv4_only": True, @@ -1627,7 +1821,6 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1637,6 +1830,8 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert response.is_closed is True @@ -1650,6 +1845,8 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1666,12 +1863,16 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="MX", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1680,6 +1881,8 @@ def test_method_update_overload_5(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1689,18 +1892,17 @@ def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="NS", + comment="Domain verification record", + content="ns1.example.com", proxied=True, settings={ - "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1710,6 +1912,8 @@ def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert response.is_closed is True @@ -1723,6 +1927,8 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1739,12 +1945,16 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1753,6 +1963,8 @@ def test_method_update_overload_6(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1762,14 +1974,10 @@ def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 5, - "flags": 1, - "protocol": 3, - "public_key": "public_key", - }, name="example.com", + type="OPENPGPKEY", + comment="Domain verification record", + content="content", proxied=True, settings={ "ipv4_only": True, @@ -1777,7 +1985,6 @@ def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1787,6 +1994,8 @@ def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert response.is_closed is True @@ -1800,6 +2009,8 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1816,12 +2027,16 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="OPENPGPKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1830,6 +2045,8 @@ def test_method_update_overload_7(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1839,14 +2056,10 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 3, - "digest": "digest", - "digest_type": 1, - "key_tag": 1, - }, name="example.com", + type="PTR", + comment="Domain verification record", + content="example.com", proxied=True, settings={ "ipv4_only": True, @@ -1854,7 +2067,6 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1864,6 +2076,8 @@ def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert response.is_closed is True @@ -1877,6 +2091,8 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1893,12 +2109,16 @@ def test_path_params_update_overload_7(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="PTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1907,6 +2127,8 @@ def test_method_update_overload_8(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1916,13 +2138,10 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, name="example.com", + type="TXT", + comment="Domain verification record", + content='"v=spf1 include:example.com -all"', proxied=True, settings={ "ipv4_only": True, @@ -1930,7 +2149,6 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1940,6 +2158,8 @@ def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert response.is_closed is True @@ -1953,6 +2173,8 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1969,12 +2191,16 @@ def test_path_params_update_overload_8(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TXT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -1983,6 +2209,8 @@ def test_method_update_overload_9(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -1992,22 +2220,14 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", comment="Domain verification record", data={ - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, + "flags": 1, + "tag": "issue", + "value": "value", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2015,7 +2235,6 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N }, tags=["owner:dns-team"], ttl=3600, - type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2025,6 +2244,8 @@ def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert response.is_closed is True @@ -2038,6 +2259,8 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2054,12 +2277,16 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2068,6 +2295,8 @@ def test_method_update_overload_10(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2077,10 +2306,15 @@ def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="mx.example.com", name="example.com", - priority=10, + type="CERT", + comment="Domain verification record", + data={ + "algorithm": 8, + "certificate": "certificate", + "key_tag": 1, + "type": 9, + }, proxied=True, settings={ "ipv4_only": True, @@ -2088,7 +2322,6 @@ def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2098,6 +2331,8 @@ def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert response.is_closed is True @@ -2111,6 +2346,8 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2127,12 +2364,16 @@ def test_path_params_update_overload_10(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CERT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2141,6 +2382,8 @@ def test_method_update_overload_11(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2150,16 +2393,15 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", comment="Domain verification record", data={ - "flags": "flags", - "order": 100, - "preference": 10, - "regex": "regex", - "replacement": "replacement", - "service": "service", + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "public_key", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2167,7 +2409,6 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2177,6 +2418,8 @@ def test_raw_response_update_overload_11(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert response.is_closed is True @@ -2190,6 +2433,8 @@ def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2206,12 +2451,16 @@ def test_path_params_update_overload_11(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DNSKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2220,6 +2469,8 @@ def test_method_update_overload_12(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2229,9 +2480,15 @@ def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="ns1.example.com", name="example.com", + type="DS", + comment="Domain verification record", + data={ + "algorithm": 3, + "digest": "digest", + "digest_type": 1, + "key_tag": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -2239,7 +2496,6 @@ def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2249,6 +2505,8 @@ def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert response.is_closed is True @@ -2262,6 +2520,8 @@ def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2278,12 +2538,16 @@ def test_path_params_update_overload_12(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2292,6 +2556,8 @@ def test_method_update_overload_13(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2301,9 +2567,14 @@ def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="HTTPS", + comment="Domain verification record", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, proxied=True, settings={ "ipv4_only": True, @@ -2311,7 +2582,6 @@ def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2321,6 +2591,8 @@ def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert response.is_closed is True @@ -2334,6 +2606,8 @@ def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2350,12 +2624,16 @@ def test_path_params_update_overload_13(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="HTTPS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2364,6 +2642,8 @@ def test_method_update_overload_14(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2373,9 +2653,23 @@ def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="example.com", name="example.com", + type="LOC", + comment="Domain verification record", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, proxied=True, settings={ "ipv4_only": True, @@ -2383,7 +2677,6 @@ def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2393,6 +2686,8 @@ def test_raw_response_update_overload_14(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert response.is_closed is True @@ -2406,6 +2701,8 @@ def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2422,12 +2719,16 @@ def test_path_params_update_overload_14(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="LOC", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2436,6 +2737,8 @@ def test_method_update_overload_15(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2445,14 +2748,17 @@ def test_method_update_with_all_params_overload_15(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 0, - "selector": 0, - "usage": 3, + "flags": "flags", + "order": 100, + "preference": 10, + "regex": "regex", + "replacement": "replacement", + "service": "service", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2460,7 +2766,6 @@ def test_method_update_with_all_params_overload_15(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2470,6 +2775,8 @@ def test_raw_response_update_overload_15(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert response.is_closed is True @@ -2483,6 +2790,8 @@ def test_streaming_response_update_overload_15(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2499,12 +2808,16 @@ def test_path_params_update_overload_15(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NAPTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2513,6 +2826,8 @@ def test_method_update_overload_16(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2522,14 +2837,15 @@ def test_method_update_with_all_params_overload_16(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", comment="Domain verification record", data={ - "port": 8806, - "priority": 10, - "target": "example.com", - "weight": 5, + "certificate": "certificate", + "matching_type": 0, + "selector": 0, + "usage": 3, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2537,7 +2853,6 @@ def test_method_update_with_all_params_overload_16(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2547,6 +2862,8 @@ def test_raw_response_update_overload_16(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert response.is_closed is True @@ -2560,6 +2877,8 @@ def test_streaming_response_update_overload_16(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2576,12 +2895,16 @@ def test_path_params_update_overload_16(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SMIMEA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2590,6 +2913,8 @@ def test_method_update_overload_17(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2599,13 +2924,15 @@ def test_method_update_with_all_params_overload_17(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", comment="Domain verification record", data={ - "algorithm": 2, - "fingerprint": "fingerprint", - "type": 1, + "port": 8806, + "priority": 10, + "target": "example.com", + "weight": 5, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2613,7 +2940,6 @@ def test_method_update_with_all_params_overload_17(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2623,6 +2949,8 @@ def test_raw_response_update_overload_17(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert response.is_closed is True @@ -2636,6 +2964,8 @@ def test_streaming_response_update_overload_17(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2652,12 +2982,16 @@ def test_path_params_update_overload_17(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SRV", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2666,6 +3000,8 @@ def test_method_update_overload_18(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2675,13 +3011,14 @@ def test_method_update_with_all_params_overload_18(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", comment="Domain verification record", data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + "algorithm": 2, + "fingerprint": "fingerprint", + "type": 1, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2689,7 +3026,6 @@ def test_method_update_with_all_params_overload_18(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2699,6 +3035,8 @@ def test_raw_response_update_overload_18(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert response.is_closed is True @@ -2712,6 +3050,8 @@ def test_streaming_response_update_overload_18(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2728,12 +3068,16 @@ def test_path_params_update_overload_18(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SSHFP", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2742,6 +3086,8 @@ def test_method_update_overload_19(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2751,14 +3097,14 @@ def test_method_update_with_all_params_overload_19(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 1, - "selector": 0, - "usage": 0, + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -2766,7 +3112,6 @@ def test_method_update_with_all_params_overload_19(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2776,6 +3121,8 @@ def test_raw_response_update_overload_19(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert response.is_closed is True @@ -2789,6 +3136,8 @@ def test_streaming_response_update_overload_19(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2805,12 +3154,16 @@ def test_path_params_update_overload_19(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SVCB", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2819,6 +3172,8 @@ def test_method_update_overload_20(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2828,9 +3183,15 @@ def test_method_update_with_all_params_overload_20(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content='"v=spf1 include:example.com -all"', name="example.com", + type="TLSA", + comment="Domain verification record", + data={ + "certificate": "certificate", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, proxied=True, settings={ "ipv4_only": True, @@ -2838,7 +3199,6 @@ def test_method_update_with_all_params_overload_20(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2848,6 +3208,8 @@ def test_raw_response_update_overload_20(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert response.is_closed is True @@ -2861,6 +3223,8 @@ def test_streaming_response_update_overload_20(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2877,12 +3241,16 @@ def test_path_params_update_overload_20(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TLSA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -2891,6 +3259,8 @@ def test_method_update_overload_21(self, client: Cloudflare) -> None: record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2900,12 +3270,13 @@ def test_method_update_with_all_params_overload_21(self, client: Cloudflare) -> record = client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", comment="Domain verification record", data={ "target": "http://example.com/example.html", "weight": 20, }, - name="example.com", priority=10, proxied=True, settings={ @@ -2914,7 +3285,6 @@ def test_method_update_with_all_params_overload_21(self, client: Cloudflare) -> }, tags=["owner:dns-team"], ttl=3600, - type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -2924,6 +3294,8 @@ def test_raw_response_update_overload_21(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert response.is_closed is True @@ -2937,6 +3309,8 @@ def test_streaming_response_update_overload_21(self, client: Cloudflare) -> None with client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2953,12 +3327,16 @@ def test_path_params_update_overload_21(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="URI", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) @pytest.mark.skip(reason="mock server returns invalid data") @@ -3112,9 +3490,10 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: deletes=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], patches=[ { + "name": "example.com", + "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", - "name": "example.com", "proxied": True, "settings": { "ipv4_only": True, @@ -3122,15 +3501,15 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: }, "tags": ["owner:dns-team"], "ttl": 3600, - "type": "A", "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], posts=[ { + "name": "example.com", + "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", - "name": "example.com", "proxied": True, "settings": { "ipv4_only": True, @@ -3138,14 +3517,14 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: }, "tags": ["owner:dns-team"], "ttl": 3600, - "type": "A", } ], puts=[ { + "name": "example.com", + "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", - "name": "example.com", "proxied": True, "settings": { "ipv4_only": True, @@ -3153,7 +3532,6 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: }, "tags": ["owner:dns-team"], "ttl": 3600, - "type": "A", "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], @@ -3200,6 +3578,8 @@ def test_method_edit_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3209,9 +3589,10 @@ def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", comment="Domain verification record", content="198.51.100.4", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -3219,7 +3600,6 @@ def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3229,6 +3609,8 @@ def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert response.is_closed is True @@ -3242,6 +3624,8 @@ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3258,12 +3642,16 @@ def test_path_params_edit_overload_1(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="A", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3272,6 +3660,8 @@ def test_method_edit_overload_2(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3281,9 +3671,10 @@ def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", comment="Domain verification record", content="2400:cb00:2049::1", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -3291,7 +3682,6 @@ def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3301,6 +3691,8 @@ def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert response.is_closed is True @@ -3314,6 +3706,8 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3330,12 +3724,16 @@ def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="AAAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3344,6 +3742,8 @@ def test_method_edit_overload_3(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3353,21 +3753,18 @@ def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "flags": 1, - "tag": "issue", - "value": "value", - }, name="example.com", + type="CNAME", + comment="Domain verification record", + content="content", proxied=True, settings={ + "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3377,6 +3774,8 @@ def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert response.is_closed is True @@ -3390,6 +3789,8 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3406,12 +3807,16 @@ def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CNAME", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3420,6 +3825,8 @@ def test_method_edit_overload_4(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3429,14 +3836,11 @@ def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 8, - "certificate": "certificate", - "key_tag": 1, - "type": 9, - }, name="example.com", + type="MX", + comment="Domain verification record", + content="mx.example.com", + priority=10, proxied=True, settings={ "ipv4_only": True, @@ -3444,7 +3848,6 @@ def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3454,6 +3857,8 @@ def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert response.is_closed is True @@ -3467,6 +3872,8 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3483,12 +3890,16 @@ def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="MX", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3497,6 +3908,8 @@ def test_method_edit_overload_5(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3506,18 +3919,17 @@ def test_method_edit_with_all_params_overload_5(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="NS", + comment="Domain verification record", + content="ns1.example.com", proxied=True, settings={ - "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3527,6 +3939,8 @@ def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert response.is_closed is True @@ -3540,6 +3954,8 @@ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3556,12 +3972,16 @@ def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3570,6 +3990,8 @@ def test_method_edit_overload_6(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3579,14 +4001,10 @@ def test_method_edit_with_all_params_overload_6(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 5, - "flags": 1, - "protocol": 3, - "public_key": "public_key", - }, name="example.com", + type="OPENPGPKEY", + comment="Domain verification record", + content="content", proxied=True, settings={ "ipv4_only": True, @@ -3594,7 +4012,6 @@ def test_method_edit_with_all_params_overload_6(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3604,6 +4021,8 @@ def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert response.is_closed is True @@ -3617,6 +4036,8 @@ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3633,12 +4054,16 @@ def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="OPENPGPKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3647,6 +4072,8 @@ def test_method_edit_overload_7(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3656,14 +4083,10 @@ def test_method_edit_with_all_params_overload_7(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 3, - "digest": "digest", - "digest_type": 1, - "key_tag": 1, - }, name="example.com", + type="PTR", + comment="Domain verification record", + content="example.com", proxied=True, settings={ "ipv4_only": True, @@ -3671,7 +4094,6 @@ def test_method_edit_with_all_params_overload_7(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3681,6 +4103,8 @@ def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert response.is_closed is True @@ -3694,6 +4118,8 @@ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3710,12 +4136,16 @@ def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="PTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3724,6 +4154,8 @@ def test_method_edit_overload_8(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3733,13 +4165,10 @@ def test_method_edit_with_all_params_overload_8(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, name="example.com", + type="TXT", + comment="Domain verification record", + content='"v=spf1 include:example.com -all"', proxied=True, settings={ "ipv4_only": True, @@ -3747,7 +4176,6 @@ def test_method_edit_with_all_params_overload_8(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3757,6 +4185,8 @@ def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert response.is_closed is True @@ -3770,6 +4200,8 @@ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3786,12 +4218,16 @@ def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TXT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3800,6 +4236,8 @@ def test_method_edit_overload_9(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3809,22 +4247,14 @@ def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> Non record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", comment="Domain verification record", data={ - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, + "flags": 1, + "tag": "issue", + "value": "value", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -3832,7 +4262,6 @@ def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> Non }, tags=["owner:dns-team"], ttl=3600, - type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3842,6 +4271,8 @@ def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert response.is_closed is True @@ -3855,6 +4286,8 @@ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3871,12 +4304,16 @@ def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3885,6 +4322,8 @@ def test_method_edit_overload_10(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3894,10 +4333,15 @@ def test_method_edit_with_all_params_overload_10(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="mx.example.com", name="example.com", - priority=10, + type="CERT", + comment="Domain verification record", + data={ + "algorithm": 8, + "certificate": "certificate", + "key_tag": 1, + "type": 9, + }, proxied=True, settings={ "ipv4_only": True, @@ -3905,7 +4349,6 @@ def test_method_edit_with_all_params_overload_10(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3915,6 +4358,8 @@ def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert response.is_closed is True @@ -3928,6 +4373,8 @@ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3944,12 +4391,16 @@ def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CERT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -3958,6 +4409,8 @@ def test_method_edit_overload_11(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3967,16 +4420,15 @@ def test_method_edit_with_all_params_overload_11(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", comment="Domain verification record", data={ - "flags": "flags", - "order": 100, - "preference": 10, - "regex": "regex", - "replacement": "replacement", - "service": "service", + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "public_key", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -3984,7 +4436,6 @@ def test_method_edit_with_all_params_overload_11(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -3994,6 +4445,8 @@ def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert response.is_closed is True @@ -4007,6 +4460,8 @@ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4023,12 +4478,16 @@ def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DNSKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4037,6 +4496,8 @@ def test_method_edit_overload_12(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4046,9 +4507,15 @@ def test_method_edit_with_all_params_overload_12(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="ns1.example.com", name="example.com", + type="DS", + comment="Domain verification record", + data={ + "algorithm": 3, + "digest": "digest", + "digest_type": 1, + "key_tag": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -4056,7 +4523,6 @@ def test_method_edit_with_all_params_overload_12(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4066,6 +4532,8 @@ def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert response.is_closed is True @@ -4079,6 +4547,8 @@ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4095,12 +4565,16 @@ def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4109,6 +4583,8 @@ def test_method_edit_overload_13(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4118,9 +4594,14 @@ def test_method_edit_with_all_params_overload_13(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="HTTPS", + comment="Domain verification record", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, proxied=True, settings={ "ipv4_only": True, @@ -4128,7 +4609,6 @@ def test_method_edit_with_all_params_overload_13(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4138,6 +4618,8 @@ def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert response.is_closed is True @@ -4151,6 +4633,8 @@ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4167,12 +4651,16 @@ def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="HTTPS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4181,6 +4669,8 @@ def test_method_edit_overload_14(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4190,9 +4680,23 @@ def test_method_edit_with_all_params_overload_14(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="example.com", name="example.com", + type="LOC", + comment="Domain verification record", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, proxied=True, settings={ "ipv4_only": True, @@ -4200,7 +4704,6 @@ def test_method_edit_with_all_params_overload_14(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4210,6 +4713,8 @@ def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert response.is_closed is True @@ -4223,6 +4728,8 @@ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4239,12 +4746,16 @@ def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="LOC", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4253,6 +4764,8 @@ def test_method_edit_overload_15(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4262,14 +4775,17 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 0, - "selector": 0, - "usage": 3, + "flags": "flags", + "order": 100, + "preference": 10, + "regex": "regex", + "replacement": "replacement", + "service": "service", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -4277,7 +4793,6 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4287,6 +4802,8 @@ def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert response.is_closed is True @@ -4300,6 +4817,8 @@ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4316,12 +4835,16 @@ def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NAPTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4330,6 +4853,8 @@ def test_method_edit_overload_16(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4339,14 +4864,15 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", comment="Domain verification record", data={ - "port": 8806, - "priority": 10, - "target": "example.com", - "weight": 5, + "certificate": "certificate", + "matching_type": 0, + "selector": 0, + "usage": 3, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -4354,7 +4880,6 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4364,6 +4889,8 @@ def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert response.is_closed is True @@ -4377,6 +4904,8 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4393,12 +4922,16 @@ def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SMIMEA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4407,6 +4940,8 @@ def test_method_edit_overload_17(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4416,13 +4951,15 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", comment="Domain verification record", data={ - "algorithm": 2, - "fingerprint": "fingerprint", - "type": 1, + "port": 8806, + "priority": 10, + "target": "example.com", + "weight": 5, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -4430,7 +4967,6 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4440,6 +4976,8 @@ def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert response.is_closed is True @@ -4453,6 +4991,8 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4469,12 +5009,16 @@ def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SRV", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4483,6 +5027,8 @@ def test_method_edit_overload_18(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4492,13 +5038,14 @@ def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", comment="Domain verification record", data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, - name="example.com", + "algorithm": 2, + "fingerprint": "fingerprint", + "type": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -4506,7 +5053,6 @@ def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4516,6 +5062,8 @@ def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert response.is_closed is True @@ -4529,6 +5077,8 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4545,12 +5095,16 @@ def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SSHFP", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4559,6 +5113,8 @@ def test_method_edit_overload_19(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4568,14 +5124,14 @@ def test_method_edit_with_all_params_overload_19(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 1, - "selector": 0, - "usage": 0, + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -4583,7 +5139,6 @@ def test_method_edit_with_all_params_overload_19(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4593,6 +5148,8 @@ def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert response.is_closed is True @@ -4606,6 +5163,8 @@ def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4622,12 +5181,16 @@ def test_path_params_edit_overload_19(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SVCB", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4636,6 +5199,8 @@ def test_method_edit_overload_20(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4645,9 +5210,15 @@ def test_method_edit_with_all_params_overload_20(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content='"v=spf1 include:example.com -all"', name="example.com", + type="TLSA", + comment="Domain verification record", + data={ + "certificate": "certificate", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, proxied=True, settings={ "ipv4_only": True, @@ -4655,7 +5226,6 @@ def test_method_edit_with_all_params_overload_20(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4665,6 +5235,8 @@ def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert response.is_closed is True @@ -4678,6 +5250,8 @@ def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4694,12 +5268,16 @@ def test_path_params_edit_overload_20(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TLSA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -4708,6 +5286,8 @@ def test_method_edit_overload_21(self, client: Cloudflare) -> None: record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4717,12 +5297,13 @@ def test_method_edit_with_all_params_overload_21(self, client: Cloudflare) -> No record = client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", comment="Domain verification record", data={ "target": "http://example.com/example.html", "weight": 20, }, - name="example.com", priority=10, proxied=True, settings={ @@ -4731,7 +5312,6 @@ def test_method_edit_with_all_params_overload_21(self, client: Cloudflare) -> No }, tags=["owner:dns-team"], ttl=3600, - type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4741,6 +5321,8 @@ def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert response.is_closed is True @@ -4754,6 +5336,8 @@ def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4770,12 +5354,16 @@ def test_path_params_edit_overload_21(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="URI", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) @parametrize @@ -4975,6 +5563,8 @@ class TestAsyncRecords: async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -4983,9 +5573,10 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", comment="Domain verification record", content="198.51.100.4", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -4993,7 +5584,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5002,6 +5592,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert response.is_closed is True @@ -5014,6 +5606,8 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5029,6 +5623,8 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="A", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5036,6 +5632,8 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5044,9 +5642,10 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", comment="Domain verification record", content="2400:cb00:2049::1", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -5054,7 +5653,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5063,6 +5661,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert response.is_closed is True @@ -5075,6 +5675,8 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5090,6 +5692,8 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="AAAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5097,6 +5701,8 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5105,21 +5711,18 @@ async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "flags": 1, - "tag": "issue", - "value": "value", - }, name="example.com", + type="CNAME", + comment="Domain verification record", + content="content", proxied=True, settings={ + "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5128,6 +5731,8 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert response.is_closed is True @@ -5140,6 +5745,8 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5155,6 +5762,8 @@ async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="CNAME", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5162,6 +5771,8 @@ async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5170,14 +5781,11 @@ async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 8, - "certificate": "certificate", - "key_tag": 1, - "type": 9, - }, name="example.com", + type="MX", + comment="Domain verification record", + content="mx.example.com", + priority=10, proxied=True, settings={ "ipv4_only": True, @@ -5185,7 +5793,6 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5194,6 +5801,8 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert response.is_closed is True @@ -5206,6 +5815,8 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5221,6 +5832,8 @@ async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="MX", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5228,6 +5841,8 @@ async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5236,18 +5851,17 @@ async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="NS", + comment="Domain verification record", + content="ns1.example.com", proxied=True, settings={ - "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5256,6 +5870,8 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert response.is_closed is True @@ -5268,6 +5884,8 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5283,6 +5901,8 @@ async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="NS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5290,6 +5910,8 @@ async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5298,14 +5920,10 @@ async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 5, - "flags": 1, - "protocol": 3, - "public_key": "public_key", - }, name="example.com", + type="OPENPGPKEY", + comment="Domain verification record", + content="content", proxied=True, settings={ "ipv4_only": True, @@ -5313,7 +5931,6 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5322,6 +5939,8 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert response.is_closed is True @@ -5334,6 +5953,8 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5349,6 +5970,8 @@ async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="OPENPGPKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5356,6 +5979,8 @@ async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5364,14 +5989,10 @@ async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 3, - "digest": "digest", - "digest_type": 1, - "key_tag": 1, - }, name="example.com", + type="PTR", + comment="Domain verification record", + content="example.com", proxied=True, settings={ "ipv4_only": True, @@ -5379,7 +6000,6 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5388,6 +6008,8 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert response.is_closed is True @@ -5400,6 +6022,8 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5415,6 +6039,8 @@ async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="PTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5422,6 +6048,8 @@ async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5430,13 +6058,10 @@ async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, name="example.com", + type="TXT", + comment="Domain verification record", + content='"v=spf1 include:example.com -all"', proxied=True, settings={ "ipv4_only": True, @@ -5444,7 +6069,6 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5453,6 +6077,8 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert response.is_closed is True @@ -5465,6 +6091,8 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5480,6 +6108,8 @@ async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="TXT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5487,6 +6117,8 @@ async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5495,22 +6127,14 @@ async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", comment="Domain verification record", data={ - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, + "flags": 1, + "tag": "issue", + "value": "value", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -5518,7 +6142,6 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5527,6 +6150,8 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert response.is_closed is True @@ -5539,6 +6164,8 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5554,6 +6181,8 @@ async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="CAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5561,6 +6190,8 @@ async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5569,10 +6200,15 @@ async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="mx.example.com", name="example.com", - priority=10, + type="CERT", + comment="Domain verification record", + data={ + "algorithm": 8, + "certificate": "certificate", + "key_tag": 1, + "type": 9, + }, proxied=True, settings={ "ipv4_only": True, @@ -5580,7 +6216,6 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5589,6 +6224,8 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy async def test_raw_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert response.is_closed is True @@ -5601,6 +6238,8 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5616,6 +6255,8 @@ async def test_path_params_create_overload_10(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="CERT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5623,6 +6264,8 @@ async def test_path_params_create_overload_10(self, async_client: AsyncCloudflar async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5631,16 +6274,15 @@ async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", comment="Domain verification record", data={ - "flags": "flags", - "order": 100, - "preference": 10, - "regex": "regex", - "replacement": "replacement", - "service": "service", + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "public_key", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -5648,7 +6290,6 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5657,6 +6298,8 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy async def test_raw_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert response.is_closed is True @@ -5669,6 +6312,8 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5684,6 +6329,8 @@ async def test_path_params_create_overload_11(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="DNSKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5691,6 +6338,8 @@ async def test_path_params_create_overload_11(self, async_client: AsyncCloudflar async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5699,9 +6348,15 @@ async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="ns1.example.com", name="example.com", + type="DS", + comment="Domain verification record", + data={ + "algorithm": 3, + "digest": "digest", + "digest_type": 1, + "key_tag": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -5709,7 +6364,6 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5718,6 +6372,8 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy async def test_raw_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert response.is_closed is True @@ -5730,6 +6386,8 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5745,6 +6403,8 @@ async def test_path_params_create_overload_12(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="DS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5752,6 +6412,8 @@ async def test_path_params_create_overload_12(self, async_client: AsyncCloudflar async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5760,9 +6422,14 @@ async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="HTTPS", + comment="Domain verification record", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, proxied=True, settings={ "ipv4_only": True, @@ -5770,7 +6437,6 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5779,6 +6445,8 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy async def test_raw_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert response.is_closed is True @@ -5791,6 +6459,8 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5806,6 +6476,8 @@ async def test_path_params_create_overload_13(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="HTTPS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5813,6 +6485,8 @@ async def test_path_params_create_overload_13(self, async_client: AsyncCloudflar async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5821,9 +6495,23 @@ async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="example.com", name="example.com", + type="LOC", + comment="Domain verification record", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, proxied=True, settings={ "ipv4_only": True, @@ -5831,7 +6519,6 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5840,6 +6527,8 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy async def test_raw_response_create_overload_14(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert response.is_closed is True @@ -5852,6 +6541,8 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_14(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5867,6 +6558,8 @@ async def test_path_params_create_overload_14(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="LOC", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5874,6 +6567,8 @@ async def test_path_params_create_overload_14(self, async_client: AsyncCloudflar async def test_method_create_overload_15(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5882,14 +6577,17 @@ async def test_method_create_overload_15(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_15(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 0, - "selector": 0, - "usage": 3, + "flags": "flags", + "order": 100, + "preference": 10, + "regex": "regex", + "replacement": "replacement", + "service": "service", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -5897,7 +6595,6 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5906,6 +6603,8 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy async def test_raw_response_create_overload_15(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert response.is_closed is True @@ -5918,6 +6617,8 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_15(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5933,6 +6634,8 @@ async def test_path_params_create_overload_15(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="NAPTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -5940,6 +6643,8 @@ async def test_path_params_create_overload_15(self, async_client: AsyncCloudflar async def test_method_create_overload_16(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5948,14 +6653,15 @@ async def test_method_create_overload_16(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", comment="Domain verification record", data={ - "port": 8806, - "priority": 10, - "target": "example.com", - "weight": 5, + "certificate": "certificate", + "matching_type": 0, + "selector": 0, + "usage": 3, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -5963,7 +6669,6 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -5972,6 +6677,8 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy async def test_raw_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert response.is_closed is True @@ -5984,6 +6691,8 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5999,6 +6708,8 @@ async def test_path_params_create_overload_16(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SMIMEA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6006,6 +6717,8 @@ async def test_path_params_create_overload_16(self, async_client: AsyncCloudflar async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6014,13 +6727,15 @@ async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", comment="Domain verification record", data={ - "algorithm": 2, - "fingerprint": "fingerprint", - "type": 1, + "port": 8806, + "priority": 10, + "target": "example.com", + "weight": 5, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6028,7 +6743,6 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6037,6 +6751,8 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy async def test_raw_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert response.is_closed is True @@ -6049,6 +6765,8 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6064,6 +6782,8 @@ async def test_path_params_create_overload_17(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SRV", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6071,6 +6791,8 @@ async def test_path_params_create_overload_17(self, async_client: AsyncCloudflar async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6079,13 +6801,14 @@ async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", comment="Domain verification record", data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + "algorithm": 2, + "fingerprint": "fingerprint", + "type": 1, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6093,7 +6816,6 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6102,6 +6824,8 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy async def test_raw_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert response.is_closed is True @@ -6114,6 +6838,8 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6129,6 +6855,8 @@ async def test_path_params_create_overload_18(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SSHFP", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6136,6 +6864,8 @@ async def test_path_params_create_overload_18(self, async_client: AsyncCloudflar async def test_method_create_overload_19(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6144,14 +6874,14 @@ async def test_method_create_overload_19(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_19(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 1, - "selector": 0, - "usage": 0, + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6159,7 +6889,6 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6168,6 +6897,8 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy async def test_raw_response_create_overload_19(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert response.is_closed is True @@ -6180,6 +6911,8 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_19(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6195,6 +6928,8 @@ async def test_path_params_create_overload_19(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="SVCB", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6202,6 +6937,8 @@ async def test_path_params_create_overload_19(self, async_client: AsyncCloudflar async def test_method_create_overload_20(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6210,9 +6947,15 @@ async def test_method_create_overload_20(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_20(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content='"v=spf1 include:example.com -all"', name="example.com", + type="TLSA", + comment="Domain verification record", + data={ + "certificate": "certificate", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, proxied=True, settings={ "ipv4_only": True, @@ -6220,7 +6963,6 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6229,6 +6971,8 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy async def test_raw_response_create_overload_20(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert response.is_closed is True @@ -6241,6 +6985,8 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_20(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6256,6 +7002,8 @@ async def test_path_params_create_overload_20(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="TLSA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6263,6 +7011,8 @@ async def test_path_params_create_overload_20(self, async_client: AsyncCloudflar async def test_method_create_overload_21(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6271,12 +7021,13 @@ async def test_method_create_overload_21(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_21(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", comment="Domain verification record", data={ "target": "http://example.com/example.html", "weight": 20, }, - name="example.com", priority=10, proxied=True, settings={ @@ -6285,7 +7036,6 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6294,6 +7044,8 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy async def test_raw_response_create_overload_21(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert response.is_closed is True @@ -6306,6 +7058,8 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncCloudfla async def test_streaming_response_create_overload_21(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6321,6 +7075,8 @@ async def test_path_params_create_overload_21(self, async_client: AsyncCloudflar with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", + name="example.com", + type="URI", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6329,6 +7085,8 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6338,9 +7096,10 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", comment="Domain verification record", content="198.51.100.4", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6348,7 +7107,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6358,6 +7116,8 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert response.is_closed is True @@ -6371,6 +7131,8 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6387,12 +7149,16 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="A", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6401,6 +7167,8 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6410,9 +7178,10 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", comment="Domain verification record", content="2400:cb00:2049::1", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6420,7 +7189,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6430,6 +7198,8 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert response.is_closed is True @@ -6443,6 +7213,8 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6459,12 +7231,16 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="AAAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6473,6 +7249,8 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6482,21 +7260,18 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "flags": 1, - "tag": "issue", - "value": "value", - }, name="example.com", + type="CNAME", + comment="Domain verification record", + content="content", proxied=True, settings={ + "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6506,6 +7281,8 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert response.is_closed is True @@ -6519,6 +7296,8 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6535,12 +7314,16 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CNAME", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6549,6 +7332,8 @@ async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6558,14 +7343,11 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 8, - "certificate": "certificate", - "key_tag": 1, - "type": 9, - }, name="example.com", + type="MX", + comment="Domain verification record", + content="mx.example.com", + priority=10, proxied=True, settings={ "ipv4_only": True, @@ -6573,7 +7355,6 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6583,6 +7364,8 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert response.is_closed is True @@ -6596,6 +7379,8 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6612,12 +7397,16 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="MX", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6626,6 +7415,8 @@ async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6635,18 +7426,17 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="NS", + comment="Domain verification record", + content="ns1.example.com", proxied=True, settings={ - "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6656,6 +7446,8 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert response.is_closed is True @@ -6669,6 +7461,8 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6685,12 +7479,16 @@ async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6699,6 +7497,8 @@ async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6708,14 +7508,10 @@ async def test_method_update_with_all_params_overload_6(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 5, - "flags": 1, - "protocol": 3, - "public_key": "public_key", - }, name="example.com", + type="OPENPGPKEY", + comment="Domain verification record", + content="content", proxied=True, settings={ "ipv4_only": True, @@ -6723,7 +7519,6 @@ async def test_method_update_with_all_params_overload_6(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6733,6 +7528,8 @@ async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert response.is_closed is True @@ -6746,6 +7543,8 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6762,12 +7561,16 @@ async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="OPENPGPKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6776,6 +7579,8 @@ async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6785,14 +7590,10 @@ async def test_method_update_with_all_params_overload_7(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 3, - "digest": "digest", - "digest_type": 1, - "key_tag": 1, - }, name="example.com", + type="PTR", + comment="Domain verification record", + content="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6800,7 +7601,6 @@ async def test_method_update_with_all_params_overload_7(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6810,6 +7610,8 @@ async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert response.is_closed is True @@ -6823,6 +7625,8 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6839,12 +7643,16 @@ async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="PTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6853,6 +7661,8 @@ async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6862,13 +7672,10 @@ async def test_method_update_with_all_params_overload_8(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, name="example.com", + type="TXT", + comment="Domain verification record", + content='"v=spf1 include:example.com -all"', proxied=True, settings={ "ipv4_only": True, @@ -6876,7 +7683,6 @@ async def test_method_update_with_all_params_overload_8(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6886,6 +7692,8 @@ async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert response.is_closed is True @@ -6899,6 +7707,8 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -6915,12 +7725,16 @@ async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TXT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -6929,6 +7743,8 @@ async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6938,22 +7754,14 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", comment="Domain verification record", data={ - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, + "flags": 1, + "tag": "issue", + "value": "value", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -6961,7 +7769,6 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn }, tags=["owner:dns-team"], ttl=3600, - type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -6971,6 +7778,8 @@ async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflar response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert response.is_closed is True @@ -6984,6 +7793,8 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7000,12 +7811,16 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7014,6 +7829,8 @@ async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7023,10 +7840,15 @@ async def test_method_update_with_all_params_overload_10(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="mx.example.com", name="example.com", - priority=10, + type="CERT", + comment="Domain verification record", + data={ + "algorithm": 8, + "certificate": "certificate", + "key_tag": 1, + "type": 9, + }, proxied=True, settings={ "ipv4_only": True, @@ -7034,7 +7856,6 @@ async def test_method_update_with_all_params_overload_10(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7044,6 +7865,8 @@ async def test_raw_response_update_overload_10(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert response.is_closed is True @@ -7057,6 +7880,8 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7073,12 +7898,16 @@ async def test_path_params_update_overload_10(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CERT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7087,6 +7916,8 @@ async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7096,16 +7927,15 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", comment="Domain verification record", data={ - "flags": "flags", - "order": 100, - "preference": 10, - "regex": "regex", - "replacement": "replacement", - "service": "service", + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "public_key", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -7113,7 +7943,6 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7123,6 +7952,8 @@ async def test_raw_response_update_overload_11(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert response.is_closed is True @@ -7136,6 +7967,8 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7152,12 +7985,16 @@ async def test_path_params_update_overload_11(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DNSKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7166,6 +8003,8 @@ async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7175,9 +8014,15 @@ async def test_method_update_with_all_params_overload_12(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="ns1.example.com", name="example.com", + type="DS", + comment="Domain verification record", + data={ + "algorithm": 3, + "digest": "digest", + "digest_type": 1, + "key_tag": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -7185,7 +8030,6 @@ async def test_method_update_with_all_params_overload_12(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7195,6 +8039,8 @@ async def test_raw_response_update_overload_12(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert response.is_closed is True @@ -7208,6 +8054,8 @@ async def test_streaming_response_update_overload_12(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7224,12 +8072,16 @@ async def test_path_params_update_overload_12(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7238,6 +8090,8 @@ async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7247,9 +8101,14 @@ async def test_method_update_with_all_params_overload_13(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="HTTPS", + comment="Domain verification record", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, proxied=True, settings={ "ipv4_only": True, @@ -7257,7 +8116,6 @@ async def test_method_update_with_all_params_overload_13(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7267,6 +8125,8 @@ async def test_raw_response_update_overload_13(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert response.is_closed is True @@ -7280,6 +8140,8 @@ async def test_streaming_response_update_overload_13(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7296,12 +8158,16 @@ async def test_path_params_update_overload_13(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="HTTPS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7310,6 +8176,8 @@ async def test_method_update_overload_14(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7319,9 +8187,23 @@ async def test_method_update_with_all_params_overload_14(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="example.com", name="example.com", + type="LOC", + comment="Domain verification record", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, proxied=True, settings={ "ipv4_only": True, @@ -7329,7 +8211,6 @@ async def test_method_update_with_all_params_overload_14(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7339,6 +8220,8 @@ async def test_raw_response_update_overload_14(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert response.is_closed is True @@ -7352,6 +8235,8 @@ async def test_streaming_response_update_overload_14(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7368,12 +8253,16 @@ async def test_path_params_update_overload_14(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="LOC", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7382,6 +8271,8 @@ async def test_method_update_overload_15(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7391,14 +8282,17 @@ async def test_method_update_with_all_params_overload_15(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 0, - "selector": 0, - "usage": 3, + "flags": "flags", + "order": 100, + "preference": 10, + "regex": "regex", + "replacement": "replacement", + "service": "service", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -7406,7 +8300,6 @@ async def test_method_update_with_all_params_overload_15(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7416,6 +8309,8 @@ async def test_raw_response_update_overload_15(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert response.is_closed is True @@ -7429,6 +8324,8 @@ async def test_streaming_response_update_overload_15(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7445,12 +8342,16 @@ async def test_path_params_update_overload_15(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NAPTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7459,6 +8360,8 @@ async def test_method_update_overload_16(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7468,14 +8371,15 @@ async def test_method_update_with_all_params_overload_16(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", comment="Domain verification record", data={ - "port": 8806, - "priority": 10, - "target": "example.com", - "weight": 5, + "certificate": "certificate", + "matching_type": 0, + "selector": 0, + "usage": 3, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -7483,7 +8387,6 @@ async def test_method_update_with_all_params_overload_16(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7493,6 +8396,8 @@ async def test_raw_response_update_overload_16(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert response.is_closed is True @@ -7506,6 +8411,8 @@ async def test_streaming_response_update_overload_16(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7522,12 +8429,16 @@ async def test_path_params_update_overload_16(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SMIMEA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7536,6 +8447,8 @@ async def test_method_update_overload_17(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7545,13 +8458,15 @@ async def test_method_update_with_all_params_overload_17(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", comment="Domain verification record", data={ - "algorithm": 2, - "fingerprint": "fingerprint", - "type": 1, + "port": 8806, + "priority": 10, + "target": "example.com", + "weight": 5, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -7559,7 +8474,6 @@ async def test_method_update_with_all_params_overload_17(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7569,6 +8483,8 @@ async def test_raw_response_update_overload_17(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert response.is_closed is True @@ -7582,6 +8498,8 @@ async def test_streaming_response_update_overload_17(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7598,12 +8516,16 @@ async def test_path_params_update_overload_17(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SRV", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7612,6 +8534,8 @@ async def test_method_update_overload_18(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7621,13 +8545,14 @@ async def test_method_update_with_all_params_overload_18(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", comment="Domain verification record", data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + "algorithm": 2, + "fingerprint": "fingerprint", + "type": 1, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -7635,7 +8560,6 @@ async def test_method_update_with_all_params_overload_18(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7645,6 +8569,8 @@ async def test_raw_response_update_overload_18(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert response.is_closed is True @@ -7658,6 +8584,8 @@ async def test_streaming_response_update_overload_18(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7674,12 +8602,16 @@ async def test_path_params_update_overload_18(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SSHFP", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7688,6 +8620,8 @@ async def test_method_update_overload_19(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7697,14 +8631,14 @@ async def test_method_update_with_all_params_overload_19(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 1, - "selector": 0, - "usage": 0, + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -7712,7 +8646,6 @@ async def test_method_update_with_all_params_overload_19(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7722,6 +8655,8 @@ async def test_raw_response_update_overload_19(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert response.is_closed is True @@ -7735,6 +8670,8 @@ async def test_streaming_response_update_overload_19(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7751,12 +8688,16 @@ async def test_path_params_update_overload_19(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SVCB", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7765,6 +8706,8 @@ async def test_method_update_overload_20(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7774,9 +8717,15 @@ async def test_method_update_with_all_params_overload_20(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content='"v=spf1 include:example.com -all"', name="example.com", + type="TLSA", + comment="Domain verification record", + data={ + "certificate": "certificate", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, proxied=True, settings={ "ipv4_only": True, @@ -7784,7 +8733,6 @@ async def test_method_update_with_all_params_overload_20(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7794,6 +8742,8 @@ async def test_raw_response_update_overload_20(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert response.is_closed is True @@ -7807,6 +8757,8 @@ async def test_streaming_response_update_overload_20(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7823,12 +8775,16 @@ async def test_path_params_update_overload_20(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TLSA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -7837,6 +8793,8 @@ async def test_method_update_overload_21(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7846,12 +8804,13 @@ async def test_method_update_with_all_params_overload_21(self, async_client: Asy record = await async_client.dns.records.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", comment="Domain verification record", data={ "target": "http://example.com/example.html", "weight": 20, }, - name="example.com", priority=10, proxied=True, settings={ @@ -7860,7 +8819,6 @@ async def test_method_update_with_all_params_overload_21(self, async_client: Asy }, tags=["owner:dns-team"], ttl=3600, - type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -7870,6 +8828,8 @@ async def test_raw_response_update_overload_21(self, async_client: AsyncCloudfla response = await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert response.is_closed is True @@ -7883,6 +8843,8 @@ async def test_streaming_response_update_overload_21(self, async_client: AsyncCl async with async_client.dns.records.with_streaming_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -7899,12 +8861,16 @@ async def test_path_params_update_overload_21(self, async_client: AsyncCloudflar await async_client.dns.records.with_raw_response.update( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="URI", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.update( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) @pytest.mark.skip(reason="mock server returns invalid data") @@ -8058,9 +9024,10 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) deletes=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], patches=[ { + "name": "example.com", + "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", - "name": "example.com", "proxied": True, "settings": { "ipv4_only": True, @@ -8068,15 +9035,15 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) }, "tags": ["owner:dns-team"], "ttl": 3600, - "type": "A", "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], posts=[ { + "name": "example.com", + "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", - "name": "example.com", "proxied": True, "settings": { "ipv4_only": True, @@ -8084,14 +9051,14 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) }, "tags": ["owner:dns-team"], "ttl": 3600, - "type": "A", } ], puts=[ { + "name": "example.com", + "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", - "name": "example.com", "proxied": True, "settings": { "ipv4_only": True, @@ -8099,7 +9066,6 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) }, "tags": ["owner:dns-team"], "ttl": 3600, - "type": "A", "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], @@ -8146,6 +9112,8 @@ async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8155,9 +9123,10 @@ async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", comment="Domain verification record", content="198.51.100.4", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -8165,7 +9134,6 @@ async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="A", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8175,6 +9143,8 @@ async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) assert response.is_closed is True @@ -8188,6 +9158,8 @@ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8204,12 +9176,16 @@ async def test_path_params_edit_overload_1(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="A", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="A", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8218,6 +9194,8 @@ async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8227,9 +9205,10 @@ async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", comment="Domain verification record", content="2400:cb00:2049::1", - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -8237,7 +9216,6 @@ async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="AAAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8247,6 +9225,8 @@ async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) assert response.is_closed is True @@ -8260,6 +9240,8 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8276,12 +9258,16 @@ async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="AAAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="AAAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8290,6 +9276,8 @@ async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8299,21 +9287,18 @@ async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "flags": 1, - "tag": "issue", - "value": "value", - }, name="example.com", + type="CNAME", + comment="Domain verification record", + content="content", proxied=True, settings={ + "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8323,6 +9308,8 @@ async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) assert response.is_closed is True @@ -8336,6 +9323,8 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8352,12 +9341,16 @@ async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CNAME", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CNAME", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8366,6 +9359,8 @@ async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8375,14 +9370,11 @@ async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 8, - "certificate": "certificate", - "key_tag": 1, - "type": 9, - }, name="example.com", + type="MX", + comment="Domain verification record", + content="mx.example.com", + priority=10, proxied=True, settings={ "ipv4_only": True, @@ -8390,7 +9382,6 @@ async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8400,6 +9391,8 @@ async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) assert response.is_closed is True @@ -8413,6 +9406,8 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8429,12 +9424,16 @@ async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="MX", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="MX", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8443,6 +9442,8 @@ async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8452,18 +9453,17 @@ async def test_method_edit_with_all_params_overload_5(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="NS", + comment="Domain verification record", + content="ns1.example.com", proxied=True, settings={ - "flatten_cname": True, "ipv4_only": True, "ipv6_only": True, }, tags=["owner:dns-team"], ttl=3600, - type="CNAME", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8473,6 +9473,8 @@ async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) assert response.is_closed is True @@ -8486,6 +9488,8 @@ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8502,12 +9506,16 @@ async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8516,6 +9524,8 @@ async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8525,14 +9535,10 @@ async def test_method_edit_with_all_params_overload_6(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 5, - "flags": 1, - "protocol": 3, - "public_key": "public_key", - }, name="example.com", + type="OPENPGPKEY", + comment="Domain verification record", + content="content", proxied=True, settings={ "ipv4_only": True, @@ -8540,7 +9546,6 @@ async def test_method_edit_with_all_params_overload_6(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8550,6 +9555,8 @@ async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) assert response.is_closed is True @@ -8563,6 +9570,8 @@ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8579,12 +9588,16 @@ async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="OPENPGPKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="OPENPGPKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8593,6 +9606,8 @@ async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8602,14 +9617,10 @@ async def test_method_edit_with_all_params_overload_7(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "algorithm": 3, - "digest": "digest", - "digest_type": 1, - "key_tag": 1, - }, name="example.com", + type="PTR", + comment="Domain verification record", + content="example.com", proxied=True, settings={ "ipv4_only": True, @@ -8617,7 +9628,6 @@ async def test_method_edit_with_all_params_overload_7(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8627,6 +9637,8 @@ async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) assert response.is_closed is True @@ -8640,6 +9652,8 @@ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8656,12 +9670,16 @@ async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="PTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="PTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8670,6 +9688,8 @@ async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8679,13 +9699,10 @@ async def test_method_edit_with_all_params_overload_8(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - }, name="example.com", + type="TXT", + comment="Domain verification record", + content='"v=spf1 include:example.com -all"', proxied=True, settings={ "ipv4_only": True, @@ -8693,7 +9710,6 @@ async def test_method_edit_with_all_params_overload_8(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8703,6 +9719,8 @@ async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) assert response.is_closed is True @@ -8716,6 +9734,8 @@ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8732,12 +9752,16 @@ async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TXT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TXT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8746,6 +9770,8 @@ async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> No record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8755,22 +9781,14 @@ async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncC record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", comment="Domain verification record", data={ - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, + "flags": 1, + "tag": "issue", + "value": "value", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -8778,7 +9796,6 @@ async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncC }, tags=["owner:dns-team"], ttl=3600, - type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8788,6 +9805,8 @@ async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) assert response.is_closed is True @@ -8801,6 +9820,8 @@ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloud async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8817,12 +9838,16 @@ async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CAA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CAA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8831,6 +9856,8 @@ async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8840,10 +9867,15 @@ async def test_method_edit_with_all_params_overload_10(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="mx.example.com", name="example.com", - priority=10, + type="CERT", + comment="Domain verification record", + data={ + "algorithm": 8, + "certificate": "certificate", + "key_tag": 1, + "type": 9, + }, proxied=True, settings={ "ipv4_only": True, @@ -8851,7 +9883,6 @@ async def test_method_edit_with_all_params_overload_10(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="MX", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8861,6 +9892,8 @@ async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) assert response.is_closed is True @@ -8874,6 +9907,8 @@ async def test_streaming_response_edit_overload_10(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8890,12 +9925,16 @@ async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="CERT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="CERT", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8904,6 +9943,8 @@ async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8913,16 +9954,15 @@ async def test_method_edit_with_all_params_overload_11(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", comment="Domain verification record", data={ - "flags": "flags", - "order": 100, - "preference": 10, - "regex": "regex", - "replacement": "replacement", - "service": "service", + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "public_key", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -8930,7 +9970,6 @@ async def test_method_edit_with_all_params_overload_11(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8940,6 +9979,8 @@ async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) assert response.is_closed is True @@ -8953,6 +9994,8 @@ async def test_streaming_response_edit_overload_11(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -8969,12 +10012,16 @@ async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DNSKEY", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DNSKEY", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -8983,6 +10030,8 @@ async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -8992,9 +10041,15 @@ async def test_method_edit_with_all_params_overload_12(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="ns1.example.com", name="example.com", + type="DS", + comment="Domain verification record", + data={ + "algorithm": 3, + "digest": "digest", + "digest_type": 1, + "key_tag": 1, + }, proxied=True, settings={ "ipv4_only": True, @@ -9002,7 +10057,6 @@ async def test_method_edit_with_all_params_overload_12(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="NS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9012,6 +10066,8 @@ async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) assert response.is_closed is True @@ -9025,6 +10081,8 @@ async def test_streaming_response_edit_overload_12(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9041,12 +10099,16 @@ async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="DS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="DS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9055,6 +10117,8 @@ async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9064,9 +10128,14 @@ async def test_method_edit_with_all_params_overload_13(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="content", name="example.com", + type="HTTPS", + comment="Domain verification record", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, proxied=True, settings={ "ipv4_only": True, @@ -9074,7 +10143,6 @@ async def test_method_edit_with_all_params_overload_13(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="OPENPGPKEY", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9084,6 +10152,8 @@ async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) assert response.is_closed is True @@ -9097,6 +10167,8 @@ async def test_streaming_response_edit_overload_13(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9113,12 +10185,16 @@ async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="HTTPS", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="HTTPS", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9127,6 +10203,8 @@ async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9136,9 +10214,23 @@ async def test_method_edit_with_all_params_overload_14(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content="example.com", name="example.com", + type="LOC", + comment="Domain verification record", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, proxied=True, settings={ "ipv4_only": True, @@ -9146,7 +10238,6 @@ async def test_method_edit_with_all_params_overload_14(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="PTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9156,6 +10247,8 @@ async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) assert response.is_closed is True @@ -9169,6 +10262,8 @@ async def test_streaming_response_edit_overload_14(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9185,12 +10280,16 @@ async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="LOC", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="LOC", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9199,6 +10298,8 @@ async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9208,14 +10309,17 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 0, - "selector": 0, - "usage": 3, + "flags": "flags", + "order": 100, + "preference": 10, + "regex": "regex", + "replacement": "replacement", + "service": "service", }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -9223,7 +10327,6 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9233,6 +10336,8 @@ async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) assert response.is_closed is True @@ -9246,6 +10351,8 @@ async def test_streaming_response_edit_overload_15(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9262,12 +10369,16 @@ async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="NAPTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="NAPTR", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9276,6 +10387,8 @@ async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9285,14 +10398,15 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", comment="Domain verification record", data={ - "port": 8806, - "priority": 10, - "target": "example.com", - "weight": 5, + "certificate": "certificate", + "matching_type": 0, + "selector": 0, + "usage": 3, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -9300,7 +10414,6 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9310,6 +10423,8 @@ async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) assert response.is_closed is True @@ -9323,6 +10438,8 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9339,12 +10456,16 @@ async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SMIMEA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SMIMEA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9353,6 +10474,8 @@ async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9362,13 +10485,15 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", comment="Domain verification record", data={ - "algorithm": 2, - "fingerprint": "fingerprint", - "type": 1, + "port": 8806, + "priority": 10, + "target": "example.com", + "weight": 5, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -9376,7 +10501,6 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9386,6 +10510,8 @@ async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) assert response.is_closed is True @@ -9399,6 +10525,8 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9415,12 +10543,16 @@ async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SRV", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SRV", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9429,6 +10561,8 @@ async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9438,13 +10572,14 @@ async def test_method_edit_with_all_params_overload_18(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", comment="Domain verification record", data={ - "priority": 1, - "target": ".", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + "algorithm": 2, + "fingerprint": "fingerprint", + "type": 1, }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -9452,7 +10587,6 @@ async def test_method_edit_with_all_params_overload_18(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9462,6 +10596,8 @@ async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) assert response.is_closed is True @@ -9475,6 +10611,8 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9491,12 +10629,16 @@ async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SSHFP", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SSHFP", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9505,6 +10647,8 @@ async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9514,14 +10658,14 @@ async def test_method_edit_with_all_params_overload_19(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", comment="Domain verification record", data={ - "certificate": "certificate", - "matching_type": 1, - "selector": 0, - "usage": 0, + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - name="example.com", proxied=True, settings={ "ipv4_only": True, @@ -9529,7 +10673,6 @@ async def test_method_edit_with_all_params_overload_19(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9539,6 +10682,8 @@ async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) assert response.is_closed is True @@ -9552,6 +10697,8 @@ async def test_streaming_response_edit_overload_19(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9568,12 +10715,16 @@ async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="SVCB", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="SVCB", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9582,6 +10733,8 @@ async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9591,9 +10744,15 @@ async def test_method_edit_with_all_params_overload_20(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment="Domain verification record", - content='"v=spf1 include:example.com -all"', name="example.com", + type="TLSA", + comment="Domain verification record", + data={ + "certificate": "certificate", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, proxied=True, settings={ "ipv4_only": True, @@ -9601,7 +10760,6 @@ async def test_method_edit_with_all_params_overload_20(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="TXT", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9611,6 +10769,8 @@ async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) assert response.is_closed is True @@ -9624,6 +10784,8 @@ async def test_streaming_response_edit_overload_20(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9640,12 +10802,16 @@ async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="TLSA", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="TLSA", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -9654,6 +10820,8 @@ async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> N record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9663,12 +10831,13 @@ async def test_method_edit_with_all_params_overload_21(self, async_client: Async record = await async_client.dns.records.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", comment="Domain verification record", data={ "target": "http://example.com/example.html", "weight": 20, }, - name="example.com", priority=10, proxied=True, settings={ @@ -9677,7 +10846,6 @@ async def test_method_edit_with_all_params_overload_21(self, async_client: Async }, tags=["owner:dns-team"], ttl=3600, - type="URI", ) assert_matches_type(Optional[RecordResponse], record, path=["response"]) @@ -9687,6 +10855,8 @@ async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare response = await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) assert response.is_closed is True @@ -9700,6 +10870,8 @@ async def test_streaming_response_edit_overload_21(self, async_client: AsyncClou async with async_client.dns.records.with_streaming_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -9716,12 +10888,16 @@ async def test_path_params_edit_overload_21(self, async_client: AsyncCloudflare) await async_client.dns.records.with_raw_response.edit( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + name="example.com", + type="URI", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): await async_client.dns.records.with_raw_response.edit( dns_record_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", ) @parametrize diff --git a/tests/api_resources/firewall/test_lockdowns.py b/tests/api_resources/firewall/test_lockdowns.py index b417a768998..a304575e3a2 100644 --- a/tests/api_resources/firewall/test_lockdowns.py +++ b/tests/api_resources/firewall/test_lockdowns.py @@ -32,6 +32,24 @@ def test_method_create(self, client: Cloudflare) -> None: ) assert_matches_type(Lockdown, lockdown, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + lockdown = client.firewall.lockdowns.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + configurations=[ + { + "target": "ip", + "value": "198.51.100.4", + } + ], + urls=["shop.example.com/*"], + description="Prevent multiple login failures to mitigate brute force attacks", + paused=False, + priority=5, + ) + assert_matches_type(Lockdown, lockdown, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -300,6 +318,24 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(Lockdown, lockdown, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + lockdown = await async_client.firewall.lockdowns.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + configurations=[ + { + "target": "ip", + "value": "198.51.100.4", + } + ], + urls=["shop.example.com/*"], + description="Prevent multiple login failures to mitigate brute force attacks", + paused=False, + priority=5, + ) + assert_matches_type(Lockdown, lockdown, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/firewall/test_ua_rules.py b/tests/api_resources/firewall/test_ua_rules.py index f88da824057..7a968549f5d 100644 --- a/tests/api_resources/firewall/test_ua_rules.py +++ b/tests/api_resources/firewall/test_ua_rules.py @@ -40,8 +40,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ua_rule = client.firewall.ua_rules.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", configuration={ - "target": "ip", - "value": "198.51.100.4", + "target": "ua", + "value": "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)", }, mode="challenge", ) @@ -329,8 +329,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ua_rule = await async_client.firewall.ua_rules.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", configuration={ - "target": "ip", - "value": "198.51.100.4", + "target": "ua", + "value": "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)", }, mode="challenge", ) diff --git a/tests/api_resources/firewall/waf/packages/test_groups.py b/tests/api_resources/firewall/waf/packages/test_groups.py index ced79a7799f..9e79fed3de5 100644 --- a/tests/api_resources/firewall/waf/packages/test_groups.py +++ b/tests/api_resources/firewall/waf/packages/test_groups.py @@ -16,6 +16,8 @@ GroupEditResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,34 +26,39 @@ class TestGroups: @parametrize def test_method_list(self, client: Cloudflare) -> None: - group = client.firewall.waf.packages.groups.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + group = client.firewall.waf.packages.groups.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - group = client.firewall.waf.packages.groups.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - direction="desc", - match="any", - mode="on", - name="Project Honey Pot", - order="mode", - page=1, - per_page=5, - rules_count=10, - ) + with pytest.warns(DeprecationWarning): + group = client.firewall.waf.packages.groups.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + direction="desc", + match="any", + mode="on", + name="Project Honey Pot", + order="mode", + page=1, + per_page=5, + rules_count=10, + ) + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.groups.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.groups.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,58 +67,65 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.groups.with_streaming_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.groups.with_streaming_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) + group = response.parse() + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.list( + package_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.list( - package_id="", + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + group = client.firewall.waf.packages.groups.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - group = client.firewall.waf.packages.groups.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(GroupEditResponse, group, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - group = client.firewall.waf.packages.groups.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - mode="on", - ) + with pytest.warns(DeprecationWarning): + group = client.firewall.waf.packages.groups.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + mode="on", + ) + assert_matches_type(GroupEditResponse, group, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.groups.with_raw_response.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,58 +134,63 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.groups.with_streaming_response.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.groups.with_streaming_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - group = response.parse() - assert_matches_type(GroupEditResponse, group, path=["response"]) + group = response.parse() + assert_matches_type(GroupEditResponse, group, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.edit( + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + group = client.firewall.waf.packages.groups.get( group_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.edit( - group_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - group = client.firewall.waf.packages.groups.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(GroupGetResponse, group, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.groups.with_raw_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.groups.with_raw_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -180,41 +199,43 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.groups.with_streaming_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.groups.with_streaming_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - group = response.parse() - assert_matches_type(GroupGetResponse, group, path=["response"]) + group = response.parse() + assert_matches_type(GroupGetResponse, group, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): - client.firewall.waf.packages.groups.with_raw_response.get( - group_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + client.firewall.waf.packages.groups.with_raw_response.get( + group_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) class TestAsyncGroups: @@ -222,34 +243,39 @@ class TestAsyncGroups: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - group = await async_client.firewall.waf.packages.groups.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + group = await async_client.firewall.waf.packages.groups.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - group = await async_client.firewall.waf.packages.groups.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - direction="desc", - match="any", - mode="on", - name="Project Honey Pot", - order="mode", - page=1, - per_page=5, - rules_count=10, - ) + with pytest.warns(DeprecationWarning): + group = await async_client.firewall.waf.packages.groups.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + direction="desc", + match="any", + mode="on", + name="Project Honey Pot", + order="mode", + page=1, + per_page=5, + rules_count=10, + ) + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.groups.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.groups.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -258,58 +284,65 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.groups.with_streaming_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.groups.with_streaming_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) + group = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.list( + package_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.list( - package_id="", + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + group = await async_client.firewall.waf.packages.groups.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - group = await async_client.firewall.waf.packages.groups.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(GroupEditResponse, group, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - group = await async_client.firewall.waf.packages.groups.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - mode="on", - ) + with pytest.warns(DeprecationWarning): + group = await async_client.firewall.waf.packages.groups.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + mode="on", + ) + assert_matches_type(GroupEditResponse, group, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.groups.with_raw_response.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -318,58 +351,63 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.groups.with_streaming_response.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.groups.with_streaming_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - group = await response.parse() - assert_matches_type(GroupEditResponse, group, path=["response"]) + group = await response.parse() + assert_matches_type(GroupEditResponse, group, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.edit( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.edit( + group_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.edit( + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + group = await async_client.firewall.waf.packages.groups.get( group_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.edit( - group_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - group = await async_client.firewall.waf.packages.groups.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(GroupGetResponse, group, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.groups.with_raw_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.groups.with_raw_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -378,38 +416,40 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.groups.with_streaming_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.groups.with_streaming_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - group = await response.parse() - assert_matches_type(GroupGetResponse, group, path=["response"]) + group = await response.parse() + assert_matches_type(GroupGetResponse, group, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.get( - group_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): - await async_client.firewall.waf.packages.groups.with_raw_response.get( - group_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.get( + group_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + await async_client.firewall.waf.packages.groups.with_raw_response.get( + group_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) diff --git a/tests/api_resources/firewall/waf/packages/test_rules.py b/tests/api_resources/firewall/waf/packages/test_rules.py index 627ebc309fb..097f991f703 100644 --- a/tests/api_resources/firewall/waf/packages/test_rules.py +++ b/tests/api_resources/firewall/waf/packages/test_rules.py @@ -16,6 +16,8 @@ RuleListResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,35 +26,40 @@ class TestRules: @parametrize def test_method_list(self, client: Cloudflare) -> None: - rule = client.firewall.waf.packages.rules.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + rule = client.firewall.waf.packages.rules.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - rule = client.firewall.waf.packages.rules.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - description="SQL injection prevention for SELECT statements", - direction="desc", - group_id="de677e5818985db1285d0e80225f06e5", - match="any", - mode="CHL", - order="priority", - page=1, - per_page=5, - priority="priority", - ) + with pytest.warns(DeprecationWarning): + rule = client.firewall.waf.packages.rules.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + description="SQL injection prevention for SELECT statements", + direction="desc", + group_id="de677e5818985db1285d0e80225f06e5", + match="any", + mode="CHL", + order="priority", + page=1, + per_page=5, + priority="priority", + ) + assert_matches_type(SyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.rules.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.rules.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -61,58 +68,65 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.rules.with_streaming_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.rules.with_streaming_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) + rule = response.parse() + assert_matches_type(SyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.list( + package_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.list( - package_id="", + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + rule = client.firewall.waf.packages.rules.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - rule = client.firewall.waf.packages.rules.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(RuleEditResponse, rule, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - rule = client.firewall.waf.packages.rules.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - mode="on", - ) + with pytest.warns(DeprecationWarning): + rule = client.firewall.waf.packages.rules.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + mode="on", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.rules.with_raw_response.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -121,58 +135,63 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.rules.with_streaming_response.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.rules.with_streaming_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(RuleEditResponse, rule, path=["response"]) + rule = response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.edit( + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + rule = client.firewall.waf.packages.rules.get( rule_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.edit( - rule_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - rule = client.firewall.waf.packages.rules.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(RuleGetResponse, rule, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -181,41 +200,43 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.rules.with_streaming_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.rules.with_streaming_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(RuleGetResponse, rule, path=["response"]) + rule = response.parse() + assert_matches_type(RuleGetResponse, rule, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) class TestAsyncRules: @@ -223,35 +244,40 @@ class TestAsyncRules: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.firewall.waf.packages.rules.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + rule = await async_client.firewall.waf.packages.rules.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.firewall.waf.packages.rules.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - description="SQL injection prevention for SELECT statements", - direction="desc", - group_id="de677e5818985db1285d0e80225f06e5", - match="any", - mode="CHL", - order="priority", - page=1, - per_page=5, - priority="priority", - ) + with pytest.warns(DeprecationWarning): + rule = await async_client.firewall.waf.packages.rules.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + description="SQL injection prevention for SELECT statements", + direction="desc", + group_id="de677e5818985db1285d0e80225f06e5", + match="any", + mode="CHL", + order="priority", + page=1, + per_page=5, + priority="priority", + ) + assert_matches_type(AsyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.rules.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.rules.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,58 +286,65 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.rules.with_streaming_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.rules.with_streaming_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) + rule = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[RuleListResponse], rule, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.list( - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.list( + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.list( + package_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.list( - package_id="", + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + rule = await async_client.firewall.waf.packages.rules.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.firewall.waf.packages.rules.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(RuleEditResponse, rule, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.firewall.waf.packages.rules.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - mode="on", - ) + with pytest.warns(DeprecationWarning): + rule = await async_client.firewall.waf.packages.rules.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + mode="on", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.rules.with_raw_response.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -320,58 +353,63 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.rules.with_streaming_response.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.rules.with_streaming_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(RuleEditResponse, rule, path=["response"]) + rule = await response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.edit( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.edit( + rule_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.edit( + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + rule = await async_client.firewall.waf.packages.rules.get( rule_id="a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.edit( - rule_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", package_id="a25a9a7e9c00afc1fb2e0245519d725b", ) - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.firewall.waf.packages.rules.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) assert_matches_type(RuleGetResponse, rule, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -380,38 +418,40 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.rules.with_streaming_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.rules.with_streaming_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(RuleGetResponse, rule, path=["response"]) + rule = await response.parse() + assert_matches_type(RuleGetResponse, rule, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="a25a9a7e9c00afc1fb2e0245519d725b", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - await async_client.firewall.waf.packages.rules.with_raw_response.get( - rule_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - package_id="a25a9a7e9c00afc1fb2e0245519d725b", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="a25a9a7e9c00afc1fb2e0245519d725b", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.firewall.waf.packages.rules.with_raw_response.get( + rule_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + package_id="a25a9a7e9c00afc1fb2e0245519d725b", + ) diff --git a/tests/api_resources/firewall/waf/test_overrides.py b/tests/api_resources/firewall/waf/test_overrides.py index 02a421034a5..20c829e4c6f 100644 --- a/tests/api_resources/firewall/waf/test_overrides.py +++ b/tests/api_resources/firewall/waf/test_overrides.py @@ -15,6 +15,8 @@ OverrideDeleteResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,19 +26,22 @@ class TestOverrides: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_create(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + urls=["shop.example.com/*"], + ) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.firewall.waf.overrides.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.overrides.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + urls=["shop.example.com/*"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -46,70 +51,77 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.firewall.waf.overrides.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - urls=["shop.example.com/*"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.overrides.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + urls=["shop.example.com/*"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = response.parse() - assert_matches_type(Override, override, path=["response"]) + override = response.parse() + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.create( - zone_id="", - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.create( + zone_id="", + urls=["shop.example.com/*"], + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={ - "block": "challenge", - "challenge": "challenge", - "default": "challenge", - "disable": "challenge", - "simulate": "challenge", - }, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={ + "block": "challenge", + "challenge": "challenge", + "default": "challenge", + "disable": "challenge", + "simulate": "challenge", + }, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.firewall.waf.overrides.with_raw_response.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.overrides.with_raw_response.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -119,66 +131,73 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.firewall.waf.overrides.with_streaming_response.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - override = response.parse() - assert_matches_type(Override, override, path=["response"]) + with pytest.warns(DeprecationWarning): + with client.firewall.waf.overrides.with_streaming_response.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + override = response.parse() + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.update( + overrides_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.update( - overrides_id="", + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], ) - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - page=1, - per_page=5, - ) + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + page=1, + per_page=5, + ) + assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.firewall.waf.overrides.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.overrides.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,38 +206,43 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.firewall.waf.overrides.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.overrides.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) + override = response.parse() + assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.list( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.list( + zone_id="", + ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OverrideDeleteResponse], override, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.firewall.waf.overrides.with_raw_response.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.overrides.with_raw_response.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -227,46 +251,51 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.firewall.waf.overrides.with_streaming_response.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.overrides.with_streaming_response.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = response.parse() - assert_matches_type(Optional[OverrideDeleteResponse], override, path=["response"]) + override = response.parse() + assert_matches_type(Optional[OverrideDeleteResponse], override, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.delete( - overrides_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.delete( + overrides_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - override = client.firewall.waf.overrides.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + override = client.firewall.waf.overrides.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Override, override, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.firewall.waf.overrides.with_raw_response.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.overrides.with_raw_response.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -275,31 +304,33 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.firewall.waf.overrides.with_streaming_response.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.overrides.with_streaming_response.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = response.parse() - assert_matches_type(Override, override, path=["response"]) + override = response.parse() + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): - client.firewall.waf.overrides.with_raw_response.get( - overrides_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): + client.firewall.waf.overrides.with_raw_response.get( + overrides_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) class TestAsyncOverrides: @@ -308,19 +339,22 @@ class TestAsyncOverrides: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + urls=["shop.example.com/*"], + ) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.overrides.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.overrides.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + urls=["shop.example.com/*"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -330,70 +364,77 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.overrides.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - urls=["shop.example.com/*"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.overrides.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + urls=["shop.example.com/*"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = await response.parse() - assert_matches_type(Override, override, path=["response"]) + override = await response.parse() + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.create( - zone_id="", - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.create( + zone_id="", + urls=["shop.example.com/*"], + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={ - "block": "challenge", - "challenge": "challenge", - "default": "challenge", - "disable": "challenge", - "simulate": "challenge", - }, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={ + "block": "challenge", + "challenge": "challenge", + "default": "challenge", + "disable": "challenge", + "simulate": "challenge", + }, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.overrides.with_raw_response.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.overrides.with_raw_response.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,66 +444,73 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.overrides.with_streaming_response.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - override = await response.parse() - assert_matches_type(Override, override, path=["response"]) + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.overrides.with_streaming_response.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + override = await response.parse() + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.update( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.update( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.update( + overrides_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + rewrite_action={}, + rules={"100015": "disable"}, + urls=["shop.example.com/*"], + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.update( - overrides_id="", + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", - rewrite_action={}, - rules={"100015": "disable"}, - urls=["shop.example.com/*"], ) - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - page=1, - per_page=5, - ) + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + page=1, + per_page=5, + ) + assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.overrides.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.overrides.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -471,38 +519,43 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.overrides.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.overrides.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) + override = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.list( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.list( + zone_id="", + ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OverrideDeleteResponse], override, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.overrides.with_raw_response.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.overrides.with_raw_response.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -511,46 +564,51 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.overrides.with_streaming_response.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.overrides.with_streaming_response.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = await response.parse() - assert_matches_type(Optional[OverrideDeleteResponse], override, path=["response"]) + override = await response.parse() + assert_matches_type(Optional[OverrideDeleteResponse], override, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.delete( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.delete( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.delete( - overrides_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.delete( + overrides_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - override = await async_client.firewall.waf.overrides.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + override = await async_client.firewall.waf.overrides.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Override, override, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.overrides.with_raw_response.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.overrides.with_raw_response.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -559,28 +617,30 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.overrides.with_streaming_response.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.overrides.with_streaming_response.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override = await response.parse() - assert_matches_type(Override, override, path=["response"]) + override = await response.parse() + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.get( - overrides_id="de677e5818985db1285d0e80225f06e5", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): - await async_client.firewall.waf.overrides.with_raw_response.get( - overrides_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.get( + overrides_id="de677e5818985db1285d0e80225f06e5", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `overrides_id` but received ''"): + await async_client.firewall.waf.overrides.with_raw_response.get( + overrides_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/firewall/waf/test_packages.py b/tests/api_resources/firewall/waf/test_packages.py index 5bd1f1f6a9a..63ba5f49982 100644 --- a/tests/api_resources/firewall/waf/test_packages.py +++ b/tests/api_resources/firewall/waf/test_packages.py @@ -12,6 +12,8 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall.waf import PackageGetResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,31 +23,36 @@ class TestPackages: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_list(self, client: Cloudflare) -> None: - package = client.firewall.waf.packages.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + package = client.firewall.waf.packages.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[object], package, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - package = client.firewall.waf.packages.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - direction="desc", - match="any", - name="USER", - order="name", - page=1, - per_page=5, - ) + with pytest.warns(DeprecationWarning): + package = client.firewall.waf.packages.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + direction="desc", + match="any", + name="USER", + order="name", + page=1, + per_page=5, + ) + assert_matches_type(SyncV4PagePaginationArray[object], package, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -55,39 +62,44 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - package = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], package, path=["response"]) + package = response.parse() + assert_matches_type(SyncV4PagePaginationArray[object], package, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.with_raw_response.list( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.with_raw_response.list( + zone_id="", + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - package = client.firewall.waf.packages.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + package = client.firewall.waf.packages.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(PackageGetResponse, package, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.firewall.waf.packages.with_raw_response.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.firewall.waf.packages.with_raw_response.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -96,31 +108,33 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.firewall.waf.packages.with_streaming_response.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.firewall.waf.packages.with_streaming_response.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - package = response.parse() - assert_matches_type(PackageGetResponse, package, path=["response"]) + package = response.parse() + assert_matches_type(PackageGetResponse, package, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.firewall.waf.packages.with_raw_response.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.firewall.waf.packages.with_raw_response.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - client.firewall.waf.packages.with_raw_response.get( - package_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + client.firewall.waf.packages.with_raw_response.get( + package_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) class TestAsyncPackages: @@ -129,31 +143,36 @@ class TestAsyncPackages: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - package = await async_client.firewall.waf.packages.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + package = await async_client.firewall.waf.packages.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[object], package, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - package = await async_client.firewall.waf.packages.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - direction="desc", - match="any", - name="USER", - order="name", - page=1, - per_page=5, - ) + with pytest.warns(DeprecationWarning): + package = await async_client.firewall.waf.packages.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + direction="desc", + match="any", + name="USER", + order="name", + page=1, + per_page=5, + ) + assert_matches_type(AsyncV4PagePaginationArray[object], package, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -163,39 +182,44 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - package = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], package, path=["response"]) + package = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[object], package, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.with_raw_response.list( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.with_raw_response.list( + zone_id="", + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - package = await async_client.firewall.waf.packages.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + package = await async_client.firewall.waf.packages.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(PackageGetResponse, package, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.firewall.waf.packages.with_raw_response.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.firewall.waf.packages.with_raw_response.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -204,28 +228,30 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.firewall.waf.packages.with_streaming_response.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.firewall.waf.packages.with_streaming_response.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - package = await response.parse() - assert_matches_type(PackageGetResponse, package, path=["response"]) + package = await response.parse() + assert_matches_type(PackageGetResponse, package, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.firewall.waf.packages.with_raw_response.get( - package_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): - await async_client.firewall.waf.packages.with_raw_response.get( - package_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.firewall.waf.packages.with_raw_response.get( + package_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `package_id` but received ''"): + await async_client.firewall.waf.packages.with_raw_response.get( + package_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/iam/test_permission_groups.py b/tests/api_resources/iam/test_permission_groups.py index df808f2577c..8d4a01aba8b 100644 --- a/tests/api_resources/iam/test_permission_groups.py +++ b/tests/api_resources/iam/test_permission_groups.py @@ -21,14 +21,14 @@ class TestPermissionGroups: @parametrize def test_method_list(self, client: Cloudflare) -> None: permission_group = client.iam.permission_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: permission_group = client.iam.permission_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", label="labelOfThePermissionGroup", name="NameOfThePermissionGroup", @@ -40,7 +40,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.iam.permission_groups.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -51,7 +51,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.iam.permission_groups.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,16 +73,16 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: permission_group = client.iam.permission_groups.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PermissionGroupGetResponse, permission_group, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.iam.permission_groups.with_raw_response.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -93,8 +93,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.iam.permission_groups.with_streaming_response.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -108,14 +108,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.iam.permission_groups.with_raw_response.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `permission_group_id` but received ''"): client.iam.permission_groups.with_raw_response.get( permission_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -125,7 +125,7 @@ class TestAsyncPermissionGroups: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.iam.permission_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type( AsyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"] @@ -134,7 +134,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.iam.permission_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", label="labelOfThePermissionGroup", name="NameOfThePermissionGroup", @@ -148,7 +148,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.permission_groups.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -161,7 +161,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.permission_groups.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -183,16 +183,16 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.iam.permission_groups.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PermissionGroupGetResponse, permission_group, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.permission_groups.with_raw_response.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -203,8 +203,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.permission_groups.with_streaming_response.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -218,12 +218,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.iam.permission_groups.with_raw_response.get( - permission_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + permission_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `permission_group_id` but received ''"): await async_client.iam.permission_groups.with_raw_response.get( permission_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/iam/test_resource_groups.py b/tests/api_resources/iam/test_resource_groups.py index 501b841030f..b334eec946e 100644 --- a/tests/api_resources/iam/test_resource_groups.py +++ b/tests/api_resources/iam/test_resource_groups.py @@ -27,7 +27,7 @@ class TestResourceGroups: @parametrize def test_method_create(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="NewResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -39,7 +39,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.iam.resource_groups.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="NewResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.iam.resource_groups.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="NewResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -85,16 +85,16 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_update(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ResourceGroupUpdateResponse, resource_group, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="UpdatedResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -106,8 +106,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.iam.resource_groups.with_raw_response.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -118,8 +118,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.iam.resource_groups.with_streaming_response.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -133,28 +133,28 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.iam.resource_groups.with_raw_response.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_group_id` but received ''"): client.iam.resource_groups.with_raw_response.update( resource_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_list(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", - id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="NameOfTheResourceGroup", page=1, per_page=5, @@ -164,7 +164,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.iam.resource_groups.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -175,7 +175,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.iam.resource_groups.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -195,16 +195,16 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ResourceGroupDeleteResponse], resource_group, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.iam.resource_groups.with_raw_response.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -215,8 +215,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.iam.resource_groups.with_streaming_response.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -230,29 +230,29 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.iam.resource_groups.with_raw_response.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_group_id` but received ''"): client.iam.resource_groups.with_raw_response.delete( resource_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ResourceGroupGetResponse, resource_group, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.iam.resource_groups.with_raw_response.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -263,8 +263,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.iam.resource_groups.with_streaming_response.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -278,14 +278,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.iam.resource_groups.with_raw_response.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_group_id` but received ''"): client.iam.resource_groups.with_raw_response.get( resource_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -295,7 +295,7 @@ class TestAsyncResourceGroups: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="NewResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -307,7 +307,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.resource_groups.with_raw_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="NewResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -323,7 +323,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.resource_groups.with_streaming_response.create( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="NewResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -353,16 +353,16 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ResourceGroupUpdateResponse, resource_group, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", name="UpdatedResourceGroup", scope={ "key": "com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4", @@ -374,8 +374,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.resource_groups.with_raw_response.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -386,8 +386,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.resource_groups.with_streaming_response.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -401,28 +401,28 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.iam.resource_groups.with_raw_response.update( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_group_id` but received ''"): await async_client.iam.resource_groups.with_raw_response.update( resource_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", - id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="NameOfTheResourceGroup", page=1, per_page=5, @@ -432,7 +432,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.resource_groups.with_raw_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -443,7 +443,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.resource_groups.with_streaming_response.list( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -465,16 +465,16 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ResourceGroupDeleteResponse], resource_group, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.resource_groups.with_raw_response.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -485,8 +485,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.resource_groups.with_streaming_response.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -500,29 +500,29 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.iam.resource_groups.with_raw_response.delete( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_group_id` but received ''"): await async_client.iam.resource_groups.with_raw_response.delete( resource_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ResourceGroupGetResponse, resource_group, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.resource_groups.with_raw_response.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -533,8 +533,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.resource_groups.with_streaming_response.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -548,12 +548,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.iam.resource_groups.with_raw_response.get( - resource_group_id="6d7f2f5f5b1d4a0e9081fdc98d432fd1", + resource_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `resource_group_id` but received ''"): await async_client.iam.resource_groups.with_raw_response.get( resource_group_id="", - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/iam/test_user_groups.py b/tests/api_resources/iam/test_user_groups.py new file mode 100644 index 00000000000..869b1b5a1ae --- /dev/null +++ b/tests/api_resources/iam/test_user_groups.py @@ -0,0 +1,623 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.iam import ( + UserGroupGetResponse, + UserGroupListResponse, + UserGroupCreateResponse, + UserGroupDeleteResponse, + UserGroupUpdateResponse, +) +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUserGroups: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.iam.user_groups.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = response.parse() + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.iam.user_groups.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = response.parse() + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.with_raw_response.create( + account_id="", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "id": "f267e341f3dd4697bd3b9f71dd96247f", + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.iam.user_groups.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = response.parse() + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.iam.user_groups.with_streaming_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = response.parse() + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.with_raw_response.update( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + direction="desc", + fuzzy_name="Foo", + name="NameOfTheUserGroup", + page=1, + per_page=5, + ) + assert_matches_type(SyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.iam.user_groups.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = response.parse() + assert_matches_type(SyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.iam.user_groups.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = response.parse() + assert_matches_type(SyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGroupDeleteResponse], user_group, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.iam.user_groups.with_raw_response.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = response.parse() + assert_matches_type(Optional[UserGroupDeleteResponse], user_group, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.iam.user_groups.with_streaming_response.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = response.parse() + assert_matches_type(Optional[UserGroupDeleteResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.with_raw_response.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.with_raw_response.delete( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGroupGetResponse], user_group, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.iam.user_groups.with_raw_response.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = response.parse() + assert_matches_type(Optional[UserGroupGetResponse], user_group, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.iam.user_groups.with_streaming_response.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = response.parse() + assert_matches_type(Optional[UserGroupGetResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.with_raw_response.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.with_raw_response.get( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncUserGroups: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = await response.parse() + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = await response.parse() + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.create( + account_id="", + name="My New User Group", + policies=[ + { + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + policies=[ + { + "id": "f267e341f3dd4697bd3b9f71dd96247f", + "access": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], + } + ], + ) + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = await response.parse() + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.with_streaming_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = await response.parse() + assert_matches_type(Optional[UserGroupUpdateResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.update( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", + direction="desc", + fuzzy_name="Foo", + name="NameOfTheUserGroup", + page=1, + per_page=5, + ) + assert_matches_type(AsyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGroupDeleteResponse], user_group, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.with_raw_response.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = await response.parse() + assert_matches_type(Optional[UserGroupDeleteResponse], user_group, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.with_streaming_response.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = await response.parse() + assert_matches_type(Optional[UserGroupDeleteResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.delete( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.delete( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGroupGetResponse], user_group, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.with_raw_response.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_group = await response.parse() + assert_matches_type(Optional[UserGroupGetResponse], user_group, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.with_streaming_response.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_group = await response.parse() + assert_matches_type(Optional[UserGroupGetResponse], user_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.get( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.with_raw_response.get( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/iam/user_groups/__init__.py b/tests/api_resources/iam/user_groups/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/iam/user_groups/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/iam/user_groups/test_members.py b/tests/api_resources/iam/user_groups/test_members.py new file mode 100644 index 00000000000..b5b8cf68485 --- /dev/null +++ b/tests/api_resources/iam/user_groups/test_members.py @@ -0,0 +1,476 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.types.iam.user_groups import ( + MemberListResponse, + MemberCreateResponse, + MemberDeleteResponse, + MemberUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMembers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + member = client.iam.user_groups.members.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.iam.user_groups.members.with_raw_response.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = response.parse() + assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.iam.user_groups.members.with_streaming_response.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = response.parse() + assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.members.with_raw_response.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.members.with_raw_response.create( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + member = client.iam.user_groups.members.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + assert_matches_type(SyncSinglePage[MemberUpdateResponse], member, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.iam.user_groups.members.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = response.parse() + assert_matches_type(SyncSinglePage[MemberUpdateResponse], member, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.iam.user_groups.members.with_streaming_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = response.parse() + assert_matches_type(SyncSinglePage[MemberUpdateResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.members.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.members.with_raw_response.update( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + member = client.iam.user_groups.members.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + member = client.iam.user_groups.members.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + page=1, + per_page=1, + ) + assert_matches_type(SyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.iam.user_groups.members.with_raw_response.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = response.parse() + assert_matches_type(SyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.iam.user_groups.members.with_streaming_response.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = response.parse() + assert_matches_type(SyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.members.with_raw_response.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.members.with_raw_response.list( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + member = client.iam.user_groups.members.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.iam.user_groups.members.with_raw_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = response.parse() + assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.iam.user_groups.members.with_streaming_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = response.parse() + assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.iam.user_groups.members.with_raw_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.members.with_raw_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): + client.iam.user_groups.members.with_raw_response.delete( + member_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncMembers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + member = await async_client.iam.user_groups.members.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.members.with_raw_response.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = await response.parse() + assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.members.with_streaming_response.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = await response.parse() + assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.create( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.create( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + member = await async_client.iam.user_groups.members.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + assert_matches_type(AsyncSinglePage[MemberUpdateResponse], member, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.members.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = await response.parse() + assert_matches_type(AsyncSinglePage[MemberUpdateResponse], member, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.members.with_streaming_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = await response.parse() + assert_matches_type(AsyncSinglePage[MemberUpdateResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.update( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.update( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + member = await async_client.iam.user_groups.members.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + member = await async_client.iam.user_groups.members.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + page=1, + per_page=1, + ) + assert_matches_type(AsyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.members.with_raw_response.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.members.with_streaming_response.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[MemberListResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.list( + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.list( + user_group_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + member = await async_client.iam.user_groups.members.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.members.with_raw_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = await response.parse() + assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.members.with_streaming_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = await response.parse() + assert_matches_type(Optional[MemberDeleteResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.delete( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.delete( + member_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/images/test_v1.py b/tests/api_resources/images/test_v1.py index 1114273c5e3..ba5252f9de0 100644 --- a/tests/api_resources/images/test_v1.py +++ b/tests/api_resources/images/test_v1.py @@ -16,6 +16,8 @@ V1DeleteResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -78,25 +80,30 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: - v1 = client.images.v1.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + v1 = client.images.v1.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePagination[V1ListResponse], v1, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - v1 = client.images.v1.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - page=1, - per_page=10, - ) + with pytest.warns(DeprecationWarning): + v1 = client.images.v1.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + page=1, + per_page=10, + ) + assert_matches_type(SyncV4PagePagination[V1ListResponse], v1, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.images.v1.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.images.v1.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -105,23 +112,25 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.images.v1.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.images.v1.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - v1 = response.parse() - assert_matches_type(SyncV4PagePagination[V1ListResponse], v1, path=["response"]) + v1 = response.parse() + assert_matches_type(SyncV4PagePagination[V1ListResponse], v1, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.images.v1.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.images.v1.with_raw_response.list( + account_id="", + ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: @@ -337,25 +346,30 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - v1 = await async_client.images.v1.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + v1 = await async_client.images.v1.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePagination[V1ListResponse], v1, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - v1 = await async_client.images.v1.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - page=1, - per_page=10, - ) + with pytest.warns(DeprecationWarning): + v1 = await async_client.images.v1.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + page=1, + per_page=10, + ) + assert_matches_type(AsyncV4PagePagination[V1ListResponse], v1, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.images.v1.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.images.v1.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -364,23 +378,25 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.images.v1.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.images.v1.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - v1 = await response.parse() - assert_matches_type(AsyncV4PagePagination[V1ListResponse], v1, path=["response"]) + v1 = await response.parse() + assert_matches_type(AsyncV4PagePagination[V1ListResponse], v1, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.images.v1.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.images.v1.with_raw_response.list( + account_id="", + ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/intel/attack_surface_report/test_issues.py b/tests/api_resources/intel/attack_surface_report/test_issues.py index 97e100c0d38..23f555d5eab 100644 --- a/tests/api_resources/intel/attack_surface_report/test_issues.py +++ b/tests/api_resources/intel/attack_surface_report/test_issues.py @@ -18,6 +18,8 @@ IssueSeverityResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,36 +28,41 @@ class TestIssues: @parametrize def test_method_list(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - page=1, - per_page=25, - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + page=1, + per_page=25, + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(SyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.intel.attack_surface_report.issues.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.intel.attack_surface_report.issues.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,54 +71,61 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.intel.attack_surface_report.issues.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.intel.attack_surface_report.issues.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = response.parse() - assert_matches_type(SyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) + issue = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.attack_surface_report.issues.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.intel.attack_surface_report.issues.with_raw_response.list( + account_id="", + ) @parametrize def test_method_class(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) @parametrize def test_method_class_with_all_params(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) @parametrize def test_raw_response_class(self, client: Cloudflare) -> None: - response = client.intel.attack_surface_report.issues.with_raw_response.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.intel.attack_surface_report.issues.with_raw_response.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,47 +134,54 @@ def test_raw_response_class(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_class(self, client: Cloudflare) -> None: - with client.intel.attack_surface_report.issues.with_streaming_response.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.intel.attack_surface_report.issues.with_streaming_response.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = response.parse() - assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) + issue = response.parse() + assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_class(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.attack_surface_report.issues.with_raw_response.class_( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.intel.attack_surface_report.issues.with_raw_response.class_( + account_id="", + ) @parametrize def test_method_dismiss(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(IssueDismissResponse, issue, path=["response"]) @parametrize def test_method_dismiss_with_all_params(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismiss=True, - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismiss=True, + ) + assert_matches_type(IssueDismissResponse, issue, path=["response"]) @parametrize def test_raw_response_dismiss(self, client: Cloudflare) -> None: - response = client.intel.attack_surface_report.issues.with_raw_response.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.intel.attack_surface_report.issues.with_raw_response.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -169,62 +190,69 @@ def test_raw_response_dismiss(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_dismiss(self, client: Cloudflare) -> None: - with client.intel.attack_surface_report.issues.with_streaming_response.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.intel.attack_surface_report.issues.with_streaming_response.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = response.parse() - assert_matches_type(IssueDismissResponse, issue, path=["response"]) + issue = response.parse() + assert_matches_type(IssueDismissResponse, issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_dismiss(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.attack_surface_report.issues.with_raw_response.dismiss( - issue_id="issue_id", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.intel.attack_surface_report.issues.with_raw_response.dismiss( + issue_id="issue_id", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): - client.intel.attack_surface_report.issues.with_raw_response.dismiss( - issue_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): + client.intel.attack_surface_report.issues.with_raw_response.dismiss( + issue_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) @parametrize def test_method_severity(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) @parametrize def test_method_severity_with_all_params(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) @parametrize def test_raw_response_severity(self, client: Cloudflare) -> None: - response = client.intel.attack_surface_report.issues.with_raw_response.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.intel.attack_surface_report.issues.with_raw_response.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -233,54 +261,61 @@ def test_raw_response_severity(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_severity(self, client: Cloudflare) -> None: - with client.intel.attack_surface_report.issues.with_streaming_response.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.intel.attack_surface_report.issues.with_streaming_response.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = response.parse() - assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) + issue = response.parse() + assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_severity(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.attack_surface_report.issues.with_raw_response.severity( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.intel.attack_surface_report.issues.with_raw_response.severity( + account_id="", + ) @parametrize def test_method_type(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) @parametrize def test_method_type_with_all_params(self, client: Cloudflare) -> None: - issue = client.intel.attack_surface_report.issues.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = client.intel.attack_surface_report.issues.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) @parametrize def test_raw_response_type(self, client: Cloudflare) -> None: - response = client.intel.attack_surface_report.issues.with_raw_response.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.intel.attack_surface_report.issues.with_raw_response.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,23 +324,25 @@ def test_raw_response_type(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_type(self, client: Cloudflare) -> None: - with client.intel.attack_surface_report.issues.with_streaming_response.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.intel.attack_surface_report.issues.with_streaming_response.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = response.parse() - assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) + issue = response.parse() + assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_type(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.attack_surface_report.issues.with_raw_response.type( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.intel.attack_surface_report.issues.with_raw_response.type( + account_id="", + ) class TestAsyncIssues: @@ -313,36 +350,41 @@ class TestAsyncIssues: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - page=1, - per_page=25, - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + page=1, + per_page=25, + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(AsyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.attack_surface_report.issues.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.intel.attack_surface_report.issues.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -351,54 +393,61 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.attack_surface_report.issues.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.intel.attack_surface_report.issues.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = await response.parse() - assert_matches_type(AsyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) + issue = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[IssueListResponse]], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.attack_surface_report.issues.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.intel.attack_surface_report.issues.with_raw_response.list( + account_id="", + ) @parametrize async def test_method_class(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) @parametrize async def test_method_class_with_all_params(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) @parametrize async def test_raw_response_class(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.attack_surface_report.issues.with_raw_response.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.intel.attack_surface_report.issues.with_raw_response.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -407,47 +456,54 @@ async def test_raw_response_class(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_class(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.attack_surface_report.issues.with_streaming_response.class_( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.intel.attack_surface_report.issues.with_streaming_response.class_( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = await response.parse() - assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) + issue = await response.parse() + assert_matches_type(Optional[IssueClassResponse], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_class(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.attack_surface_report.issues.with_raw_response.class_( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.intel.attack_surface_report.issues.with_raw_response.class_( + account_id="", + ) @parametrize async def test_method_dismiss(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(IssueDismissResponse, issue, path=["response"]) @parametrize async def test_method_dismiss_with_all_params(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismiss=True, - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismiss=True, + ) + assert_matches_type(IssueDismissResponse, issue, path=["response"]) @parametrize async def test_raw_response_dismiss(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.attack_surface_report.issues.with_raw_response.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.intel.attack_surface_report.issues.with_raw_response.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -456,62 +512,69 @@ async def test_raw_response_dismiss(self, async_client: AsyncCloudflare) -> None @parametrize async def test_streaming_response_dismiss(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.attack_surface_report.issues.with_streaming_response.dismiss( - issue_id="issue_id", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.intel.attack_surface_report.issues.with_streaming_response.dismiss( + issue_id="issue_id", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = await response.parse() - assert_matches_type(IssueDismissResponse, issue, path=["response"]) + issue = await response.parse() + assert_matches_type(IssueDismissResponse, issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_dismiss(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.attack_surface_report.issues.with_raw_response.dismiss( - issue_id="issue_id", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.intel.attack_surface_report.issues.with_raw_response.dismiss( + issue_id="issue_id", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): - await async_client.intel.attack_surface_report.issues.with_raw_response.dismiss( - issue_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): + await async_client.intel.attack_surface_report.issues.with_raw_response.dismiss( + issue_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) @parametrize async def test_method_severity(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) @parametrize async def test_method_severity_with_all_params(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) @parametrize async def test_raw_response_severity(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.attack_surface_report.issues.with_raw_response.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.intel.attack_surface_report.issues.with_raw_response.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -520,54 +583,61 @@ async def test_raw_response_severity(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_streaming_response_severity(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.attack_surface_report.issues.with_streaming_response.severity( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.intel.attack_surface_report.issues.with_streaming_response.severity( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = await response.parse() - assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) + issue = await response.parse() + assert_matches_type(Optional[IssueSeverityResponse], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_severity(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.attack_surface_report.issues.with_raw_response.severity( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.intel.attack_surface_report.issues.with_raw_response.severity( + account_id="", + ) @parametrize async def test_method_type(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) @parametrize async def test_method_type_with_all_params(self, async_client: AsyncCloudflare) -> None: - issue = await async_client.intel.attack_surface_report.issues.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) + with pytest.warns(DeprecationWarning): + issue = await async_client.intel.attack_surface_report.issues.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) @parametrize async def test_raw_response_type(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.attack_surface_report.issues.with_raw_response.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.intel.attack_surface_report.issues.with_raw_response.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -576,20 +646,22 @@ async def test_raw_response_type(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_type(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.attack_surface_report.issues.with_streaming_response.type( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.intel.attack_surface_report.issues.with_streaming_response.type( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - issue = await response.parse() - assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) + issue = await response.parse() + assert_matches_type(Optional[IssueTypeResponse], issue, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_type(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.attack_surface_report.issues.with_raw_response.type( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.intel.attack_surface_report.issues.with_raw_response.type( + account_id="", + ) diff --git a/tests/api_resources/kv/namespaces/test_keys.py b/tests/api_resources/kv/namespaces/test_keys.py index db2389eed9b..351613f0bfb 100644 --- a/tests/api_resources/kv/namespaces/test_keys.py +++ b/tests/api_resources/kv/namespaces/test_keys.py @@ -17,6 +17,8 @@ KeyBulkUpdateResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -84,20 +86,23 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_delete(self, client: Cloudflare) -> None: - key = client.kv.namespaces.keys.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + key = client.kv.namespaces.keys.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + assert_matches_type(Optional[KeyBulkDeleteResponse], key, path=["response"]) @parametrize def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: - response = client.kv.namespaces.keys.with_raw_response.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + response = client.kv.namespaces.keys.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,62 +111,69 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: - with client.kv.namespaces.keys.with_streaming_response.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.kv.namespaces.keys.with_streaming_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - key = response.parse() - assert_matches_type(Optional[KeyBulkDeleteResponse], key, path=["response"]) + key = response.parse() + assert_matches_type(Optional[KeyBulkDeleteResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_bulk_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.kv.namespaces.keys.with_raw_response.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="", - body=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.kv.namespaces.keys.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + client.kv.namespaces.keys.with_raw_response.bulk_delete( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): - client.kv.namespaces.keys.with_raw_response.bulk_delete( - namespace_id="", + @parametrize + def test_method_bulk_get(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + key = client.kv.namespaces.keys.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], + keys=["My-Key"], ) - @parametrize - def test_method_bulk_get(self, client: Cloudflare) -> None: - key = client.kv.namespaces.keys.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - ) assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) @parametrize def test_method_bulk_get_with_all_params(self, client: Cloudflare) -> None: - key = client.kv.namespaces.keys.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - type="text", - with_metadata=True, - ) + with pytest.warns(DeprecationWarning): + key = client.kv.namespaces.keys.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + type="text", + with_metadata=True, + ) + assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) @parametrize def test_raw_response_bulk_get(self, client: Cloudflare) -> None: - response = client.kv.namespaces.keys.with_raw_response.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + response = client.kv.namespaces.keys.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -170,51 +182,56 @@ def test_raw_response_bulk_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_get(self, client: Cloudflare) -> None: - with client.kv.namespaces.keys.with_streaming_response.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.kv.namespaces.keys.with_streaming_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - key = response.parse() - assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) + key = response.parse() + assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_bulk_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.kv.namespaces.keys.with_raw_response.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="", - keys=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.kv.namespaces.keys.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + keys=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + client.kv.namespaces.keys.with_raw_response.bulk_get( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): - client.kv.namespaces.keys.with_raw_response.bulk_get( - namespace_id="", + @parametrize + def test_method_bulk_update(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + key = client.kv.namespaces.keys.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], + body=[{}], ) - @parametrize - def test_method_bulk_update(self, client: Cloudflare) -> None: - key = client.kv.namespaces.keys.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) assert_matches_type(Optional[KeyBulkUpdateResponse], key, path=["response"]) @parametrize def test_raw_response_bulk_update(self, client: Cloudflare) -> None: - response = client.kv.namespaces.keys.with_raw_response.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) + with pytest.warns(DeprecationWarning): + response = client.kv.namespaces.keys.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -223,34 +240,36 @@ def test_raw_response_bulk_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: - with client.kv.namespaces.keys.with_streaming_response.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.kv.namespaces.keys.with_streaming_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - key = response.parse() - assert_matches_type(Optional[KeyBulkUpdateResponse], key, path=["response"]) + key = response.parse() + assert_matches_type(Optional[KeyBulkUpdateResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_bulk_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.kv.namespaces.keys.with_raw_response.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="", - body=[{}], - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): - client.kv.namespaces.keys.with_raw_response.bulk_update( - namespace_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.kv.namespaces.keys.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=[{}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + client.kv.namespaces.keys.with_raw_response.bulk_update( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) class TestAsyncKeys: @@ -317,20 +336,23 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: - key = await async_client.kv.namespaces.keys.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + key = await async_client.kv.namespaces.keys.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + assert_matches_type(Optional[KeyBulkDeleteResponse], key, path=["response"]) @parametrize async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.kv.namespaces.keys.with_raw_response.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.kv.namespaces.keys.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -339,62 +361,69 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.kv.namespaces.keys.with_streaming_response.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.kv.namespaces.keys.with_streaming_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - key = await response.parse() - assert_matches_type(Optional[KeyBulkDeleteResponse], key, path=["response"]) + key = await response.parse() + assert_matches_type(Optional[KeyBulkDeleteResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.kv.namespaces.keys.with_raw_response.bulk_delete( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="", - body=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.kv.namespaces.keys.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + await async_client.kv.namespaces.keys.with_raw_response.bulk_delete( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): - await async_client.kv.namespaces.keys.with_raw_response.bulk_delete( - namespace_id="", + @parametrize + async def test_method_bulk_get(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + key = await async_client.kv.namespaces.keys.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=["My-Key"], + keys=["My-Key"], ) - @parametrize - async def test_method_bulk_get(self, async_client: AsyncCloudflare) -> None: - key = await async_client.kv.namespaces.keys.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - ) assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) @parametrize async def test_method_bulk_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - key = await async_client.kv.namespaces.keys.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - type="text", - with_metadata=True, - ) + with pytest.warns(DeprecationWarning): + key = await async_client.kv.namespaces.keys.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + type="text", + with_metadata=True, + ) + assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) @parametrize async def test_raw_response_bulk_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.kv.namespaces.keys.with_raw_response.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.kv.namespaces.keys.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,51 +432,56 @@ async def test_raw_response_bulk_get(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_streaming_response_bulk_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.kv.namespaces.keys.with_streaming_response.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.kv.namespaces.keys.with_streaming_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - key = await response.parse() - assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) + key = await response.parse() + assert_matches_type(Optional[KeyBulkGetResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_bulk_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.kv.namespaces.keys.with_raw_response.bulk_get( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="", - keys=["My-Key"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.kv.namespaces.keys.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + keys=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + await async_client.kv.namespaces.keys.with_raw_response.bulk_get( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): - await async_client.kv.namespaces.keys.with_raw_response.bulk_get( - namespace_id="", + @parametrize + async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + key = await async_client.kv.namespaces.keys.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", - keys=["My-Key"], + body=[{}], ) - @parametrize - async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: - key = await async_client.kv.namespaces.keys.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) assert_matches_type(Optional[KeyBulkUpdateResponse], key, path=["response"]) @parametrize async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.kv.namespaces.keys.with_raw_response.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.kv.namespaces.keys.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -456,31 +490,33 @@ async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.kv.namespaces.keys.with_streaming_response.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.kv.namespaces.keys.with_streaming_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - key = await response.parse() - assert_matches_type(Optional[KeyBulkUpdateResponse], key, path=["response"]) + key = await response.parse() + assert_matches_type(Optional[KeyBulkUpdateResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_bulk_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.kv.namespaces.keys.with_raw_response.bulk_update( - namespace_id="0f2ac74b498b48028cb68387c421e279", - account_id="", - body=[{}], - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): - await async_client.kv.namespaces.keys.with_raw_response.bulk_update( - namespace_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.kv.namespaces.keys.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=[{}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + await async_client.kv.namespaces.keys.with_raw_response.bulk_update( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) diff --git a/tests/api_resources/kv/test_namespaces.py b/tests/api_resources/kv/test_namespaces.py index a2a586406be..df5a97c8a2d 100644 --- a/tests/api_resources/kv/test_namespaces.py +++ b/tests/api_resources/kv/test_namespaces.py @@ -12,6 +12,9 @@ from cloudflare.types.kv import ( Namespace, NamespaceDeleteResponse, + NamespaceBulkGetResponse, + NamespaceBulkDeleteResponse, + NamespaceBulkUpdateResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray @@ -213,6 +216,176 @@ def test_path_params_delete(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @parametrize + def test_method_bulk_delete(self, client: Cloudflare) -> None: + namespace = client.kv.namespaces.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + assert_matches_type(Optional[NamespaceBulkDeleteResponse], namespace, path=["response"]) + + @parametrize + def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: + response = client.kv.namespaces.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + namespace = response.parse() + assert_matches_type(Optional[NamespaceBulkDeleteResponse], namespace, path=["response"]) + + @parametrize + def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: + with client.kv.namespaces.with_streaming_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + namespace = response.parse() + assert_matches_type(Optional[NamespaceBulkDeleteResponse], namespace, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.kv.namespaces.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + client.kv.namespaces.with_raw_response.bulk_delete( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + + @parametrize + def test_method_bulk_get(self, client: Cloudflare) -> None: + namespace = client.kv.namespaces.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + @parametrize + def test_method_bulk_get_with_all_params(self, client: Cloudflare) -> None: + namespace = client.kv.namespaces.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + type="text", + with_metadata=True, + ) + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + @parametrize + def test_raw_response_bulk_get(self, client: Cloudflare) -> None: + response = client.kv.namespaces.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + namespace = response.parse() + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + @parametrize + def test_streaming_response_bulk_get(self, client: Cloudflare) -> None: + with client.kv.namespaces.with_streaming_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + namespace = response.parse() + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.kv.namespaces.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + keys=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + client.kv.namespaces.with_raw_response.bulk_get( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) + + @parametrize + def test_method_bulk_update(self, client: Cloudflare) -> None: + namespace = client.kv.namespaces.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) + assert_matches_type(Optional[NamespaceBulkUpdateResponse], namespace, path=["response"]) + + @parametrize + def test_raw_response_bulk_update(self, client: Cloudflare) -> None: + response = client.kv.namespaces.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + namespace = response.parse() + assert_matches_type(Optional[NamespaceBulkUpdateResponse], namespace, path=["response"]) + + @parametrize + def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: + with client.kv.namespaces.with_streaming_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + namespace = response.parse() + assert_matches_type(Optional[NamespaceBulkUpdateResponse], namespace, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.kv.namespaces.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=[{}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + client.kv.namespaces.with_raw_response.bulk_update( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) + @parametrize def test_method_get(self, client: Cloudflare) -> None: namespace = client.kv.namespaces.get( @@ -457,6 +630,176 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @parametrize + async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: + namespace = await async_client.kv.namespaces.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + assert_matches_type(Optional[NamespaceBulkDeleteResponse], namespace, path=["response"]) + + @parametrize + async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.kv.namespaces.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + namespace = await response.parse() + assert_matches_type(Optional[NamespaceBulkDeleteResponse], namespace, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.kv.namespaces.with_streaming_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + namespace = await response.parse() + assert_matches_type(Optional[NamespaceBulkDeleteResponse], namespace, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.kv.namespaces.with_raw_response.bulk_delete( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + await async_client.kv.namespaces.with_raw_response.bulk_delete( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=["My-Key"], + ) + + @parametrize + async def test_method_bulk_get(self, async_client: AsyncCloudflare) -> None: + namespace = await async_client.kv.namespaces.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + @parametrize + async def test_method_bulk_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + namespace = await async_client.kv.namespaces.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + type="text", + with_metadata=True, + ) + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + @parametrize + async def test_raw_response_bulk_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.kv.namespaces.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + namespace = await response.parse() + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.kv.namespaces.with_streaming_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + namespace = await response.parse() + assert_matches_type(Optional[NamespaceBulkGetResponse], namespace, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.kv.namespaces.with_raw_response.bulk_get( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + keys=["My-Key"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + await async_client.kv.namespaces.with_raw_response.bulk_get( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + keys=["My-Key"], + ) + + @parametrize + async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: + namespace = await async_client.kv.namespaces.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) + assert_matches_type(Optional[NamespaceBulkUpdateResponse], namespace, path=["response"]) + + @parametrize + async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.kv.namespaces.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + namespace = await response.parse() + assert_matches_type(Optional[NamespaceBulkUpdateResponse], namespace, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.kv.namespaces.with_streaming_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + namespace = await response.parse() + assert_matches_type(Optional[NamespaceBulkUpdateResponse], namespace, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.kv.namespaces.with_raw_response.bulk_update( + namespace_id="0f2ac74b498b48028cb68387c421e279", + account_id="", + body=[{}], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `namespace_id` but received ''"): + await async_client.kv.namespaces.with_raw_response.bulk_update( + namespace_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[{}], + ) + @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: namespace = await async_client.kv.namespaces.get( diff --git a/tests/api_resources/load_balancers/test_searches.py b/tests/api_resources/load_balancers/test_searches.py index 2f59eec6191..bcd3e6d6397 100644 --- a/tests/api_resources/load_balancers/test_searches.py +++ b/tests/api_resources/load_balancers/test_searches.py @@ -33,10 +33,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=1, - search_params={ - "query": "primary", - "references": "*", - }, + query="primary", + references="*", ) assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"]) @@ -93,10 +91,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=1, - search_params={ - "query": "primary", - "references": "*", - }, + query="primary", + references="*", ) assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"]) diff --git a/tests/api_resources/logs/control/cmb/test_config.py b/tests/api_resources/logs/control/cmb/test_config.py index b7240366dcd..e58378c937e 100644 --- a/tests/api_resources/logs/control/cmb/test_config.py +++ b/tests/api_resources/logs/control/cmb/test_config.py @@ -28,6 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: config = client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + allow_out_of_region_access=False, regions="eu", ) assert_matches_type(Optional[CmbConfig], config, path=["response"]) @@ -154,6 +155,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: config = await async_client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + allow_out_of_region_access=False, regions="eu", ) assert_matches_type(Optional[CmbConfig], config, path=["response"]) diff --git a/tests/api_resources/magic_transit/connectors/events/test_latest.py b/tests/api_resources/magic_transit/connectors/events/test_latest.py index f6453d17934..fb297d3841a 100644 --- a/tests/api_resources/magic_transit/connectors/events/test_latest.py +++ b/tests/api_resources/magic_transit/connectors/events/test_latest.py @@ -21,7 +21,7 @@ class TestLatest: def test_method_list(self, client: Cloudflare) -> None: latest = client.magic_transit.connectors.events.latest.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(LatestListResponse, latest, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_raw_response_list(self, client: Cloudflare) -> None: response = client.magic_transit.connectors.events.latest.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: def test_streaming_response_list(self, client: Cloudflare) -> None: with client.magic_transit.connectors.events.latest.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -53,10 +53,16 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @parametrize def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.magic_transit.connectors.events.latest.with_raw_response.list( + connector_id="connector_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): client.magic_transit.connectors.events.latest.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -67,7 +73,7 @@ class TestAsyncLatest: async def test_method_list(self, async_client: AsyncCloudflare) -> None: latest = await async_client.magic_transit.connectors.events.latest.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(LatestListResponse, latest, path=["response"]) @@ -75,7 +81,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.connectors.events.latest.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -87,7 +93,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.connectors.events.latest.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -99,8 +105,14 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.magic_transit.connectors.events.latest.with_raw_response.list( + connector_id="connector_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): await async_client.magic_transit.connectors.events.latest.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/magic_transit/connectors/snapshots/test_latest.py b/tests/api_resources/magic_transit/connectors/snapshots/test_latest.py index da251b5dbcf..2a812ac20c2 100644 --- a/tests/api_resources/magic_transit/connectors/snapshots/test_latest.py +++ b/tests/api_resources/magic_transit/connectors/snapshots/test_latest.py @@ -21,7 +21,7 @@ class TestLatest: def test_method_list(self, client: Cloudflare) -> None: latest = client.magic_transit.connectors.snapshots.latest.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(LatestListResponse, latest, path=["response"]) @@ -29,7 +29,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_raw_response_list(self, client: Cloudflare) -> None: response = client.magic_transit.connectors.snapshots.latest.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: def test_streaming_response_list(self, client: Cloudflare) -> None: with client.magic_transit.connectors.snapshots.latest.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -53,10 +53,16 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @parametrize def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.magic_transit.connectors.snapshots.latest.with_raw_response.list( + connector_id="connector_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): client.magic_transit.connectors.snapshots.latest.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -67,7 +73,7 @@ class TestAsyncLatest: async def test_method_list(self, async_client: AsyncCloudflare) -> None: latest = await async_client.magic_transit.connectors.snapshots.latest.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(LatestListResponse, latest, path=["response"]) @@ -75,7 +81,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.connectors.snapshots.latest.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -87,7 +93,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.connectors.snapshots.latest.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -99,8 +105,14 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.magic_transit.connectors.snapshots.latest.with_raw_response.list( + connector_id="connector_id", + account_id="", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): await async_client.magic_transit.connectors.snapshots.latest.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/magic_transit/connectors/test_events.py b/tests/api_resources/magic_transit/connectors/test_events.py index 33690ffbd82..65d54d4764d 100644 --- a/tests/api_resources/magic_transit/connectors/test_events.py +++ b/tests/api_resources/magic_transit/connectors/test_events.py @@ -21,7 +21,7 @@ class TestEvents: def test_method_list(self, client: Cloudflare) -> None: event = client.magic_transit.connectors.events.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -31,7 +31,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: event = client.magic_transit.connectors.events.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, cursor="cursor", @@ -43,7 +43,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_list(self, client: Cloudflare) -> None: response = client.magic_transit.connectors.events.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -57,7 +57,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: def test_streaming_response_list(self, client: Cloudflare) -> None: with client.magic_transit.connectors.events.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) as response: @@ -71,10 +71,18 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @parametrize def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.magic_transit.connectors.events.with_raw_response.list( + connector_id="connector_id", + account_id="", + from_=0, + to=0, + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): client.magic_transit.connectors.events.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -83,7 +91,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: event = client.magic_transit.connectors.events.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", event_t=0, ) @@ -93,7 +101,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.magic_transit.connectors.events.with_raw_response.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", event_t=0, ) @@ -107,7 +115,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.magic_transit.connectors.events.with_streaming_response.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", event_t=0, ) as response: @@ -121,10 +129,18 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.magic_transit.connectors.events.with_raw_response.get( + event_n=0, + account_id="", + connector_id="connector_id", + event_t=0, + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): client.magic_transit.connectors.events.with_raw_response.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="", event_t=0, ) @@ -137,7 +153,7 @@ class TestAsyncEvents: async def test_method_list(self, async_client: AsyncCloudflare) -> None: event = await async_client.magic_transit.connectors.events.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -147,7 +163,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: event = await async_client.magic_transit.connectors.events.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, cursor="cursor", @@ -159,7 +175,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.connectors.events.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -173,7 +189,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.connectors.events.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) as response: @@ -187,10 +203,18 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.magic_transit.connectors.events.with_raw_response.list( + connector_id="connector_id", + account_id="", + from_=0, + to=0, + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): await async_client.magic_transit.connectors.events.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -199,7 +223,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: event = await async_client.magic_transit.connectors.events.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", event_t=0, ) @@ -209,7 +233,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.connectors.events.with_raw_response.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", event_t=0, ) @@ -223,7 +247,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.connectors.events.with_streaming_response.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", event_t=0, ) as response: @@ -237,10 +261,18 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.magic_transit.connectors.events.with_raw_response.get( + event_n=0, + account_id="", + connector_id="connector_id", + event_t=0, + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): await async_client.magic_transit.connectors.events.with_raw_response.get( event_n=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="", event_t=0, ) diff --git a/tests/api_resources/magic_transit/connectors/test_snapshots.py b/tests/api_resources/magic_transit/connectors/test_snapshots.py index ca3ac201824..46a4ffa8148 100644 --- a/tests/api_resources/magic_transit/connectors/test_snapshots.py +++ b/tests/api_resources/magic_transit/connectors/test_snapshots.py @@ -21,7 +21,7 @@ class TestSnapshots: def test_method_list(self, client: Cloudflare) -> None: snapshot = client.magic_transit.connectors.snapshots.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -31,7 +31,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: snapshot = client.magic_transit.connectors.snapshots.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, cursor="cursor", @@ -43,7 +43,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_list(self, client: Cloudflare) -> None: response = client.magic_transit.connectors.snapshots.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -57,7 +57,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: def test_streaming_response_list(self, client: Cloudflare) -> None: with client.magic_transit.connectors.snapshots.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) as response: @@ -71,10 +71,18 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @parametrize def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.magic_transit.connectors.snapshots.with_raw_response.list( + connector_id="connector_id", + account_id="", + from_=0, + to=0, + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): client.magic_transit.connectors.snapshots.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -83,7 +91,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: snapshot = client.magic_transit.connectors.snapshots.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", ) assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) @@ -92,7 +100,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.magic_transit.connectors.snapshots.with_raw_response.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", ) @@ -105,7 +113,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.magic_transit.connectors.snapshots.with_streaming_response.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", ) as response: assert not response.is_closed @@ -118,10 +126,17 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.magic_transit.connectors.snapshots.with_raw_response.get( + snapshot_t=0, + account_id="", + connector_id="connector_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): client.magic_transit.connectors.snapshots.with_raw_response.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="", ) @@ -133,7 +148,7 @@ class TestAsyncSnapshots: async def test_method_list(self, async_client: AsyncCloudflare) -> None: snapshot = await async_client.magic_transit.connectors.snapshots.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -143,7 +158,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: snapshot = await async_client.magic_transit.connectors.snapshots.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, cursor="cursor", @@ -155,7 +170,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.connectors.snapshots.with_raw_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -169,7 +184,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.connectors.snapshots.with_streaming_response.list( connector_id="connector_id", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) as response: @@ -183,10 +198,18 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.magic_transit.connectors.snapshots.with_raw_response.list( + connector_id="connector_id", + account_id="", + from_=0, + to=0, + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): await async_client.magic_transit.connectors.snapshots.with_raw_response.list( connector_id="", - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", from_=0, to=0, ) @@ -195,7 +218,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: snapshot = await async_client.magic_transit.connectors.snapshots.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", ) assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) @@ -204,7 +227,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.connectors.snapshots.with_raw_response.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", ) @@ -217,7 +240,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.connectors.snapshots.with_streaming_response.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="connector_id", ) as response: assert not response.is_closed @@ -230,9 +253,16 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.magic_transit.connectors.snapshots.with_raw_response.get( + snapshot_t=0, + account_id="", + connector_id="connector_id", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): await async_client.magic_transit.connectors.snapshots.with_raw_response.get( snapshot_t=0, - account_id=0, + account_id="023e105f4ecef8ad9ca31a8372d0c353", connector_id="", ) diff --git a/tests/api_resources/network_interconnects/test_cnis.py b/tests/api_resources/network_interconnects/test_cnis.py index 89c5d12579e..a5ae1785ded 100644 --- a/tests/api_resources/network_interconnects/test_cnis.py +++ b/tests/api_resources/network_interconnects/test_cnis.py @@ -242,6 +242,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: cursor=0, limit=0, slot="slot", + tunnel_id="tunnel_id", ) assert_matches_type(CNIListResponse, cni, path=["response"]) @@ -596,6 +597,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) cursor=0, limit=0, slot="slot", + tunnel_id="tunnel_id", ) assert_matches_type(CNIListResponse, cni, path=["response"]) diff --git a/tests/api_resources/queues/test_messages.py b/tests/api_resources/queues/test_messages.py index 1686300e8ba..48a8880f39a 100644 --- a/tests/api_resources/queues/test_messages.py +++ b/tests/api_resources/queues/test_messages.py @@ -9,7 +9,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.queues import ( MessageAckResponse, MessagePullResponse, @@ -160,7 +159,7 @@ def test_method_pull(self, client: Cloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) @parametrize def test_method_pull_with_all_params(self, client: Cloudflare) -> None: @@ -170,7 +169,7 @@ def test_method_pull_with_all_params(self, client: Cloudflare) -> None: batch_size=50, visibility_timeout_ms=6000, ) - assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) @parametrize def test_raw_response_pull(self, client: Cloudflare) -> None: @@ -182,7 +181,7 @@ def test_raw_response_pull(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) @parametrize def test_streaming_response_pull(self, client: Cloudflare) -> None: @@ -194,7 +193,7 @@ def test_streaming_response_pull(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) assert cast(Any, response.is_closed) is True @@ -471,7 +470,7 @@ async def test_method_pull(self, async_client: AsyncCloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) @parametrize async def test_method_pull_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -481,7 +480,7 @@ async def test_method_pull_with_all_params(self, async_client: AsyncCloudflare) batch_size=50, visibility_timeout_ms=6000, ) - assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) @parametrize async def test_raw_response_pull(self, async_client: AsyncCloudflare) -> None: @@ -493,7 +492,7 @@ async def test_raw_response_pull(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) @parametrize async def test_streaming_response_pull(self, async_client: AsyncCloudflare) -> None: @@ -505,7 +504,7 @@ async def test_streaming_response_pull(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) + assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/attacks/layer3/test_top.py b/tests/api_resources/radar/attacks/layer3/test_top.py index 2a2362c4450..a2ba4039c5b 100644 --- a/tests/api_resources/radar/attacks/layer3/test_top.py +++ b/tests/api_resources/radar/attacks/layer3/test_top.py @@ -16,6 +16,8 @@ TopVerticalResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -69,28 +71,33 @@ def test_streaming_response_attacks(self, client: Cloudflare) -> None: @parametrize def test_method_industry(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer3.top.industry() + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer3.top.industry() + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize def test_method_industry_with_all_params(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer3.top.industry( - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - ip_version=["IPv4"], - limit=5, - location=["string"], - name=["main_series"], - protocol=["UDP"], - ) + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer3.top.industry( + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + ip_version=["IPv4"], + limit=5, + location=["string"], + name=["main_series"], + protocol=["UDP"], + ) + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize def test_raw_response_industry(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer3.top.with_raw_response.industry() + with pytest.warns(DeprecationWarning): + response = client.radar.attacks.layer3.top.with_raw_response.industry() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -99,39 +106,45 @@ def test_raw_response_industry(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_industry(self, client: Cloudflare) -> None: - with client.radar.attacks.layer3.top.with_streaming_response.industry() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.radar.attacks.layer3.top.with_streaming_response.industry() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = response.parse() - assert_matches_type(TopIndustryResponse, top, path=["response"]) + top = response.parse() + assert_matches_type(TopIndustryResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_vertical(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer3.top.vertical() + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer3.top.vertical() + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer3.top.vertical( - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - ip_version=["IPv4"], - limit=5, - location=["string"], - name=["main_series"], - protocol=["UDP"], - ) + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer3.top.vertical( + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + ip_version=["IPv4"], + limit=5, + location=["string"], + name=["main_series"], + protocol=["UDP"], + ) + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize def test_raw_response_vertical(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer3.top.with_raw_response.vertical() + with pytest.warns(DeprecationWarning): + response = client.radar.attacks.layer3.top.with_raw_response.vertical() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -140,12 +153,13 @@ def test_raw_response_vertical(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_vertical(self, client: Cloudflare) -> None: - with client.radar.attacks.layer3.top.with_streaming_response.vertical() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.radar.attacks.layer3.top.with_streaming_response.vertical() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = response.parse() - assert_matches_type(TopVerticalResponse, top, path=["response"]) + top = response.parse() + assert_matches_type(TopVerticalResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True @@ -200,28 +214,33 @@ async def test_streaming_response_attacks(self, async_client: AsyncCloudflare) - @parametrize async def test_method_industry(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer3.top.industry() + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer3.top.industry() + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize async def test_method_industry_with_all_params(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer3.top.industry( - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - ip_version=["IPv4"], - limit=5, - location=["string"], - name=["main_series"], - protocol=["UDP"], - ) + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer3.top.industry( + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + ip_version=["IPv4"], + limit=5, + location=["string"], + name=["main_series"], + protocol=["UDP"], + ) + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize async def test_raw_response_industry(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer3.top.with_raw_response.industry() + with pytest.warns(DeprecationWarning): + response = await async_client.radar.attacks.layer3.top.with_raw_response.industry() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -230,39 +249,45 @@ async def test_raw_response_industry(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_streaming_response_industry(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer3.top.with_streaming_response.industry() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.radar.attacks.layer3.top.with_streaming_response.industry() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = await response.parse() - assert_matches_type(TopIndustryResponse, top, path=["response"]) + top = await response.parse() + assert_matches_type(TopIndustryResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_vertical(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer3.top.vertical() + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer3.top.vertical() + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize async def test_method_vertical_with_all_params(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer3.top.vertical( - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - ip_version=["IPv4"], - limit=5, - location=["string"], - name=["main_series"], - protocol=["UDP"], - ) + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer3.top.vertical( + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + ip_version=["IPv4"], + limit=5, + location=["string"], + name=["main_series"], + protocol=["UDP"], + ) + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize async def test_raw_response_vertical(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer3.top.with_raw_response.vertical() + with pytest.warns(DeprecationWarning): + response = await async_client.radar.attacks.layer3.top.with_raw_response.vertical() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -271,11 +296,12 @@ async def test_raw_response_vertical(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_streaming_response_vertical(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer3.top.with_streaming_response.vertical() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.radar.attacks.layer3.top.with_streaming_response.vertical() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = await response.parse() - assert_matches_type(TopVerticalResponse, top, path=["response"]) + top = await response.parse() + assert_matches_type(TopVerticalResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/attacks/layer7/test_top.py b/tests/api_resources/radar/attacks/layer7/test_top.py index 85ef448a3fd..0b9bdd624b2 100644 --- a/tests/api_resources/radar/attacks/layer7/test_top.py +++ b/tests/api_resources/radar/attacks/layer7/test_top.py @@ -16,6 +16,8 @@ TopVerticalResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -69,31 +71,36 @@ def test_streaming_response_attacks(self, client: Cloudflare) -> None: @parametrize def test_method_industry(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer7.top.industry() + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer7.top.industry() + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize def test_method_industry_with_all_params(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer7.top.industry( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - http_method=["GET"], - http_version=["HTTPv1"], - ip_version=["IPv4"], - limit=5, - location=["string"], - mitigation_product=["DDOS"], - name=["main_series"], - ) + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer7.top.industry( + asn=["string"], + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + http_method=["GET"], + http_version=["HTTPv1"], + ip_version=["IPv4"], + limit=5, + location=["string"], + mitigation_product=["DDOS"], + name=["main_series"], + ) + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize def test_raw_response_industry(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer7.top.with_raw_response.industry() + with pytest.warns(DeprecationWarning): + response = client.radar.attacks.layer7.top.with_raw_response.industry() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -102,42 +109,48 @@ def test_raw_response_industry(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_industry(self, client: Cloudflare) -> None: - with client.radar.attacks.layer7.top.with_streaming_response.industry() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.radar.attacks.layer7.top.with_streaming_response.industry() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = response.parse() - assert_matches_type(TopIndustryResponse, top, path=["response"]) + top = response.parse() + assert_matches_type(TopIndustryResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_vertical(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer7.top.vertical() + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer7.top.vertical() + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: - top = client.radar.attacks.layer7.top.vertical( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - http_method=["GET"], - http_version=["HTTPv1"], - ip_version=["IPv4"], - limit=5, - location=["string"], - mitigation_product=["DDOS"], - name=["main_series"], - ) + with pytest.warns(DeprecationWarning): + top = client.radar.attacks.layer7.top.vertical( + asn=["string"], + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + http_method=["GET"], + http_version=["HTTPv1"], + ip_version=["IPv4"], + limit=5, + location=["string"], + mitigation_product=["DDOS"], + name=["main_series"], + ) + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize def test_raw_response_vertical(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer7.top.with_raw_response.vertical() + with pytest.warns(DeprecationWarning): + response = client.radar.attacks.layer7.top.with_raw_response.vertical() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,12 +159,13 @@ def test_raw_response_vertical(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_vertical(self, client: Cloudflare) -> None: - with client.radar.attacks.layer7.top.with_streaming_response.vertical() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.radar.attacks.layer7.top.with_streaming_response.vertical() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = response.parse() - assert_matches_type(TopVerticalResponse, top, path=["response"]) + top = response.parse() + assert_matches_type(TopVerticalResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True @@ -206,31 +220,36 @@ async def test_streaming_response_attacks(self, async_client: AsyncCloudflare) - @parametrize async def test_method_industry(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer7.top.industry() + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer7.top.industry() + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize async def test_method_industry_with_all_params(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer7.top.industry( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - http_method=["GET"], - http_version=["HTTPv1"], - ip_version=["IPv4"], - limit=5, - location=["string"], - mitigation_product=["DDOS"], - name=["main_series"], - ) + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer7.top.industry( + asn=["string"], + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + http_method=["GET"], + http_version=["HTTPv1"], + ip_version=["IPv4"], + limit=5, + location=["string"], + mitigation_product=["DDOS"], + name=["main_series"], + ) + assert_matches_type(TopIndustryResponse, top, path=["response"]) @parametrize async def test_raw_response_industry(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer7.top.with_raw_response.industry() + with pytest.warns(DeprecationWarning): + response = await async_client.radar.attacks.layer7.top.with_raw_response.industry() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -239,42 +258,48 @@ async def test_raw_response_industry(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_streaming_response_industry(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.top.with_streaming_response.industry() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.radar.attacks.layer7.top.with_streaming_response.industry() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = await response.parse() - assert_matches_type(TopIndustryResponse, top, path=["response"]) + top = await response.parse() + assert_matches_type(TopIndustryResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_vertical(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer7.top.vertical() + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer7.top.vertical() + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize async def test_method_vertical_with_all_params(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.attacks.layer7.top.vertical( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - http_method=["GET"], - http_version=["HTTPv1"], - ip_version=["IPv4"], - limit=5, - location=["string"], - mitigation_product=["DDOS"], - name=["main_series"], - ) + with pytest.warns(DeprecationWarning): + top = await async_client.radar.attacks.layer7.top.vertical( + asn=["string"], + continent=["string"], + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + http_method=["GET"], + http_version=["HTTPv1"], + ip_version=["IPv4"], + limit=5, + location=["string"], + mitigation_product=["DDOS"], + name=["main_series"], + ) + assert_matches_type(TopVerticalResponse, top, path=["response"]) @parametrize async def test_raw_response_vertical(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer7.top.with_raw_response.vertical() + with pytest.warns(DeprecationWarning): + response = await async_client.radar.attacks.layer7.top.with_raw_response.vertical() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -283,11 +308,12 @@ async def test_raw_response_vertical(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_streaming_response_vertical(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.top.with_streaming_response.vertical() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.radar.attacks.layer7.top.with_streaming_response.vertical() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - top = await response.parse() - assert_matches_type(TopVerticalResponse, top, path=["response"]) + top = await response.parse() + assert_matches_type(TopVerticalResponse, top, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/test_search.py b/tests/api_resources/radar/test_search.py index c97d336abec..a0d51854976 100644 --- a/tests/api_resources/radar/test_search.py +++ b/tests/api_resources/radar/test_search.py @@ -28,9 +28,9 @@ def test_method_global(self, client: Cloudflare) -> None: def test_method_global_with_all_params(self, client: Cloudflare) -> None: search = client.radar.search.global_( query="United", - exclude=["SPECIAL_EVENTS"], + exclude=["ASNS"], format="JSON", - include=["SPECIAL_EVENTS"], + include=["ASNS"], limit=5, limit_per_group=0, ) @@ -75,9 +75,9 @@ async def test_method_global(self, async_client: AsyncCloudflare) -> None: async def test_method_global_with_all_params(self, async_client: AsyncCloudflare) -> None: search = await async_client.radar.search.global_( query="United", - exclude=["SPECIAL_EVENTS"], + exclude=["ASNS"], format="JSON", - include=["SPECIAL_EVENTS"], + include=["ASNS"], limit=5, limit_per_group=0, ) diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index de7cdf84464..d37e672d13d 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1444,7 +1444,7 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, }, - description="Set cache settings when the hostname address is not example.com", + description="Set cache settings when the hostname address is not example.com", enabled=True, exposed_credential_check={ "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', @@ -3504,7 +3504,7 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, }, - description="Set cache settings when the hostname address is not example.com", + description="Set cache settings when the hostname address is not example.com", enabled=True, exposed_credential_check={ "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', @@ -5343,7 +5343,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, }, - description="Set cache settings when the hostname address is not example.com", + description="Set cache settings when the hostname address is not example.com", enabled=True, exposed_credential_check={ "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', @@ -7403,7 +7403,7 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, }, - description="Set cache settings when the hostname address is not example.com", + description="Set cache settings when the hostname address is not example.com", enabled=True, exposed_credential_check={ "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', diff --git a/tests/api_resources/schema_validation/test_schemas.py b/tests/api_resources/schema_validation/test_schemas.py index cd44ef1a4d5..14b2e9dcc9b 100644 --- a/tests/api_resources/schema_validation/test_schemas.py +++ b/tests/api_resources/schema_validation/test_schemas.py @@ -26,16 +26,6 @@ class TestSchemas: @parametrize def test_method_create(self, client: Cloudflare) -> None: - schema = client.schema_validation.schemas.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - kind="openapi_v3", - name="petstore schema", - source="", - ) - assert_matches_type(SchemaCreateResponse, schema, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: schema = client.schema_validation.schemas.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", kind="openapi_v3", @@ -52,6 +42,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: kind="openapi_v3", name="petstore schema", source="", + validation_enabled=True, ) assert response.is_closed is True @@ -66,6 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: kind="openapi_v3", name="petstore schema", source="", + validation_enabled=True, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -83,6 +75,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: kind="openapi_v3", name="petstore schema", source="", + validation_enabled=True, ) @parametrize @@ -302,16 +295,6 @@ class TestAsyncSchemas: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - schema = await async_client.schema_validation.schemas.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - kind="openapi_v3", - name="petstore schema", - source="", - ) - assert_matches_type(SchemaCreateResponse, schema, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: schema = await async_client.schema_validation.schemas.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", kind="openapi_v3", @@ -328,6 +311,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: kind="openapi_v3", name="petstore schema", source="", + validation_enabled=True, ) assert response.is_closed is True @@ -342,6 +326,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> kind="openapi_v3", name="petstore schema", source="", + validation_enabled=True, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -359,6 +344,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: kind="openapi_v3", name="petstore schema", source="", + validation_enabled=True, ) @parametrize diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 33d6ce75932..345d30376fa 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -67,7 +67,8 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_method_update(self, client: Cloudflare) -> None: account = client.accounts.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) assert_matches_type(Optional[Account], account, path=["response"]) @@ -75,7 +76,8 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: account = client.accounts.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", settings={ "abuse_contact_email": "abuse_contact_email", @@ -87,7 +89,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.accounts.with_raw_response.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) @@ -99,7 +102,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.accounts.with_streaming_response.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) as response: assert not response.is_closed @@ -115,6 +119,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.accounts.with_raw_response.update( account_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) @@ -194,14 +199,14 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: account = client.accounts.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Account], account, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.accounts.with_raw_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -212,7 +217,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.accounts.with_streaming_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -279,7 +284,8 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: account = await async_client.accounts.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) assert_matches_type(Optional[Account], account, path=["response"]) @@ -287,7 +293,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: account = await async_client.accounts.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", settings={ "abuse_contact_email": "abuse_contact_email", @@ -299,7 +306,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.with_raw_response.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) @@ -311,7 +319,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.with_streaming_response.update( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) as response: assert not response.is_closed @@ -327,6 +336,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.accounts.with_raw_response.update( account_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", ) @@ -406,14 +416,14 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: account = await async_client.accounts.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Account], account, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.with_raw_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -424,7 +434,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.accounts.with_streaming_response.get( - account_id="eb78d65290b24279ba6f44721b3ea3c4", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_email_routing.py b/tests/api_resources/test_email_routing.py index 6f20c5ca8c3..e39bb1e1c5e 100644 --- a/tests/api_resources/test_email_routing.py +++ b/tests/api_resources/test_email_routing.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.email_routing import Settings +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,18 +21,21 @@ class TestEmailRouting: @parametrize def test_method_disable(self, client: Cloudflare) -> None: - email_routing = client.email_routing.disable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + email_routing = client.email_routing.disable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_raw_response_disable(self, client: Cloudflare) -> None: - response = client.email_routing.with_raw_response.disable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = client.email_routing.with_raw_response.disable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -39,40 +44,45 @@ def test_raw_response_disable(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_disable(self, client: Cloudflare) -> None: - with client.email_routing.with_streaming_response.disable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.email_routing.with_streaming_response.disable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + email_routing = response.parse() + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_disable(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.email_routing.with_raw_response.disable( - zone_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.email_routing.with_raw_response.disable( + zone_id="", + body={}, + ) @parametrize def test_method_enable(self, client: Cloudflare) -> None: - email_routing = client.email_routing.enable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + email_routing = client.email_routing.enable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_raw_response_enable(self, client: Cloudflare) -> None: - response = client.email_routing.with_raw_response.enable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = client.email_routing.with_raw_response.enable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -81,25 +91,27 @@ def test_raw_response_enable(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_enable(self, client: Cloudflare) -> None: - with client.email_routing.with_streaming_response.enable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.email_routing.with_streaming_response.enable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + email_routing = response.parse() + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_enable(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.email_routing.with_raw_response.enable( - zone_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.email_routing.with_raw_response.enable( + zone_id="", + body={}, + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: @@ -145,18 +157,21 @@ class TestAsyncEmailRouting: @parametrize async def test_method_disable(self, async_client: AsyncCloudflare) -> None: - email_routing = await async_client.email_routing.disable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + email_routing = await async_client.email_routing.disable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None: - response = await async_client.email_routing.with_raw_response.disable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.email_routing.with_raw_response.disable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -165,40 +180,45 @@ async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None @parametrize async def test_streaming_response_disable(self, async_client: AsyncCloudflare) -> None: - async with async_client.email_routing.with_streaming_response.disable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.email_routing.with_streaming_response.disable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + email_routing = await response.parse() + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_disable(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.email_routing.with_raw_response.disable( - zone_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.email_routing.with_raw_response.disable( + zone_id="", + body={}, + ) @parametrize async def test_method_enable(self, async_client: AsyncCloudflare) -> None: - email_routing = await async_client.email_routing.enable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + email_routing = await async_client.email_routing.enable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: - response = await async_client.email_routing.with_raw_response.enable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.email_routing.with_raw_response.enable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -207,25 +227,27 @@ async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_enable(self, async_client: AsyncCloudflare) -> None: - async with async_client.email_routing.with_streaming_response.enable( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.email_routing.with_streaming_response.enable( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + email_routing = await response.parse() + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_enable(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.email_routing.with_raw_response.enable( - zone_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.email_routing.with_raw_response.enable( + zone_id="", + body={}, + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/test_user.py b/tests/api_resources/test_user.py index 1ffbb87e386..d214ccb7353 100644 --- a/tests/api_resources/test_user.py +++ b/tests/api_resources/test_user.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types.user import UserGetResponse, UserEditResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,7 +20,7 @@ class TestUser: @parametrize def test_method_edit(self, client: Cloudflare) -> None: user = client.user.edit() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -30,7 +31,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: telephone="+1 123-123-1234", zipcode="12345", ) - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -39,7 +40,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -48,14 +49,14 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_get(self, client: Cloudflare) -> None: user = client.user.get() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -64,7 +65,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -73,7 +74,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True @@ -84,7 +85,7 @@ class TestAsyncUser: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: user = await async_client.user.edit() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -95,7 +96,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) telephone="+1 123-123-1234", zipcode="12345", ) - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -104,7 +105,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -113,14 +114,14 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserEditResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: user = await async_client.user.get() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -129,7 +130,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -138,6 +139,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(object, user, path=["response"]) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/billing/test_history.py b/tests/api_resources/user/billing/test_history.py index e97e0e970e4..067df084104 100644 --- a/tests/api_resources/user/billing/test_history.py +++ b/tests/api_resources/user/billing/test_history.py @@ -13,6 +13,8 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.user.billing import BillingHistory +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,24 +23,29 @@ class TestHistory: @parametrize def test_method_list(self, client: Cloudflare) -> None: - history = client.user.billing.history.list() + with pytest.warns(DeprecationWarning): + history = client.user.billing.history.list() + assert_matches_type(SyncV4PagePaginationArray[BillingHistory], history, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - history = client.user.billing.history.list( - action="subscription", - occurred_at=parse_datetime("2014-03-01T12:21:59.3456Z"), - order="occurred_at", - page=1, - per_page=5, - type="charge", - ) + with pytest.warns(DeprecationWarning): + history = client.user.billing.history.list( + action="subscription", + occurred_at=parse_datetime("2014-03-01T12:21:59.3456Z"), + order="occurred_at", + page=1, + per_page=5, + type="charge", + ) + assert_matches_type(SyncV4PagePaginationArray[BillingHistory], history, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.user.billing.history.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = client.user.billing.history.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -47,12 +54,13 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.user.billing.history.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.user.billing.history.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - history = response.parse() - assert_matches_type(SyncV4PagePaginationArray[BillingHistory], history, path=["response"]) + history = response.parse() + assert_matches_type(SyncV4PagePaginationArray[BillingHistory], history, path=["response"]) assert cast(Any, response.is_closed) is True @@ -62,24 +70,29 @@ class TestAsyncHistory: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - history = await async_client.user.billing.history.list() + with pytest.warns(DeprecationWarning): + history = await async_client.user.billing.history.list() + assert_matches_type(AsyncV4PagePaginationArray[BillingHistory], history, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - history = await async_client.user.billing.history.list( - action="subscription", - occurred_at=parse_datetime("2014-03-01T12:21:59.3456Z"), - order="occurred_at", - page=1, - per_page=5, - type="charge", - ) + with pytest.warns(DeprecationWarning): + history = await async_client.user.billing.history.list( + action="subscription", + occurred_at=parse_datetime("2014-03-01T12:21:59.3456Z"), + order="occurred_at", + page=1, + per_page=5, + type="charge", + ) + assert_matches_type(AsyncV4PagePaginationArray[BillingHistory], history, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.billing.history.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = await async_client.user.billing.history.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -88,11 +101,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.billing.history.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.user.billing.history.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - history = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[BillingHistory], history, path=["response"]) + history = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[BillingHistory], history, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/billing/test_profile.py b/tests/api_resources/user/billing/test_profile.py index 1436c46dd18..06eed719a6b 100644 --- a/tests/api_resources/user/billing/test_profile.py +++ b/tests/api_resources/user/billing/test_profile.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.user.billing import ProfileGetResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,12 +21,15 @@ class TestProfile: @parametrize def test_method_get(self, client: Cloudflare) -> None: - profile = client.user.billing.profile.get() + with pytest.warns(DeprecationWarning): + profile = client.user.billing.profile.get() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.user.billing.profile.with_raw_response.get() + with pytest.warns(DeprecationWarning): + response = client.user.billing.profile.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -33,12 +38,13 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.user.billing.profile.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.user.billing.profile.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - profile = response.parse() - assert_matches_type(ProfileGetResponse, profile, path=["response"]) + profile = response.parse() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True @@ -48,12 +54,15 @@ class TestAsyncProfile: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - profile = await async_client.user.billing.profile.get() + with pytest.warns(DeprecationWarning): + profile = await async_client.user.billing.profile.get() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.billing.profile.with_raw_response.get() + with pytest.warns(DeprecationWarning): + response = await async_client.user.billing.profile.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,11 +71,12 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.billing.profile.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.user.billing.profile.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - profile = await response.parse() - assert_matches_type(ProfileGetResponse, profile, path=["response"]) + profile = await response.parse() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/test_organizations.py b/tests/api_resources/user/test_organizations.py index c129ec550be..724aac1a95c 100644 --- a/tests/api_resources/user/test_organizations.py +++ b/tests/api_resources/user/test_organizations.py @@ -12,6 +12,8 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.user import Organization, OrganizationDeleteResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,25 +22,30 @@ class TestOrganizations: @parametrize def test_method_list(self, client: Cloudflare) -> None: - organization = client.user.organizations.list() + with pytest.warns(DeprecationWarning): + organization = client.user.organizations.list() + assert_matches_type(SyncV4PagePaginationArray[Organization], organization, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - organization = client.user.organizations.list( - direction="desc", - match="any", - name="Cloudflare, Inc.", - order="status", - page=1, - per_page=5, - status="member", - ) + with pytest.warns(DeprecationWarning): + organization = client.user.organizations.list( + direction="desc", + match="any", + name="Cloudflare, Inc.", + order="status", + page=1, + per_page=5, + status="member", + ) + assert_matches_type(SyncV4PagePaginationArray[Organization], organization, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.user.organizations.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = client.user.organizations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -47,27 +54,31 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.user.organizations.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.user.organizations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Organization], organization, path=["response"]) + organization = response.parse() + assert_matches_type(SyncV4PagePaginationArray[Organization], organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_delete(self, client: Cloudflare) -> None: - organization = client.user.organizations.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + organization = client.user.organizations.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.user.organizations.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.user.organizations.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -76,36 +87,41 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.user.organizations.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.user.organizations.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) + organization = response.parse() + assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): - client.user.organizations.with_raw_response.delete( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): + client.user.organizations.with_raw_response.delete( + "", + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - organization = client.user.organizations.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + organization = client.user.organizations.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(object, organization, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.user.organizations.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.user.organizations.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,23 +130,25 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.user.organizations.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.user.organizations.with_streaming_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = response.parse() - assert_matches_type(object, organization, path=["response"]) + organization = response.parse() + assert_matches_type(object, organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): - client.user.organizations.with_raw_response.get( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): + client.user.organizations.with_raw_response.get( + "", + ) class TestAsyncOrganizations: @@ -138,25 +156,30 @@ class TestAsyncOrganizations: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - organization = await async_client.user.organizations.list() + with pytest.warns(DeprecationWarning): + organization = await async_client.user.organizations.list() + assert_matches_type(AsyncV4PagePaginationArray[Organization], organization, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - organization = await async_client.user.organizations.list( - direction="desc", - match="any", - name="Cloudflare, Inc.", - order="status", - page=1, - per_page=5, - status="member", - ) + with pytest.warns(DeprecationWarning): + organization = await async_client.user.organizations.list( + direction="desc", + match="any", + name="Cloudflare, Inc.", + order="status", + page=1, + per_page=5, + status="member", + ) + assert_matches_type(AsyncV4PagePaginationArray[Organization], organization, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.organizations.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = await async_client.user.organizations.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -165,27 +188,31 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.organizations.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.user.organizations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Organization], organization, path=["response"]) + organization = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[Organization], organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - organization = await async_client.user.organizations.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + organization = await async_client.user.organizations.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.organizations.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.user.organizations.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,36 +221,41 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.organizations.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.user.organizations.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) + organization = await response.parse() + assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): - await async_client.user.organizations.with_raw_response.delete( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): + await async_client.user.organizations.with_raw_response.delete( + "", + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - organization = await async_client.user.organizations.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + organization = await async_client.user.organizations.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(object, organization, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.organizations.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.user.organizations.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -232,20 +264,22 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.organizations.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.user.organizations.with_streaming_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization = await response.parse() - assert_matches_type(object, organization, path=["response"]) + organization = await response.parse() + assert_matches_type(object, organization, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): - await async_client.user.organizations.with_raw_response.get( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): + await async_client.user.organizations.with_raw_response.get( + "", + ) diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 78983571b56..fc0e0bad871 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -44,8 +44,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "_redirects": "/foo /bar 301\n/news/* /blog/:splat", "html_handling": "auto-trailing-slash", "not_found_handling": "404-page", - "run_worker_first": False, - "serve_directly": True, + "run_worker_first": ["string"], }, "jwt": "jwt", }, @@ -323,8 +322,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "_redirects": "/foo /bar 301\n/news/* /blog/:splat", "html_handling": "auto-trailing-slash", "not_found_handling": "404-page", - "run_worker_first": False, - "serve_directly": True, + "run_worker_first": ["string"], }, "jwt": "jwt", }, diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index fd9a1fdaa16..3f82e720e66 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -45,8 +45,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "_redirects": "/foo /bar 301\n/news/* /blog/:splat", "html_handling": "auto-trailing-slash", "not_found_handling": "404-page", - "run_worker_first": False, - "serve_directly": True, + "run_worker_first": ["string"], }, "jwt": "jwt", }, @@ -325,8 +324,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "_redirects": "/foo /bar 301\n/news/* /blog/:splat", "html_handling": "auto-trailing-slash", "not_found_handling": "404-page", - "run_worker_first": False, - "serve_directly": True, + "run_worker_first": ["string"], }, "jwt": "jwt", }, diff --git a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py index de727579b7d..3eebb5554ba 100644 --- a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py +++ b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py @@ -19,6 +19,8 @@ TargetBulkUpdateResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -281,15 +283,60 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_delete(self, client: Cloudflare) -> None: - target = client.zero_trust.access.infrastructure.targets.bulk_delete( + with pytest.warns(DeprecationWarning): + target = client.zero_trust.access.infrastructure.targets.bulk_delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert target is None + + @parametrize + def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + response = client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + target = response.parse() + assert target is None + + @parametrize + def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + with client.zero_trust.access.infrastructure.targets.with_streaming_response.bulk_delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + target = response.parse() + assert target is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_delete(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + account_id="", + ) + + @parametrize + def test_method_bulk_delete_v2(self, client: Cloudflare) -> None: + target = client.zero_trust.access.infrastructure.targets.bulk_delete_v2( account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert target is None @parametrize - def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + def test_raw_response_bulk_delete_v2(self, client: Cloudflare) -> None: + response = client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete_v2( account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert response.is_closed is True @@ -298,9 +345,10 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: assert target is None @parametrize - def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: - with client.zero_trust.access.infrastructure.targets.with_streaming_response.bulk_delete( + def test_streaming_response_bulk_delete_v2(self, client: Cloudflare) -> None: + with client.zero_trust.access.infrastructure.targets.with_streaming_response.bulk_delete_v2( account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -311,10 +359,11 @@ def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_bulk_delete(self, client: Cloudflare) -> None: + def test_path_params_bulk_delete_v2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete_v2( account_id="", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) @parametrize @@ -687,15 +736,60 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: - target = await async_client.zero_trust.access.infrastructure.targets.bulk_delete( + with pytest.warns(DeprecationWarning): + target = await async_client.zero_trust.access.infrastructure.targets.bulk_delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert target is None + + @parametrize + async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + target = await response.parse() + assert target is None + + @parametrize + async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.access.infrastructure.targets.with_streaming_response.bulk_delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + target = await response.parse() + assert target is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + account_id="", + ) + + @parametrize + async def test_method_bulk_delete_v2(self, async_client: AsyncCloudflare) -> None: + target = await async_client.zero_trust.access.infrastructure.targets.bulk_delete_v2( account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert target is None @parametrize - async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + async def test_raw_response_bulk_delete_v2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete_v2( account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert response.is_closed is True @@ -704,9 +798,10 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> assert target is None @parametrize - async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.infrastructure.targets.with_streaming_response.bulk_delete( + async def test_streaming_response_bulk_delete_v2(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.infrastructure.targets.with_streaming_response.bulk_delete_v2( account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -717,10 +812,11 @@ async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflar assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_bulk_delete_v2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete( + await async_client.zero_trust.access.infrastructure.targets.with_raw_response.bulk_delete_v2( account_id="", + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) @parametrize diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 705f1030577..3accaf5a932 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -316,7 +316,7 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: def test_method_create_overload_3(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -326,7 +326,7 @@ def test_method_create_overload_3(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -433,7 +433,7 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -447,7 +447,7 @@ def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -464,14 +464,14 @@ def test_path_params_create_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -480,7 +480,7 @@ def test_path_params_create_overload_3(self, client: Cloudflare) -> None: def test_method_create_overload_4(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -490,7 +490,7 @@ def test_method_create_overload_4(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -597,7 +597,7 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -611,7 +611,7 @@ def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -628,14 +628,14 @@ def test_path_params_create_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -643,7 +643,7 @@ def test_path_params_create_overload_4(self, client: Cloudflare) -> None: @parametrize def test_method_create_overload_5(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -652,7 +652,7 @@ def test_method_create_overload_5(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - type="app_launcher", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -712,7 +712,7 @@ def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> N @parametrize def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -725,7 +725,7 @@ def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -741,13 +741,13 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: def test_path_params_create_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( - type="app_launcher", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -755,7 +755,7 @@ def test_path_params_create_overload_5(self, client: Cloudflare) -> None: @parametrize def test_method_create_overload_6(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - type="warp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -764,7 +764,7 @@ def test_method_create_overload_6(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - type="warp", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -824,7 +824,7 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N @parametrize def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( - type="warp", + type="self_hosted", account_id="account_id", ) @@ -837,7 +837,7 @@ def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( - type="warp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -853,13 +853,13 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: def test_path_params_create_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( - type="warp", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( - type="warp", + type="self_hosted", account_id="account_id", ) @@ -867,7 +867,7 @@ def test_path_params_create_overload_6(self, client: Cloudflare) -> None: @parametrize def test_method_create_overload_7(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - type="biso", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -876,7 +876,7 @@ def test_method_create_overload_7(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - type="biso", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -936,7 +936,7 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N @parametrize def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( - type="biso", + type="self_hosted", account_id="account_id", ) @@ -949,7 +949,7 @@ def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( - type="biso", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -965,13 +965,13 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: def test_path_params_create_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( - type="biso", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( - type="biso", + type="self_hosted", account_id="account_id", ) @@ -1068,7 +1068,7 @@ def test_method_create_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -1084,7 +1084,7 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -1116,7 +1116,7 @@ def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -1136,7 +1136,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -1159,7 +1159,7 @@ def test_path_params_create_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -1172,7 +1172,7 @@ def test_path_params_create_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -1188,11 +1188,11 @@ def test_method_create_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -1205,11 +1205,11 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -1319,11 +1319,11 @@ def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -1340,11 +1340,11 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -1364,11 +1364,11 @@ def test_path_params_create_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="", ) @@ -1378,11 +1378,11 @@ def test_path_params_create_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -1705,7 +1705,7 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -1716,7 +1716,7 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -1824,7 +1824,7 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -1839,7 +1839,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -1857,7 +1857,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -1865,7 +1865,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="", ) @@ -1873,7 +1873,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -1883,7 +1883,7 @@ def test_method_update_overload_4(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -1894,7 +1894,7 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -2002,7 +2002,7 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -2017,7 +2017,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2035,7 +2035,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -2043,7 +2043,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="", ) @@ -2051,7 +2051,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -2060,7 +2060,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: def test_method_update_overload_5(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -2070,7 +2070,7 @@ def test_method_update_overload_5(self, client: Cloudflare) -> None: def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -2131,7 +2131,7 @@ def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> N def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -2145,7 +2145,7 @@ def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2162,21 +2162,21 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="app_launcher", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -2185,7 +2185,7 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: def test_method_update_overload_6(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -2195,7 +2195,7 @@ def test_method_update_overload_6(self, client: Cloudflare) -> None: def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -2256,7 +2256,7 @@ def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> N def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) @@ -2270,7 +2270,7 @@ def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2287,21 +2287,21 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="warp", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) @@ -2310,7 +2310,7 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: def test_method_update_overload_7(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -2320,7 +2320,7 @@ def test_method_update_overload_7(self, client: Cloudflare) -> None: def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -2381,7 +2381,7 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) @@ -2395,7 +2395,7 @@ def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2412,21 +2412,21 @@ def test_path_params_update_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="biso", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) @@ -2536,7 +2536,7 @@ def test_method_update_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2553,7 +2553,7 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2586,7 +2586,7 @@ def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2607,7 +2607,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2631,7 +2631,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2645,7 +2645,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2659,7 +2659,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -2676,11 +2676,11 @@ def test_method_update_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -2694,11 +2694,11 @@ def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -2809,11 +2809,11 @@ def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -2831,11 +2831,11 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2856,11 +2856,11 @@ def test_path_params_update_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -2871,11 +2871,11 @@ def test_path_params_update_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="", ) @@ -2886,11 +2886,11 @@ def test_path_params_update_overload_10(self, client: Cloudflare) -> None: target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -3450,7 +3450,7 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -3460,7 +3460,7 @@ async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -3567,7 +3567,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -3581,7 +3581,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -3598,14 +3598,14 @@ async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -3614,7 +3614,7 @@ async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -3624,7 +3624,7 @@ async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -3731,7 +3731,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -3745,7 +3745,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -3762,14 +3762,14 @@ async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -3777,7 +3777,7 @@ async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare @parametrize async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -3786,7 +3786,7 @@ async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_create_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - type="app_launcher", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -3846,7 +3846,7 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -3859,7 +3859,7 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflar @parametrize async def test_streaming_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -3875,13 +3875,13 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - type="app_launcher", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -3889,7 +3889,7 @@ async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare @parametrize async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - type="warp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -3898,7 +3898,7 @@ async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_create_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - type="warp", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -3958,7 +3958,7 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( - type="warp", + type="self_hosted", account_id="account_id", ) @@ -3971,7 +3971,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflar @parametrize async def test_streaming_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( - type="warp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -3987,13 +3987,13 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - type="warp", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - type="warp", + type="self_hosted", account_id="account_id", ) @@ -4001,7 +4001,7 @@ async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare @parametrize async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - type="biso", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -4010,7 +4010,7 @@ async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_create_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - type="biso", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -4070,7 +4070,7 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( - type="biso", + type="self_hosted", account_id="account_id", ) @@ -4083,7 +4083,7 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflar @parametrize async def test_streaming_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( - type="biso", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -4099,13 +4099,13 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - type="biso", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - type="biso", + type="self_hosted", account_id="account_id", ) @@ -4202,7 +4202,7 @@ async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -4218,7 +4218,7 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -4250,7 +4250,7 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -4270,7 +4270,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -4293,7 +4293,7 @@ async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -4306,7 +4306,7 @@ async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -4322,11 +4322,11 @@ async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @@ -4339,11 +4339,11 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -4453,11 +4453,11 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncCloudfla target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -4474,11 +4474,11 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -4498,11 +4498,11 @@ async def test_path_params_create_overload_10(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="", ) @@ -4512,11 +4512,11 @@ async def test_path_params_create_overload_10(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -4839,7 +4839,7 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -4850,7 +4850,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -4958,7 +4958,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -4973,7 +4973,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -4991,7 +4991,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -4999,7 +4999,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="", ) @@ -5007,7 +5007,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="ssh", + type="self_hosted", account_id="account_id", ) @@ -5017,7 +5017,7 @@ async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -5028,7 +5028,7 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -5136,7 +5136,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflar response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -5151,7 +5151,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -5169,7 +5169,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -5177,7 +5177,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="", ) @@ -5185,7 +5185,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", - type="vnc", + type="self_hosted", account_id="account_id", ) @@ -5194,7 +5194,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -5204,7 +5204,7 @@ async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> async def test_method_update_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -5265,7 +5265,7 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -5279,7 +5279,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflar async def test_streaming_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -5296,21 +5296,21 @@ async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="app_launcher", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="app_launcher", + type="self_hosted", account_id="account_id", ) @@ -5319,7 +5319,7 @@ async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -5329,7 +5329,7 @@ async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> async def test_method_update_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -5390,7 +5390,7 @@ async def test_method_update_with_all_params_overload_6(self, async_client: Asyn async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) @@ -5404,7 +5404,7 @@ async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflar async def test_streaming_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -5421,21 +5421,21 @@ async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="warp", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="warp", + type="self_hosted", account_id="account_id", ) @@ -5444,7 +5444,7 @@ async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -5454,7 +5454,7 @@ async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> async def test_method_update_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -5515,7 +5515,7 @@ async def test_method_update_with_all_params_overload_7(self, async_client: Asyn async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) @@ -5529,7 +5529,7 @@ async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflar async def test_streaming_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -5546,21 +5546,21 @@ async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="biso", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="biso", + type="self_hosted", account_id="account_id", ) @@ -5670,7 +5670,7 @@ async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5687,7 +5687,7 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5720,7 +5720,7 @@ async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5741,7 +5741,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5765,7 +5765,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5779,7 +5779,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5793,7 +5793,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], @@ -5810,11 +5810,11 @@ async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @@ -5828,11 +5828,11 @@ async def test_method_update_with_all_params_overload_10(self, async_client: Asy target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", allow_authenticate_via_warp=True, allow_iframe=True, @@ -5943,11 +5943,11 @@ async def test_raw_response_update_overload_10(self, async_client: AsyncCloudfla target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -5965,11 +5965,11 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -5990,11 +5990,11 @@ async def test_path_params_update_overload_10(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) @@ -6005,11 +6005,11 @@ async def test_path_params_update_overload_10(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="", ) @@ -6020,11 +6020,11 @@ async def test_path_params_update_overload_10(self, async_client: AsyncCloudflar target_criteria=[ { "port": 22, - "protocol": "ssh", + "protocol": "SSH", "target_attributes": {"hostname": ["test-server", "production-server"]}, } ], - type="rdp", + type="self_hosted", account_id="account_id", ) diff --git a/tests/api_resources/zero_trust/access/test_bookmarks.py b/tests/api_resources/zero_trust/access/test_bookmarks.py index 2e04d6c5af3..c181fbba11f 100644 --- a/tests/api_resources/zero_trust/access/test_bookmarks.py +++ b/tests/api_resources/zero_trust/access/test_bookmarks.py @@ -15,6 +15,8 @@ BookmarkDeleteResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,20 +25,23 @@ class TestBookmarks: @parametrize def test_method_create(self, client: Cloudflare) -> None: - bookmark = client.zero_trust.access.bookmarks.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) + with pytest.warns(DeprecationWarning): + bookmark = client.zero_trust.access.bookmarks.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.access.bookmarks.with_raw_response.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.access.bookmarks.with_raw_response.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -45,51 +50,56 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.access.bookmarks.with_streaming_response.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.access.bookmarks.with_streaming_response.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = response.parse() - assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) + bookmark = response.parse() + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + body={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.create( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.create( - bookmark_id="", + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + bookmark = client.zero_trust.access.bookmarks.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", body={}, ) - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - bookmark = client.zero_trust.access.bookmarks.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zero_trust.access.bookmarks.with_raw_response.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.access.bookmarks.with_raw_response.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,47 +108,52 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zero_trust.access.bookmarks.with_streaming_response.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.access.bookmarks.with_streaming_response.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = response.parse() - assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) + bookmark = response.parse() + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + body={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.update( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.update( - bookmark_id="", + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + bookmark = client.zero_trust.access.bookmarks.list( account_id="699d98642c564d2e855e9661899b7252", - body={}, ) - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - bookmark = client.zero_trust.access.bookmarks.list( - account_id="699d98642c564d2e855e9661899b7252", - ) assert_matches_type(SyncSinglePage[Bookmark], bookmark, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.access.bookmarks.with_raw_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.access.bookmarks.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -147,38 +162,43 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.access.bookmarks.with_streaming_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.access.bookmarks.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = response.parse() - assert_matches_type(SyncSinglePage[Bookmark], bookmark, path=["response"]) + bookmark = response.parse() + assert_matches_type(SyncSinglePage[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.list( + account_id="", + ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: - bookmark = client.zero_trust.access.bookmarks.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + bookmark = client.zero_trust.access.bookmarks.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[BookmarkDeleteResponse], bookmark, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.access.bookmarks.with_raw_response.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.access.bookmarks.with_raw_response.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,46 +207,51 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.access.bookmarks.with_streaming_response.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.access.bookmarks.with_streaming_response.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = response.parse() - assert_matches_type(Optional[BookmarkDeleteResponse], bookmark, path=["response"]) + bookmark = response.parse() + assert_matches_type(Optional[BookmarkDeleteResponse], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.delete( - bookmark_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.delete( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - bookmark = client.zero_trust.access.bookmarks.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + bookmark = client.zero_trust.access.bookmarks.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.access.bookmarks.with_raw_response.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.access.bookmarks.with_raw_response.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -235,31 +260,33 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.access.bookmarks.with_streaming_response.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.access.bookmarks.with_streaming_response.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = response.parse() - assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) + bookmark = response.parse() + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - client.zero_trust.access.bookmarks.with_raw_response.get( - bookmark_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + client.zero_trust.access.bookmarks.with_raw_response.get( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) class TestAsyncBookmarks: @@ -267,20 +294,23 @@ class TestAsyncBookmarks: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - bookmark = await async_client.zero_trust.access.bookmarks.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) + with pytest.warns(DeprecationWarning): + bookmark = await async_client.zero_trust.access.bookmarks.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.bookmarks.with_raw_response.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.access.bookmarks.with_raw_response.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,51 +319,56 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.bookmarks.with_streaming_response.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.access.bookmarks.with_streaming_response.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = await response.parse() - assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) + bookmark = await response.parse() + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.create( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.create( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + body={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.create( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.create( - bookmark_id="", + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + bookmark = await async_client.zero_trust.access.bookmarks.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", body={}, ) - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - bookmark = await async_client.zero_trust.access.bookmarks.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.bookmarks.with_raw_response.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.access.bookmarks.with_raw_response.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -342,47 +377,52 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.bookmarks.with_streaming_response.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.access.bookmarks.with_streaming_response.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = await response.parse() - assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) + bookmark = await response.parse() + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.update( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - body={}, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.update( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + body={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.update( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + body={}, + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.update( - bookmark_id="", + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + bookmark = await async_client.zero_trust.access.bookmarks.list( account_id="699d98642c564d2e855e9661899b7252", - body={}, ) - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - bookmark = await async_client.zero_trust.access.bookmarks.list( - account_id="699d98642c564d2e855e9661899b7252", - ) assert_matches_type(AsyncSinglePage[Bookmark], bookmark, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.bookmarks.with_raw_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.access.bookmarks.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -391,38 +431,43 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.bookmarks.with_streaming_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.access.bookmarks.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = await response.parse() - assert_matches_type(AsyncSinglePage[Bookmark], bookmark, path=["response"]) + bookmark = await response.parse() + assert_matches_type(AsyncSinglePage[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.list( + account_id="", + ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - bookmark = await async_client.zero_trust.access.bookmarks.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + bookmark = await async_client.zero_trust.access.bookmarks.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[BookmarkDeleteResponse], bookmark, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.bookmarks.with_raw_response.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.access.bookmarks.with_raw_response.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -431,46 +476,51 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.bookmarks.with_streaming_response.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.access.bookmarks.with_streaming_response.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = await response.parse() - assert_matches_type(Optional[BookmarkDeleteResponse], bookmark, path=["response"]) + bookmark = await response.parse() + assert_matches_type(Optional[BookmarkDeleteResponse], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.delete( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.delete( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.delete( - bookmark_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.delete( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - bookmark = await async_client.zero_trust.access.bookmarks.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + bookmark = await async_client.zero_trust.access.bookmarks.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.bookmarks.with_raw_response.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.access.bookmarks.with_raw_response.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -479,28 +529,30 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.bookmarks.with_streaming_response.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.access.bookmarks.with_streaming_response.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookmark = await response.parse() - assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) + bookmark = await response.parse() + assert_matches_type(Optional[Bookmark], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.get( - bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): - await async_client.zero_trust.access.bookmarks.with_raw_response.get( - bookmark_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.get( + bookmark_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookmark_id` but received ''"): + await async_client.zero_trust.access.bookmarks.with_raw_response.get( + bookmark_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) diff --git a/tests/api_resources/zero_trust/devices/test_dex_tests.py b/tests/api_resources/zero_trust/devices/test_dex_tests.py new file mode 100644 index 00000000000..7198475bd23 --- /dev/null +++ b/tests/api_resources/zero_trust/devices/test_dex_tests.py @@ -0,0 +1,639 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import ( + DEXTestGetResponse, + DEXTestListResponse, + DEXTestCreateResponse, + DEXTestDeleteResponse, + DEXTestUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDEXTests: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={ + "host": "https://dash.cloudflare.com", + "kind": "http", + "method": "GET", + }, + enabled=True, + interval="30m", + name="HTTP dash health check", + description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "id": "id", + "default": True, + "name": "name", + } + ], + targeted=True, + ) + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.dex_tests.with_raw_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = response.parse() + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.devices.dex_tests.with_streaming_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = response.parse() + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.create( + account_id="", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={ + "host": "https://dash.cloudflare.com", + "kind": "http", + "method": "GET", + }, + enabled=True, + interval="30m", + name="HTTP dash health check", + description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "id": "id", + "default": True, + "name": "name", + } + ], + targeted=True, + ) + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.dex_tests.with_raw_response.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = response.parse() + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.devices.dex_tests.with_streaming_response.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = response.parse() + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dex_test_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.update( + dex_test_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(SyncSinglePage[DEXTestListResponse], dex_test, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.dex_tests.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = response.parse() + assert_matches_type(SyncSinglePage[DEXTestListResponse], dex_test, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.devices.dex_tests.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = response.parse() + assert_matches_type(SyncSinglePage[DEXTestListResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[DEXTestDeleteResponse], dex_test, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.dex_tests.with_raw_response.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = response.parse() + assert_matches_type(Optional[DEXTestDeleteResponse], dex_test, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.devices.dex_tests.with_streaming_response.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = response.parse() + assert_matches_type(Optional[DEXTestDeleteResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dex_test_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.delete( + dex_test_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + dex_test = client.zero_trust.devices.dex_tests.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[DEXTestGetResponse], dex_test, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.dex_tests.with_raw_response.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = response.parse() + assert_matches_type(Optional[DEXTestGetResponse], dex_test, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.devices.dex_tests.with_streaming_response.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = response.parse() + assert_matches_type(Optional[DEXTestGetResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dex_test_id` but received ''"): + client.zero_trust.devices.dex_tests.with_raw_response.get( + dex_test_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + +class TestAsyncDEXTests: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={ + "host": "https://dash.cloudflare.com", + "kind": "http", + "method": "GET", + }, + enabled=True, + interval="30m", + name="HTTP dash health check", + description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "id": "id", + "default": True, + "name": "name", + } + ], + targeted=True, + ) + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.dex_tests.with_raw_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.dex_tests.with_streaming_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestCreateResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.create( + account_id="", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={ + "host": "https://dash.cloudflare.com", + "kind": "http", + "method": "GET", + }, + enabled=True, + interval="30m", + name="HTTP dash health check", + description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "id": "id", + "default": True, + "name": "name", + } + ], + targeted=True, + ) + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.dex_tests.with_raw_response.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.dex_tests.with_streaming_response.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestUpdateResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.update( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dex_test_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.update( + dex_test_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + data={}, + enabled=True, + interval="30m", + name="HTTP dash health check", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(AsyncSinglePage[DEXTestListResponse], dex_test, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.dex_tests.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = await response.parse() + assert_matches_type(AsyncSinglePage[DEXTestListResponse], dex_test, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.dex_tests.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = await response.parse() + assert_matches_type(AsyncSinglePage[DEXTestListResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[DEXTestDeleteResponse], dex_test, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.dex_tests.with_raw_response.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestDeleteResponse], dex_test, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.dex_tests.with_streaming_response.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestDeleteResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.delete( + dex_test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dex_test_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.delete( + dex_test_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + dex_test = await async_client.zero_trust.devices.dex_tests.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[DEXTestGetResponse], dex_test, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.dex_tests.with_raw_response.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestGetResponse], dex_test, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.dex_tests.with_streaming_response.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dex_test = await response.parse() + assert_matches_type(Optional[DEXTestGetResponse], dex_test, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.get( + dex_test_id="372e67954025e0ba6aaa6d586b9e0b59", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dex_test_id` but received ''"): + await async_client.zero_trust.devices.dex_tests.with_raw_response.get( + dex_test_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) diff --git a/tests/api_resources/zero_trust/devices/test_override_codes.py b/tests/api_resources/zero_trust/devices/test_override_codes.py index 2aeb94178ae..d3d41b67877 100644 --- a/tests/api_resources/zero_trust/devices/test_override_codes.py +++ b/tests/api_resources/zero_trust/devices/test_override_codes.py @@ -12,6 +12,8 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices import OverrideCodeGetResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,19 +23,22 @@ class TestOverrideCodes: @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize def test_method_list(self, client: Cloudflare) -> None: - override_code = client.zero_trust.devices.override_codes.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + override_code = client.zero_trust.devices.override_codes.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(SyncSinglePage[object], override_code, path=["response"]) @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.devices.override_codes.with_raw_response.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.devices.override_codes.with_raw_response.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -43,32 +48,34 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.devices.override_codes.with_streaming_response.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.devices.override_codes.with_streaming_response.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override_code = response.parse() - assert_matches_type(SyncSinglePage[object], override_code, path=["response"]) + override_code = response.parse() + assert_matches_type(SyncSinglePage[object], override_code, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.devices.override_codes.with_raw_response.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.override_codes.with_raw_response.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): - client.zero_trust.devices.override_codes.with_raw_response.list( - device_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): + client.zero_trust.devices.override_codes.with_raw_response.list( + device_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize @@ -129,19 +136,22 @@ class TestAsyncOverrideCodes: @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - override_code = await async_client.zero_trust.devices.override_codes.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + override_code = await async_client.zero_trust.devices.override_codes.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(AsyncSinglePage[object], override_code, path=["response"]) @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.devices.override_codes.with_raw_response.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.devices.override_codes.with_raw_response.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -151,32 +161,34 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.devices.override_codes.with_streaming_response.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.devices.override_codes.with_streaming_response.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - override_code = await response.parse() - assert_matches_type(AsyncSinglePage[object], override_code, path=["response"]) + override_code = await response.parse() + assert_matches_type(AsyncSinglePage[object], override_code, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.devices.override_codes.with_raw_response.list( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): - await async_client.zero_trust.devices.override_codes.with_raw_response.list( - device_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.override_codes.with_raw_response.list( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): + await async_client.zero_trust.devices.override_codes.with_raw_response.list( + device_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) @pytest.mark.skip(reason="TODO: investigate prism error for invalid security scheme used") @parametrize diff --git a/tests/api_resources/zero_trust/devices/test_revoke.py b/tests/api_resources/zero_trust/devices/test_revoke.py index d093db0d2e7..df8b21c996e 100644 --- a/tests/api_resources/zero_trust/devices/test_revoke.py +++ b/tests/api_resources/zero_trust/devices/test_revoke.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.zero_trust.devices import RevokeCreateResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,18 +21,21 @@ class TestRevoke: @parametrize def test_method_create(self, client: Cloudflare) -> None: - revoke = client.zero_trust.devices.revoke.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + revoke = client.zero_trust.devices.revoke.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.devices.revoke.with_raw_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.devices.revoke.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -39,25 +44,27 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.devices.revoke.with_streaming_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.devices.revoke.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - revoke = response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + revoke = response.parse() + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.devices.revoke.with_raw_response.create( - account_id="", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.revoke.with_raw_response.create( + account_id="", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) class TestAsyncRevoke: @@ -65,18 +72,21 @@ class TestAsyncRevoke: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - revoke = await async_client.zero_trust.devices.revoke.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + revoke = await async_client.zero_trust.devices.revoke.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.devices.revoke.with_raw_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.devices.revoke.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,22 +95,24 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.devices.revoke.with_streaming_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.devices.revoke.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - revoke = await response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + revoke = await response.parse() + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.devices.revoke.with_raw_response.create( - account_id="", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.revoke.with_raw_response.create( + account_id="", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) diff --git a/tests/api_resources/zero_trust/devices/test_settings.py b/tests/api_resources/zero_trust/devices/test_settings.py index 699fb7c307f..194a95ad61f 100644 --- a/tests/api_resources/zero_trust/devices/test_settings.py +++ b/tests/api_resources/zero_trust/devices/test_settings.py @@ -67,6 +67,44 @@ def test_path_params_update(self, client: Cloudflare) -> None: account_id="", ) + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + setting = client.zero_trust.devices.settings.delete( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.settings.with_raw_response.delete( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.devices.settings.with_streaming_response.delete( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.settings.with_raw_response.delete( + account_id="", + ) + @parametrize def test_method_edit(self, client: Cloudflare) -> None: setting = client.zero_trust.devices.settings.edit( @@ -209,6 +247,44 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: account_id="", ) + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zero_trust.devices.settings.delete( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.settings.with_raw_response.delete( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.settings.with_streaming_response.delete( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.settings.with_raw_response.delete( + account_id="", + ) + @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zero_trust.devices.settings.edit( diff --git a/tests/api_resources/zero_trust/devices/test_unrevoke.py b/tests/api_resources/zero_trust/devices/test_unrevoke.py index 9196cb931f8..4155a91a1c4 100644 --- a/tests/api_resources/zero_trust/devices/test_unrevoke.py +++ b/tests/api_resources/zero_trust/devices/test_unrevoke.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.zero_trust.devices import UnrevokeCreateResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,18 +21,21 @@ class TestUnrevoke: @parametrize def test_method_create(self, client: Cloudflare) -> None: - unrevoke = client.zero_trust.devices.unrevoke.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + unrevoke = client.zero_trust.devices.unrevoke.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.devices.unrevoke.with_raw_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.devices.unrevoke.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -39,25 +44,27 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.devices.unrevoke.with_streaming_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.devices.unrevoke.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - unrevoke = response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + unrevoke = response.parse() + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.devices.unrevoke.with_raw_response.create( - account_id="", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.unrevoke.with_raw_response.create( + account_id="", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) class TestAsyncUnrevoke: @@ -65,18 +72,21 @@ class TestAsyncUnrevoke: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - unrevoke = await async_client.zero_trust.devices.unrevoke.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + unrevoke = await async_client.zero_trust.devices.unrevoke.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.devices.unrevoke.with_raw_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.devices.unrevoke.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,22 +95,24 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.devices.unrevoke.with_streaming_response.create( - account_id="699d98642c564d2e855e9661899b7252", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.devices.unrevoke.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - unrevoke = await response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + unrevoke = await response.parse() + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.devices.unrevoke.with_raw_response.create( - account_id="", - body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.unrevoke.with_raw_response.create( + account_id="", + body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], + ) diff --git a/tests/api_resources/zero_trust/dex/test_warp_change_events.py b/tests/api_resources/zero_trust/dex/test_warp_change_events.py new file mode 100644 index 00000000000..402089c3dc2 --- /dev/null +++ b/tests/api_resources/zero_trust/dex/test_warp_change_events.py @@ -0,0 +1,162 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zero_trust.dex import WARPChangeEventGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestWARPChangeEvents: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + warp_change_event = client.zero_trust.dex.warp_change_events.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + warp_change_event = client.zero_trust.dex.warp_change_events.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + account_name="Myorg", + config_name="MASQUE", + sort_order="ASC", + toggle="on", + type="config", + ) + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.warp_change_events.with_raw_response.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp_change_event = response.parse() + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.dex.warp_change_events.with_streaming_response.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp_change_event = response.parse() + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.warp_change_events.with_raw_response.get( + account_id="", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) + + +class TestAsyncWARPChangeEvents: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + warp_change_event = await async_client.zero_trust.dex.warp_change_events.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + warp_change_event = await async_client.zero_trust.dex.warp_change_events.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + account_name="Myorg", + config_name="MASQUE", + sort_order="ASC", + toggle="on", + type="config", + ) + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.warp_change_events.with_raw_response.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp_change_event = await response.parse() + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.warp_change_events.with_streaming_response.get( + account_id="01a7362d577a6c3019a474fd6f485823", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp_change_event = await response.parse() + assert_matches_type(Optional[WARPChangeEventGetResponse], warp_change_event, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.warp_change_events.with_raw_response.get( + account_id="", + from_="2023-09-20T17:00:00Z", + page=1, + per_page=1, + to="2023-09-20T17:00:00Z", + ) diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py index 36b3ddbb2a1..b2c3d4b3c8c 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py @@ -10,7 +10,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust.dlp import Profile -from cloudflare.types.zero_trust.dlp.profiles import CustomCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,93 +18,7 @@ class TestCustom: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create_overload_1(self, client: Cloudflare) -> None: - custom = client.zero_trust.dlp.profiles.custom.create( - account_id="account_id", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) - - @parametrize - def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.profiles.custom.with_raw_response.create( - account_id="account_id", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom = response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.profiles.custom.with_streaming_response.create( - account_id="account_id", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - custom = response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.profiles.custom.with_raw_response.create( - account_id="", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) - - @parametrize - def test_method_create_overload_2(self, client: Cloudflare) -> None: + def test_method_create(self, client: Cloudflare) -> None: custom = client.zero_trust.dlp.profiles.custom.create( account_id="account_id", entries=[ @@ -117,10 +30,10 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: ], name="name", ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: + def test_method_create_with_all_params(self, client: Cloudflare) -> None: custom = client.zero_trust.dlp.profiles.custom.create( account_id="account_id", entries=[ @@ -151,10 +64,10 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N } ], ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize - def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.profiles.custom.with_raw_response.create( account_id="account_id", entries=[ @@ -170,10 +83,10 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize - def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.dlp.profiles.custom.with_streaming_response.create( account_id="account_id", entries=[ @@ -189,12 +102,12 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.zero_trust.dlp.profiles.custom.with_raw_response.create( account_id="", @@ -398,93 +311,7 @@ class TestAsyncCustom: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: - custom = await async_client.zero_trust.dlp.profiles.custom.create( - account_id="account_id", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.profiles.custom.with_raw_response.create( - account_id="account_id", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom = await response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.profiles.custom.with_streaming_response.create( - account_id="account_id", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - custom = await response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.profiles.custom.with_raw_response.create( - account_id="", - profiles=[ - { - "entries": [ - { - "enabled": True, - "name": "name", - "pattern": {"regex": "regex"}, - } - ], - "name": "name", - } - ], - ) - - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_method_create(self, async_client: AsyncCloudflare) -> None: custom = await async_client.zero_trust.dlp.profiles.custom.create( account_id="account_id", entries=[ @@ -496,10 +323,10 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> ], name="name", ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: custom = await async_client.zero_trust.dlp.profiles.custom.create( account_id="account_id", entries=[ @@ -530,10 +357,10 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn } ], ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.profiles.custom.with_raw_response.create( account_id="account_id", entries=[ @@ -549,10 +376,10 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.profiles.custom.with_streaming_response.create( account_id="account_id", entries=[ @@ -568,12 +395,12 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.zero_trust.dlp.profiles.custom.with_raw_response.create( account_id="", diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py b/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py index 41cc3323d37..3b8f9b5b28d 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py @@ -22,12 +22,6 @@ def test_method_update(self, client: Cloudflare) -> None: predefined = client.zero_trust.dlp.profiles.predefined.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) assert_matches_type(Optional[Profile], predefined, path=["response"]) @@ -36,12 +30,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: predefined = client.zero_trust.dlp.profiles.predefined.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ai_context_enabled=True, allowed_match_count=0, confidence_threshold="confidence_threshold", @@ -49,6 +37,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "enabled": True, "skip": {"files": True}, }, + entries=[ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "enabled": True, + } + ], ocr_enabled=True, ) assert_matches_type(Optional[Profile], predefined, path=["response"]) @@ -58,12 +52,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.profiles.predefined.with_raw_response.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) assert response.is_closed is True @@ -76,12 +64,6 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.zero_trust.dlp.profiles.predefined.with_streaming_response.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -97,24 +79,12 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.zero_trust.dlp.profiles.predefined.with_raw_response.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): client.zero_trust.dlp.profiles.predefined.with_raw_response.update( profile_id="", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) @parametrize @@ -174,12 +144,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: predefined = await async_client.zero_trust.dlp.profiles.predefined.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) assert_matches_type(Optional[Profile], predefined, path=["response"]) @@ -188,12 +152,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare predefined = await async_client.zero_trust.dlp.profiles.predefined.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ai_context_enabled=True, allowed_match_count=0, confidence_threshold="confidence_threshold", @@ -201,6 +159,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "enabled": True, "skip": {"files": True}, }, + entries=[ + { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "enabled": True, + } + ], ocr_enabled=True, ) assert_matches_type(Optional[Profile], predefined, path=["response"]) @@ -210,12 +174,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.profiles.predefined.with_raw_response.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) assert response.is_closed is True @@ -228,12 +186,6 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.zero_trust.dlp.profiles.predefined.with_streaming_response.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -249,24 +201,12 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.zero_trust.dlp.profiles.predefined.with_raw_response.update( profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): await async_client.zero_trust.dlp.profiles.predefined.with_raw_response.update( profile_id="", account_id="account_id", - entries=[ - { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "enabled": True, - } - ], ) @parametrize diff --git a/tests/api_resources/zero_trust/gateway/configurations/test_custom_certificate.py b/tests/api_resources/zero_trust/gateway/configurations/test_custom_certificate.py index 84c0ea6fd30..b5a8ec58cd0 100644 --- a/tests/api_resources/zero_trust/gateway/configurations/test_custom_certificate.py +++ b/tests/api_resources/zero_trust/gateway/configurations/test_custom_certificate.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.zero_trust.gateway import CustomCertificateSettings +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,16 +21,19 @@ class TestCustomCertificate: @parametrize def test_method_get(self, client: Cloudflare) -> None: - custom_certificate = client.zero_trust.gateway.configurations.custom_certificate.get( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + custom_certificate = client.zero_trust.gateway.configurations.custom_certificate.get( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[CustomCertificateSettings], custom_certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -37,23 +42,25 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.gateway.configurations.custom_certificate.with_streaming_response.get( - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.gateway.configurations.custom_certificate.with_streaming_response.get( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_certificate = response.parse() - assert_matches_type(Optional[CustomCertificateSettings], custom_certificate, path=["response"]) + custom_certificate = response.parse() + assert_matches_type(Optional[CustomCertificateSettings], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( + account_id="", + ) class TestAsyncCustomCertificate: @@ -61,16 +68,19 @@ class TestAsyncCustomCertificate: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - custom_certificate = await async_client.zero_trust.gateway.configurations.custom_certificate.get( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + custom_certificate = await async_client.zero_trust.gateway.configurations.custom_certificate.get( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[CustomCertificateSettings], custom_certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -79,20 +89,22 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.gateway.configurations.custom_certificate.with_streaming_response.get( - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.gateway.configurations.custom_certificate.with_streaming_response.get( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_certificate = await response.parse() - assert_matches_type(Optional[CustomCertificateSettings], custom_certificate, path=["response"]) + custom_certificate = await response.parse() + assert_matches_type(Optional[CustomCertificateSettings], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.gateway.configurations.custom_certificate.with_raw_response.get( + account_id="", + ) diff --git a/tests/api_resources/zero_trust/gateway/test_configurations.py b/tests/api_resources/zero_trust/gateway/test_configurations.py index 207ab988ace..9368b1e530d 100644 --- a/tests/api_resources/zero_trust/gateway/test_configurations.py +++ b/tests/api_resources/zero_trust/gateway/test_configurations.py @@ -45,6 +45,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "support_url": "support_url", }, }, + "app_control_settings": {"enabled": False}, "block_page": { "background_color": "background_color", "enabled": True, @@ -137,6 +138,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "support_url": "support_url", }, }, + "app_control_settings": {"enabled": False}, "block_page": { "background_color": "background_color", "enabled": True, @@ -271,6 +273,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "support_url": "support_url", }, }, + "app_control_settings": {"enabled": False}, "block_page": { "background_color": "background_color", "enabled": True, @@ -363,6 +366,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "support_url": "support_url", }, }, + "app_control_settings": {"enabled": False}, "block_page": { "background_color": "background_color", "enabled": True, diff --git a/tests/api_resources/zero_trust/networks/routes/test_networks.py b/tests/api_resources/zero_trust/networks/routes/test_networks.py index 5f9fb16ca2d..ce1e6053a32 100644 --- a/tests/api_resources/zero_trust/networks/routes/test_networks.py +++ b/tests/api_resources/zero_trust/networks/routes/test_networks.py @@ -11,6 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.types.zero_trust.networks import Route +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,31 +21,36 @@ class TestNetworks: @parametrize def test_method_create(self, client: Cloudflare) -> None: - network = client.zero_trust.networks.routes.networks.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + network = client.zero_trust.networks.routes.networks.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Route, network, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: - network = client.zero_trust.networks.routes.networks.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - comment="Example comment for this route.", - virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + network = client.zero_trust.networks.routes.networks.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + comment="Example comment for this route.", + virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Route, network, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.networks.routes.networks.with_raw_response.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.networks.routes.networks.with_raw_response.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,60 +59,69 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.networks.routes.networks.with_streaming_response.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.networks.routes.networks.with_streaming_response.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - network = response.parse() - assert_matches_type(Route, network, path=["response"]) + network = response.parse() + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.networks.routes.networks.with_raw_response.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.routes.networks.with_raw_response.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''" + ): + client.zero_trust.networks.routes.networks.with_raw_response.create( + ip_network_encoded="", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - client.zero_trust.networks.routes.networks.with_raw_response.create( - ip_network_encoded="", + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + network = client.zero_trust.networks.routes.networks.delete( + ip_network_encoded="172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - network = client.zero_trust.networks.routes.networks.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) assert_matches_type(Route, network, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Cloudflare) -> None: - network = client.zero_trust.networks.routes.networks.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tun_type="cfd_tunnel", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + network = client.zero_trust.networks.routes.networks.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tun_type="cfd_tunnel", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Route, network, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.networks.routes.networks.with_raw_response.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.networks.routes.networks.with_raw_response.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,46 +130,53 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.networks.routes.networks.with_streaming_response.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.networks.routes.networks.with_streaming_response.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - network = response.parse() - assert_matches_type(Route, network, path=["response"]) + network = response.parse() + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.networks.routes.networks.with_raw_response.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.routes.networks.with_raw_response.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''" + ): + client.zero_trust.networks.routes.networks.with_raw_response.delete( + ip_network_encoded="", + account_id="699d98642c564d2e855e9661899b7252", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - client.zero_trust.networks.routes.networks.with_raw_response.delete( - ip_network_encoded="", + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + with pytest.warns(DeprecationWarning): + network = client.zero_trust.networks.routes.networks.edit( + ip_network_encoded="172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - network = client.zero_trust.networks.routes.networks.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) assert_matches_type(Route, network, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.zero_trust.networks.routes.networks.with_raw_response.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.networks.routes.networks.with_raw_response.edit( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -162,31 +185,35 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.zero_trust.networks.routes.networks.with_streaming_response.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.networks.routes.networks.with_streaming_response.edit( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - network = response.parse() - assert_matches_type(Route, network, path=["response"]) + network = response.parse() + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.networks.routes.networks.with_raw_response.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - client.zero_trust.networks.routes.networks.with_raw_response.edit( - ip_network_encoded="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.routes.networks.with_raw_response.edit( + ip_network_encoded="172.16.0.0%2F16", + account_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''" + ): + client.zero_trust.networks.routes.networks.with_raw_response.edit( + ip_network_encoded="", + account_id="699d98642c564d2e855e9661899b7252", + ) class TestAsyncNetworks: @@ -194,31 +221,36 @@ class TestAsyncNetworks: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - network = await async_client.zero_trust.networks.routes.networks.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + network = await async_client.zero_trust.networks.routes.networks.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Route, network, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - network = await async_client.zero_trust.networks.routes.networks.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - comment="Example comment for this route.", - virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + network = await async_client.zero_trust.networks.routes.networks.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + comment="Example comment for this route.", + virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Route, network, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.networks.routes.networks.with_raw_response.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.networks.routes.networks.with_raw_response.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -227,60 +259,69 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.networks.routes.networks.with_streaming_response.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.networks.routes.networks.with_streaming_response.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - network = await response.parse() - assert_matches_type(Route, network, path=["response"]) + network = await response.parse() + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.networks.routes.networks.with_raw_response.create( - ip_network_encoded="172.16.0.0%2F16", - account_id="", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.routes.networks.with_raw_response.create( + ip_network_encoded="172.16.0.0%2F16", + account_id="", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''" + ): + await async_client.zero_trust.networks.routes.networks.with_raw_response.create( + ip_network_encoded="", + account_id="699d98642c564d2e855e9661899b7252", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - await async_client.zero_trust.networks.routes.networks.with_raw_response.create( - ip_network_encoded="", + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + network = await async_client.zero_trust.networks.routes.networks.delete( + ip_network_encoded="172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - network = await async_client.zero_trust.networks.routes.networks.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) assert_matches_type(Route, network, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: - network = await async_client.zero_trust.networks.routes.networks.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - tun_type="cfd_tunnel", - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - ) + with pytest.warns(DeprecationWarning): + network = await async_client.zero_trust.networks.routes.networks.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + tun_type="cfd_tunnel", + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Route, network, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.networks.routes.networks.with_raw_response.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.networks.routes.networks.with_raw_response.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,46 +330,53 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.networks.routes.networks.with_streaming_response.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.networks.routes.networks.with_streaming_response.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - network = await response.parse() - assert_matches_type(Route, network, path=["response"]) + network = await response.parse() + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.networks.routes.networks.with_raw_response.delete( - ip_network_encoded="172.16.0.0%2F16", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.routes.networks.with_raw_response.delete( + ip_network_encoded="172.16.0.0%2F16", + account_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''" + ): + await async_client.zero_trust.networks.routes.networks.with_raw_response.delete( + ip_network_encoded="", + account_id="699d98642c564d2e855e9661899b7252", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - await async_client.zero_trust.networks.routes.networks.with_raw_response.delete( - ip_network_encoded="", + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.warns(DeprecationWarning): + network = await async_client.zero_trust.networks.routes.networks.edit( + ip_network_encoded="172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - network = await async_client.zero_trust.networks.routes.networks.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) assert_matches_type(Route, network, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.networks.routes.networks.with_raw_response.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.networks.routes.networks.with_raw_response.edit( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -337,28 +385,32 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.networks.routes.networks.with_streaming_response.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.networks.routes.networks.with_streaming_response.edit( + ip_network_encoded="172.16.0.0%2F16", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - network = await response.parse() - assert_matches_type(Route, network, path=["response"]) + network = await response.parse() + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.networks.routes.networks.with_raw_response.edit( - ip_network_encoded="172.16.0.0%2F16", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - await async_client.zero_trust.networks.routes.networks.with_raw_response.edit( - ip_network_encoded="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.routes.networks.with_raw_response.edit( + ip_network_encoded="172.16.0.0%2F16", + account_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''" + ): + await async_client.zero_trust.networks.routes.networks.with_raw_response.edit( + ip_network_encoded="", + account_id="699d98642c564d2e855e9661899b7252", + ) diff --git a/tests/api_resources/zero_trust/networks/test_virtual_networks.py b/tests/api_resources/zero_trust/networks/test_virtual_networks.py index 774feffe37c..b846dfe89ed 100644 --- a/tests/api_resources/zero_trust/networks/test_virtual_networks.py +++ b/tests/api_resources/zero_trust/networks/test_virtual_networks.py @@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="us-east-1-vpc", comment="Staging VPC for data science", is_default=True, + is_default_network=False, ) assert_matches_type(VirtualNetwork, virtual_network, path=["response"]) @@ -183,7 +184,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", comment="Staging VPC for data science", - is_default_network=True, + is_default_network=False, name="us-east-1-vpc", ) assert_matches_type(VirtualNetwork, virtual_network, path=["response"]) @@ -295,6 +296,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="us-east-1-vpc", comment="Staging VPC for data science", is_default=True, + is_default_network=False, ) assert_matches_type(VirtualNetwork, virtual_network, path=["response"]) @@ -443,7 +445,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", comment="Staging VPC for data science", - is_default_network=True, + is_default_network=False, name="us-east-1-vpc", ) assert_matches_type(VirtualNetwork, virtual_network, path=["response"]) diff --git a/tests/api_resources/zero_trust/test_devices.py b/tests/api_resources/zero_trust/test_devices.py index e806fd8d30e..b6548ab51ef 100644 --- a/tests/api_resources/zero_trust/test_devices.py +++ b/tests/api_resources/zero_trust/test_devices.py @@ -12,6 +12,8 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust import Device, DeviceGetResponse +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,16 +22,19 @@ class TestDevices: @parametrize def test_method_list(self, client: Cloudflare) -> None: - device = client.zero_trust.devices.list( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + device = client.zero_trust.devices.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(SyncSinglePage[Device], device, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.devices.with_raw_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.devices.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -38,38 +43,43 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.devices.with_streaming_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.devices.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - device = response.parse() - assert_matches_type(SyncSinglePage[Device], device, path=["response"]) + device = response.parse() + assert_matches_type(SyncSinglePage[Device], device, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.devices.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.with_raw_response.list( + account_id="", + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - device = client.zero_trust.devices.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + device = client.zero_trust.devices.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.devices.with_raw_response.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = client.zero_trust.devices.with_raw_response.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,31 +88,33 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.devices.with_streaming_response.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zero_trust.devices.with_streaming_response.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - device = response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + device = response.parse() + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.devices.with_raw_response.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.with_raw_response.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): - client.zero_trust.devices.with_raw_response.get( - device_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): + client.zero_trust.devices.with_raw_response.get( + device_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) class TestAsyncDevices: @@ -110,16 +122,19 @@ class TestAsyncDevices: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - device = await async_client.zero_trust.devices.list( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + device = await async_client.zero_trust.devices.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(AsyncSinglePage[Device], device, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.devices.with_raw_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.devices.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,38 +143,43 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.devices.with_streaming_response.list( - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.devices.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - device = await response.parse() - assert_matches_type(AsyncSinglePage[Device], device, path=["response"]) + device = await response.parse() + assert_matches_type(AsyncSinglePage[Device], device, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.devices.with_raw_response.list( - account_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.with_raw_response.list( + account_id="", + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - device = await async_client.zero_trust.devices.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + device = await async_client.zero_trust.devices.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.devices.with_raw_response.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zero_trust.devices.with_raw_response.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -168,28 +188,30 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.devices.with_streaming_response.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zero_trust.devices.with_streaming_response.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - device = await response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + device = await response.parse() + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.devices.with_raw_response.get( - device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): - await async_client.zero_trust.devices.with_raw_response.get( - device_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.with_raw_response.get( + device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"): + await async_client.zero_trust.devices.with_raw_response.get( + device_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) diff --git a/tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py b/tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py index afb71a13e67..2aa511ecfd1 100644 --- a/tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py @@ -41,22 +41,22 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "origin_request": { "access": { "aud_tag": ["string"], - "team_name": "teamName", - "required": True, + "team_name": "zero-trust-organization-name", + "required": False, }, "ca_pool": "caPool", - "connect_timeout": 0, + "connect_timeout": 10, "disable_chunked_encoding": True, "http2_origin": True, "http_host_header": "httpHostHeader", - "keep_alive_connections": 0, - "keep_alive_timeout": 0, - "no_happy_eyeballs": True, - "no_tls_verify": True, + "keep_alive_connections": 100, + "keep_alive_timeout": 90, + "no_happy_eyeballs": False, + "no_tls_verify": False, "origin_server_name": "originServerName", "proxy_type": "proxyType", - "tcp_keep_alive": 0, - "tls_timeout": 0, + "tcp_keep_alive": 30, + "tls_timeout": 10, }, "path": "subpath", } @@ -64,22 +64,22 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "origin_request": { "access": { "aud_tag": ["string"], - "team_name": "teamName", - "required": True, + "team_name": "zero-trust-organization-name", + "required": False, }, "ca_pool": "caPool", - "connect_timeout": 0, + "connect_timeout": 10, "disable_chunked_encoding": True, "http2_origin": True, "http_host_header": "httpHostHeader", - "keep_alive_connections": 0, - "keep_alive_timeout": 0, - "no_happy_eyeballs": True, - "no_tls_verify": True, + "keep_alive_connections": 100, + "keep_alive_timeout": 90, + "no_happy_eyeballs": False, + "no_tls_verify": False, "origin_server_name": "originServerName", "proxy_type": "proxyType", - "tcp_keep_alive": 0, - "tls_timeout": 0, + "tcp_keep_alive": 30, + "tls_timeout": 10, }, }, ) @@ -198,22 +198,22 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "origin_request": { "access": { "aud_tag": ["string"], - "team_name": "teamName", - "required": True, + "team_name": "zero-trust-organization-name", + "required": False, }, "ca_pool": "caPool", - "connect_timeout": 0, + "connect_timeout": 10, "disable_chunked_encoding": True, "http2_origin": True, "http_host_header": "httpHostHeader", - "keep_alive_connections": 0, - "keep_alive_timeout": 0, - "no_happy_eyeballs": True, - "no_tls_verify": True, + "keep_alive_connections": 100, + "keep_alive_timeout": 90, + "no_happy_eyeballs": False, + "no_tls_verify": False, "origin_server_name": "originServerName", "proxy_type": "proxyType", - "tcp_keep_alive": 0, - "tls_timeout": 0, + "tcp_keep_alive": 30, + "tls_timeout": 10, }, "path": "subpath", } @@ -221,22 +221,22 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "origin_request": { "access": { "aud_tag": ["string"], - "team_name": "teamName", - "required": True, + "team_name": "zero-trust-organization-name", + "required": False, }, "ca_pool": "caPool", - "connect_timeout": 0, + "connect_timeout": 10, "disable_chunked_encoding": True, "http2_origin": True, "http_host_header": "httpHostHeader", - "keep_alive_connections": 0, - "keep_alive_timeout": 0, - "no_happy_eyeballs": True, - "no_tls_verify": True, + "keep_alive_connections": 100, + "keep_alive_timeout": 90, + "no_happy_eyeballs": False, + "no_tls_verify": False, "origin_server_name": "originServerName", "proxy_type": "proxyType", - "tcp_keep_alive": 0, - "tls_timeout": 0, + "tcp_keep_alive": 30, + "tls_timeout": 10, }, }, ) diff --git a/tests/api_resources/zones/test_subscriptions.py b/tests/api_resources/zones/test_subscriptions.py deleted file mode 100644 index e1d29a32d90..00000000000 --- a/tests/api_resources/zones/test_subscriptions.py +++ /dev/null @@ -1,322 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.zones import ( - SubscriptionGetResponse, - SubscriptionCreateResponse, - SubscriptionUpdateResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestSubscriptions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - subscription = client.zones.subscriptions.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - subscription = client.zones.subscriptions.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - frequency="monthly", - rate_plan={ - "id": "free", - "currency": "USD", - "externally_managed": False, - "is_contract": False, - "public_name": "Business Plan", - "scope": "zone", - "sets": ["string"], - }, - ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zones.subscriptions.with_raw_response.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zones.subscriptions.with_streaming_response.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.zones.subscriptions.with_raw_response.create( - identifier="", - ) - - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - subscription = client.zones.subscriptions.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - subscription = client.zones.subscriptions.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - frequency="monthly", - rate_plan={ - "id": "free", - "currency": "USD", - "externally_managed": False, - "is_contract": False, - "public_name": "Business Plan", - "scope": "zone", - "sets": ["string"], - }, - ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zones.subscriptions.with_raw_response.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zones.subscriptions.with_streaming_response.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.zones.subscriptions.with_raw_response.update( - identifier="", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - subscription = client.zones.subscriptions.get( - "506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zones.subscriptions.with_raw_response.get( - "506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zones.subscriptions.with_streaming_response.get( - "506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.zones.subscriptions.with_raw_response.get( - "", - ) - - -class TestAsyncSubscriptions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.zones.subscriptions.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.zones.subscriptions.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - frequency="monthly", - rate_plan={ - "id": "free", - "currency": "USD", - "externally_managed": False, - "is_contract": False, - "public_name": "Business Plan", - "scope": "zone", - "sets": ["string"], - }, - ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.subscriptions.with_raw_response.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.subscriptions.with_streaming_response.create( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.zones.subscriptions.with_raw_response.create( - identifier="", - ) - - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.zones.subscriptions.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.zones.subscriptions.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - frequency="monthly", - rate_plan={ - "id": "free", - "currency": "USD", - "externally_managed": False, - "is_contract": False, - "public_name": "Business Plan", - "scope": "zone", - "sets": ["string"], - }, - ) - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.subscriptions.with_raw_response.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = await response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.subscriptions.with_streaming_response.update( - identifier="506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = await response.parse() - assert_matches_type(SubscriptionUpdateResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.zones.subscriptions.with_raw_response.update( - identifier="", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.zones.subscriptions.get( - "506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.subscriptions.with_raw_response.get( - "506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = await response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.subscriptions.with_streaming_response.get( - "506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = await response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.zones.subscriptions.with_raw_response.get( - "", - ) diff --git a/tests/test_client.py b/tests/test_client.py index 3ded9ae39e4..71aea28019c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,6 +31,8 @@ DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + DefaultHttpxClient, + DefaultAsyncHttpxClient, make_request_options, ) from cloudflare.types.zones.zone_create_params import ZoneCreateParams @@ -1012,6 +1014,55 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" + class TestAsyncCloudflare: client = AsyncCloudflare(base_url=base_url, api_key=api_key, api_email=api_email, _strict_response_validation=True) @@ -1938,3 +1989,52 @@ async def test_main() -> None: raise AssertionError("calling get_platform using asyncify resulted in a hung process") time.sleep(0.1) + + async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultAsyncHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + async def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultAsyncHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + await self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"