From 55d436ce4364791b8f22c488553655512d42f4d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 07:31:14 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#1817) --- .stats.yml | 2 +- api.md | 60 ++++----- .../resources/argo/tiered_caching.py | 26 ++-- .../resources/cache/cache_reserve.py | 50 +++---- .../resources/cache/regional_tiered_cache.py | 30 ++--- .../resources/cache/smart_tiered_cache.py | 38 +++--- src/cloudflare/resources/cache/variants.py | 38 +++--- .../resources/hyperdrive/configs.py | 12 +- .../resources/kv/namespaces/bulk.py | 26 ++-- .../resources/kv/namespaces/namespaces.py | 26 ++-- .../resources/kv/namespaces/values.py | 26 ++-- .../origin_post_quantum_encryption.py | 122 +++++++++++------- .../pages/projects/deployments/deployments.py | 6 +- .../resources/pages/projects/domains.py | 4 +- .../resources/pages/projects/projects.py | 10 +- .../resources/vectorize/indexes/indexes.py | 12 +- .../resources/zero_trust/devices/devices.py | 14 +- .../devices/policies/certificates.py | 26 ++-- .../devices/posture/integrations.py | 12 +- .../resources/zero_trust/devices/revoke.py | 14 +- .../resources/zero_trust/devices/unrevoke.py | 14 +- .../accounts/subscription_create_response.py | 2 +- .../accounts/subscription_update_response.py | 2 +- .../types/argo/smart_routing_edit_response.py | 2 +- .../types/argo/smart_routing_get_response.py | 2 +- .../settings/domain_edit_response.py | 2 + .../settings/domain_list_response.py | 2 + .../firewall/access_rule_create_response.py | 2 +- .../firewall/access_rule_edit_response.py | 2 +- .../firewall/access_rule_get_response.py | 2 +- .../types/firewall/ua_rule_create_response.py | 2 +- .../types/firewall/ua_rule_get_response.py | 2 +- .../types/firewall/ua_rule_update_response.py | 2 +- .../firewall/waf/package_get_response.py | 2 +- .../waf/packages/group_edit_response.py | 2 +- .../waf/packages/group_get_response.py | 2 +- .../waf/packages/rule_get_response.py | 2 +- .../hyperdrive/config_delete_response.py | 4 +- .../images/v1/variant_delete_response.py | 4 +- .../types/images/v1_delete_response.py | 4 +- src/cloudflare/types/kv/__init__.py | 2 + .../types/kv/namespace_delete_response.py | 11 ++ .../types/kv/namespace_update_response.py | 11 ++ .../types/kv/namespaces/__init__.py | 4 + .../kv/namespaces/bulk_delete_response.py | 11 ++ .../kv/namespaces/bulk_update_response.py | 11 ++ .../kv/namespaces/value_delete_response.py | 11 ++ .../kv/namespaces/value_update_response.py | 11 ++ .../load_balancers/region_get_response.py | 2 +- .../load_balancers/region_list_response.py | 2 +- .../__init__.py | 6 + ...in_post_quantum_encryption_get_response.py | 8 ++ ...post_quantum_encryption_update_response.py | 8 ++ .../pagerules/pagerule_create_response.py | 4 +- .../types/pagerules/pagerule_edit_response.py | 4 +- .../types/pagerules/pagerule_get_response.py | 4 +- .../pagerules/pagerule_update_response.py | 4 +- .../rate_limits/rate_limit_create_response.py | 2 +- .../rate_limits/rate_limit_edit_response.py | 2 +- .../rate_limits/rate_limit_get_response.py | 2 +- .../user/subscription_update_response.py | 2 +- .../types/vectorize/index_delete_response.py | 4 +- .../types/zero_trust/device_get_response.py | 4 +- .../policies/certificate_get_response.py | 4 +- .../policies/certificate_update_response.py | 4 +- .../posture/integration_delete_response.py | 4 +- .../devices/revoke_create_response.py | 4 +- .../devices/unrevoke_create_response.py | 4 +- .../zones/subscription_create_response.py | 2 +- .../types/zones/subscription_get_response.py | 2 +- .../zones/subscription_update_response.py | 2 +- .../api_resources/argo/test_tiered_caching.py | 26 ++-- .../api_resources/cache/test_cache_reserve.py | 50 +++---- .../cache/test_regional_tiered_cache.py | 26 ++-- .../cache/test_smart_tiered_cache.py | 38 +++--- tests/api_resources/cache/test_variants.py | 42 +++--- .../api_resources/hyperdrive/test_configs.py | 12 +- .../api_resources/kv/namespaces/test_bulk.py | 27 ++-- .../kv/namespaces/test_values.py | 27 ++-- tests/api_resources/kv/test_namespaces.py | 30 +++-- .../test_origin_post_quantum_encryption.py | 44 +++++-- tests/api_resources/vectorize/test_indexes.py | 12 +- .../devices/policies/test_certificates.py | 26 ++-- .../devices/posture/test_integrations.py | 12 +- .../zero_trust/devices/test_revoke.py | 14 +- .../zero_trust/devices/test_unrevoke.py | 14 +- .../api_resources/zero_trust/test_devices.py | 14 +- 87 files changed, 668 insertions(+), 514 deletions(-) create mode 100644 src/cloudflare/types/kv/namespace_delete_response.py create mode 100644 src/cloudflare/types/kv/namespace_update_response.py create mode 100644 src/cloudflare/types/kv/namespaces/bulk_delete_response.py create mode 100644 src/cloudflare/types/kv/namespaces/bulk_update_response.py create mode 100644 src/cloudflare/types/kv/namespaces/value_delete_response.py create mode 100644 src/cloudflare/types/kv/namespaces/value_update_response.py create mode 100644 src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py create mode 100644 src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py diff --git a/.stats.yml b/.stats.yml index 8bfdb282f8e..e4ed54aec3c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1351 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9cbcdcc8acc681588615d53cd62ef73f7aec09cbb2f8be582025ccb444606720.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-540ee61b2362cf59b358b7ba9233f64c333c2311344687d439168580cdc415ac.yml diff --git a/api.md b/api.md index 22b989a9076..40ad7f7a23e 100644 --- a/api.md +++ b/api.md @@ -639,10 +639,10 @@ from cloudflare.types.cache import ( Methods: -- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> Optional -- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> Optional -- client.cache.cache_reserve.get(\*, zone_id) -> Optional -- client.cache.cache_reserve.status(\*, zone_id) -> Optional +- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> CacheReserveClearResponse +- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> CacheReserveEditResponse +- client.cache.cache_reserve.get(\*, zone_id) -> CacheReserveGetResponse +- client.cache.cache_reserve.status(\*, zone_id) -> CacheReserveStatusResponse ## SmartTieredCache @@ -658,9 +658,9 @@ from cloudflare.types.cache import ( Methods: -- client.cache.smart_tiered_cache.delete(\*, zone_id) -> Optional -- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional -- client.cache.smart_tiered_cache.get(\*, zone_id) -> Optional +- client.cache.smart_tiered_cache.delete(\*, zone_id) -> SmartTieredCacheDeleteResponse +- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> SmartTieredCacheEditResponse +- client.cache.smart_tiered_cache.get(\*, zone_id) -> SmartTieredCacheGetResponse ## Variants @@ -677,9 +677,9 @@ from cloudflare.types.cache import ( Methods: -- client.cache.variants.delete(\*, zone_id) -> Optional -- client.cache.variants.edit(\*, zone_id, \*\*params) -> Optional -- client.cache.variants.get(\*, zone_id) -> Optional +- client.cache.variants.delete(\*, zone_id) -> CacheVariant +- client.cache.variants.edit(\*, zone_id, \*\*params) -> VariantEditResponse +- client.cache.variants.get(\*, zone_id) -> VariantGetResponse ## RegionalTieredCache @@ -695,8 +695,8 @@ from cloudflare.types.cache import ( Methods: -- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional -- client.cache.regional_tiered_cache.get(\*, zone_id) -> Optional +- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> RegionalTieredCacheEditResponse +- client.cache.regional_tiered_cache.get(\*, zone_id) -> RegionalTieredCacheGetResponse # SSL @@ -840,8 +840,8 @@ from cloudflare.types.argo import TieredCachingEditResponse, TieredCachingGetRes Methods: -- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> Optional -- client.argo.tiered_caching.get(\*, zone_id) -> Optional +- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> TieredCachingEditResponse +- client.argo.tiered_caching.get(\*, zone_id) -> TieredCachingGetResponse # CertificateAuthorities @@ -2381,9 +2381,9 @@ from cloudflare.types.kv import Namespace, NamespaceUpdateResponse, NamespaceDel Methods: - client.kv.namespaces.create(\*, account_id, \*\*params) -> Optional -- client.kv.namespaces.update(namespace_id, \*, account_id, \*\*params) -> object +- client.kv.namespaces.update(namespace_id, \*, account_id, \*\*params) -> Optional - client.kv.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Namespace] -- client.kv.namespaces.delete(namespace_id, \*, account_id) -> object +- client.kv.namespaces.delete(namespace_id, \*, account_id) -> Optional - client.kv.namespaces.get(namespace_id, \*, account_id) -> Optional ### Bulk @@ -2396,8 +2396,8 @@ from cloudflare.types.kv.namespaces import BulkUpdateResponse, BulkDeleteRespons Methods: -- client.kv.namespaces.bulk.update(namespace_id, \*, account_id, \*\*params) -> object -- client.kv.namespaces.bulk.delete(namespace_id, \*, account_id) -> object +- client.kv.namespaces.bulk.update(namespace_id, \*, account_id, \*\*params) -> Optional +- client.kv.namespaces.bulk.delete(namespace_id, \*, account_id) -> Optional ### Keys @@ -2433,8 +2433,8 @@ from cloudflare.types.kv.namespaces import ValueUpdateResponse, ValueDeleteRespo Methods: -- client.kv.namespaces.values.update(key_name, \*, account_id, namespace_id, \*\*params) -> object -- client.kv.namespaces.values.delete(key_name, \*, account_id, namespace_id) -> object +- client.kv.namespaces.values.update(key_name, \*, account_id, namespace_id, \*\*params) -> Optional +- client.kv.namespaces.values.delete(key_name, \*, account_id, namespace_id) -> Optional - client.kv.namespaces.values.get(key_name, \*, account_id, namespace_id) -> BinaryAPIResponse # DurableObjects @@ -4695,7 +4695,7 @@ from cloudflare.types.zero_trust import Device, DeviceGetResponse Methods: - client.zero_trust.devices.list(\*, account_id) -> SyncSinglePage[Device] -- client.zero_trust.devices.get(device_id, \*, account_id) -> Optional +- client.zero_trust.devices.get(device_id, \*, account_id) -> DeviceGetResponse ### DEXTests @@ -4764,8 +4764,8 @@ from cloudflare.types.zero_trust.devices.policies import ( Methods: -- client.zero_trust.devices.policies.certificates.update(zone_tag, \*\*params) -> Optional -- client.zero_trust.devices.policies.certificates.get(zone_tag) -> Optional +- client.zero_trust.devices.policies.certificates.update(zone_tag, \*\*params) -> CertificateUpdateResponse +- client.zero_trust.devices.policies.certificates.get(zone_tag) -> CertificateGetResponse #### DefaultPolicy @@ -4882,7 +4882,7 @@ Methods: - client.zero_trust.devices.posture.integrations.create(\*, account_id, \*\*params) -> Optional - client.zero_trust.devices.posture.integrations.list(\*, account_id) -> SyncSinglePage[Integration] -- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> Optional +- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> IntegrationDeleteResponse - client.zero_trust.devices.posture.integrations.edit(integration_id, \*, account_id, \*\*params) -> Optional - client.zero_trust.devices.posture.integrations.get(integration_id, \*, account_id) -> Optional @@ -4896,7 +4896,7 @@ from cloudflare.types.zero_trust.devices import RevokeCreateResponse Methods: -- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> RevokeCreateResponse ### Settings @@ -4922,7 +4922,7 @@ from cloudflare.types.zero_trust.devices import UnrevokeCreateResponse Methods: -- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> UnrevokeCreateResponse ### OverrideCodes @@ -6163,7 +6163,7 @@ Methods: - client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Optional - client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Optional - client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[Hyperdrive] -- client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> Optional +- client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> ConfigDeleteResponse - client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Optional - client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Optional @@ -6228,7 +6228,7 @@ Methods: - client.vectorize.indexes.create(\*, account_id, \*\*params) -> Optional - client.vectorize.indexes.list(\*, account_id) -> SyncSinglePage[CreateIndex] -- client.vectorize.indexes.delete(index_name, \*, account_id) -> Optional +- client.vectorize.indexes.delete(index_name, \*, account_id) -> IndexDeleteResponse - client.vectorize.indexes.delete_by_ids(index_name, \*, account_id, \*\*params) -> Optional - client.vectorize.indexes.get(index_name, \*, account_id) -> Optional - client.vectorize.indexes.get_by_ids(index_name, \*, account_id, \*\*params) -> object @@ -7511,8 +7511,8 @@ from cloudflare.types.origin_post_quantum_encryption import ( Methods: -- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> object -- client.origin_post_quantum_encryption.get(\*, zone_id) -> object +- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> OriginPostQuantumEncryptionUpdateResponse +- client.origin_post_quantum_encryption.get(\*, zone_id) -> OriginPostQuantumEncryptionGetResponse # Speed diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py index 2f51ebdb9e0..46fb96c1e31 100644 --- a/src/cloudflare/resources/argo/tiered_caching.py +++ b/src/cloudflare/resources/argo/tiered_caching.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -60,7 +60,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingEditResponse]: + ) -> TieredCachingEditResponse: """ Updates enablement of Tiered Caching @@ -87,9 +87,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]), + cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]), ) def get( @@ -102,7 +102,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingGetResponse]: + ) -> TieredCachingGetResponse: """ Get Tiered Caching setting @@ -126,9 +126,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]), + cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]), ) @@ -163,7 +163,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingEditResponse]: + ) -> TieredCachingEditResponse: """ Updates enablement of Tiered Caching @@ -190,9 +190,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]), + cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]), ) async def get( @@ -205,7 +205,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingGetResponse]: + ) -> TieredCachingGetResponse: """ Get Tiered Caching setting @@ -229,9 +229,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]), + cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]), ) diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index df5c9f28ccf..9116ecc0307 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -62,7 +62,7 @@ def clear( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveClearResponse]: + ) -> CacheReserveClearResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -90,9 +90,9 @@ def clear( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), ) def edit( @@ -106,7 +106,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveEditResponse]: + ) -> CacheReserveEditResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -138,9 +138,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), ) def get( @@ -153,7 +153,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveGetResponse]: + ) -> CacheReserveGetResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -182,9 +182,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]), + cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), ) def status( @@ -197,7 +197,7 @@ def status( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveStatusResponse]: + ) -> CacheReserveStatusResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -224,9 +224,9 @@ def status( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]), + cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]), ) @@ -261,7 +261,7 @@ async def clear( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveClearResponse]: + ) -> CacheReserveClearResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -289,9 +289,9 @@ async def clear( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), ) async def edit( @@ -305,7 +305,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveEditResponse]: + ) -> CacheReserveEditResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -337,9 +337,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), ) async def get( @@ -352,7 +352,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveGetResponse]: + ) -> CacheReserveGetResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -381,9 +381,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]), + cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), ) async def status( @@ -396,7 +396,7 @@ async def status( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveStatusResponse]: + ) -> CacheReserveStatusResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -423,9 +423,9 @@ async def status( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]), + cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]), ) diff --git a/src/cloudflare/resources/cache/regional_tiered_cache.py b/src/cloudflare/resources/cache/regional_tiered_cache.py index 69889f46644..e2d101b0154 100644 --- a/src/cloudflare/resources/cache/regional_tiered_cache.py +++ b/src/cloudflare/resources/cache/regional_tiered_cache.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -60,7 +60,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheEditResponse]: + ) -> RegionalTieredCacheEditResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -89,11 +89,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheEditResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[RegionalTieredCacheEditResponse]], ResultWrapper[RegionalTieredCacheEditResponse] + post_parser=ResultWrapper[RegionalTieredCacheEditResponse]._unwrapper, ), + cast_to=cast(Type[RegionalTieredCacheEditResponse], ResultWrapper[RegionalTieredCacheEditResponse]), ) def get( @@ -106,7 +104,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheGetResponse]: + ) -> RegionalTieredCacheGetResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -132,9 +130,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[RegionalTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[RegionalTieredCacheGetResponse]], ResultWrapper[RegionalTieredCacheGetResponse]), + cast_to=cast(Type[RegionalTieredCacheGetResponse], ResultWrapper[RegionalTieredCacheGetResponse]), ) @@ -169,7 +167,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheEditResponse]: + ) -> RegionalTieredCacheEditResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -200,11 +198,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheEditResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[RegionalTieredCacheEditResponse]], ResultWrapper[RegionalTieredCacheEditResponse] + post_parser=ResultWrapper[RegionalTieredCacheEditResponse]._unwrapper, ), + cast_to=cast(Type[RegionalTieredCacheEditResponse], ResultWrapper[RegionalTieredCacheEditResponse]), ) async def get( @@ -217,7 +213,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheGetResponse]: + ) -> RegionalTieredCacheGetResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -243,9 +239,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[RegionalTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[RegionalTieredCacheGetResponse]], ResultWrapper[RegionalTieredCacheGetResponse]), + cast_to=cast(Type[RegionalTieredCacheGetResponse], ResultWrapper[RegionalTieredCacheGetResponse]), ) diff --git a/src/cloudflare/resources/cache/smart_tiered_cache.py b/src/cloudflare/resources/cache/smart_tiered_cache.py index d86423d81f3..abd3127ed38 100644 --- a/src/cloudflare/resources/cache/smart_tiered_cache.py +++ b/src/cloudflare/resources/cache/smart_tiered_cache.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -60,7 +60,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheDeleteResponse]: + ) -> SmartTieredCacheDeleteResponse: """ Remvoves enablement of Smart Tiered Cache @@ -84,9 +84,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheDeleteResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheDeleteResponse]], ResultWrapper[SmartTieredCacheDeleteResponse]), + cast_to=cast(Type[SmartTieredCacheDeleteResponse], ResultWrapper[SmartTieredCacheDeleteResponse]), ) def edit( @@ -100,7 +100,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheEditResponse]: + ) -> SmartTieredCacheEditResponse: """ Updates enablement of Tiered Cache @@ -127,9 +127,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheEditResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheEditResponse]], ResultWrapper[SmartTieredCacheEditResponse]), + cast_to=cast(Type[SmartTieredCacheEditResponse], ResultWrapper[SmartTieredCacheEditResponse]), ) def get( @@ -142,7 +142,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheGetResponse]: + ) -> SmartTieredCacheGetResponse: """ Get Smart Tiered Cache setting @@ -166,9 +166,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheGetResponse]], ResultWrapper[SmartTieredCacheGetResponse]), + cast_to=cast(Type[SmartTieredCacheGetResponse], ResultWrapper[SmartTieredCacheGetResponse]), ) @@ -202,7 +202,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheDeleteResponse]: + ) -> SmartTieredCacheDeleteResponse: """ Remvoves enablement of Smart Tiered Cache @@ -226,9 +226,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheDeleteResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheDeleteResponse]], ResultWrapper[SmartTieredCacheDeleteResponse]), + cast_to=cast(Type[SmartTieredCacheDeleteResponse], ResultWrapper[SmartTieredCacheDeleteResponse]), ) async def edit( @@ -242,7 +242,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheEditResponse]: + ) -> SmartTieredCacheEditResponse: """ Updates enablement of Tiered Cache @@ -271,9 +271,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheEditResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheEditResponse]], ResultWrapper[SmartTieredCacheEditResponse]), + cast_to=cast(Type[SmartTieredCacheEditResponse], ResultWrapper[SmartTieredCacheEditResponse]), ) async def get( @@ -286,7 +286,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheGetResponse]: + ) -> SmartTieredCacheGetResponse: """ Get Smart Tiered Cache setting @@ -310,9 +310,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheGetResponse]], ResultWrapper[SmartTieredCacheGetResponse]), + cast_to=cast(Type[SmartTieredCacheGetResponse], ResultWrapper[SmartTieredCacheGetResponse]), ) diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index 78f252b4c50..254dbf3eb20 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast import httpx @@ -59,7 +59,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheVariant]: + ) -> CacheVariant: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -87,9 +87,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheVariant]]._unwrapper, + post_parser=ResultWrapper[CacheVariant]._unwrapper, ), - cast_to=cast(Type[Optional[CacheVariant]], ResultWrapper[CacheVariant]), + cast_to=cast(Type[CacheVariant], ResultWrapper[CacheVariant]), ) def edit( @@ -103,7 +103,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantEditResponse]: + ) -> VariantEditResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -134,9 +134,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantEditResponse]]._unwrapper, + post_parser=ResultWrapper[VariantEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantEditResponse]], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) def get( @@ -149,7 +149,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantGetResponse]: + ) -> VariantGetResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -177,9 +177,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantGetResponse]]._unwrapper, + post_parser=ResultWrapper[VariantGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantGetResponse]], ResultWrapper[VariantGetResponse]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) @@ -213,7 +213,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheVariant]: + ) -> CacheVariant: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -241,9 +241,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheVariant]]._unwrapper, + post_parser=ResultWrapper[CacheVariant]._unwrapper, ), - cast_to=cast(Type[Optional[CacheVariant]], ResultWrapper[CacheVariant]), + cast_to=cast(Type[CacheVariant], ResultWrapper[CacheVariant]), ) async def edit( @@ -257,7 +257,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantEditResponse]: + ) -> VariantEditResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -288,9 +288,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantEditResponse]]._unwrapper, + post_parser=ResultWrapper[VariantEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantEditResponse]], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) async def get( @@ -303,7 +303,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantGetResponse]: + ) -> VariantGetResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -331,9 +331,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantGetResponse]]._unwrapper, + post_parser=ResultWrapper[VariantGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantGetResponse]], ResultWrapper[VariantGetResponse]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index 15355e802fd..b64736b37a6 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -202,7 +202,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConfigDeleteResponse]: + ) -> ConfigDeleteResponse: """ Deletes the specified Hyperdrive. @@ -224,7 +224,7 @@ def delete( if not hyperdrive_id: raise ValueError(f"Expected a non-empty value for `hyperdrive_id` but received {hyperdrive_id!r}") return cast( - Optional[ConfigDeleteResponse], + ConfigDeleteResponse, self._delete( f"/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}", options=make_request_options( @@ -232,7 +232,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConfigDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[ConfigDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[ConfigDeleteResponse] @@ -514,7 +514,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConfigDeleteResponse]: + ) -> ConfigDeleteResponse: """ Deletes the specified Hyperdrive. @@ -536,7 +536,7 @@ async def delete( if not hyperdrive_id: raise ValueError(f"Expected a non-empty value for `hyperdrive_id` but received {hyperdrive_id!r}") return cast( - Optional[ConfigDeleteResponse], + ConfigDeleteResponse, await self._delete( f"/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}", options=make_request_options( @@ -544,7 +544,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConfigDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[ConfigDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[ConfigDeleteResponse] diff --git a/src/cloudflare/resources/kv/namespaces/bulk.py b/src/cloudflare/resources/kv/namespaces/bulk.py index b19bcc4ff68..8fb4ed0f906 100644 --- a/src/cloudflare/resources/kv/namespaces/bulk.py +++ b/src/cloudflare/resources/kv/namespaces/bulk.py @@ -22,6 +22,8 @@ from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.kv.namespaces import bulk_update_params +from ....types.kv.namespaces.bulk_delete_response import BulkDeleteResponse +from ....types.kv.namespaces.bulk_update_response import BulkUpdateResponse __all__ = ["BulkResource", "AsyncBulkResource"] @@ -58,7 +60,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[BulkUpdateResponse]: """Write multiple keys and values at once. Body should be an array of up to 10,000 @@ -93,9 +95,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[BulkUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[BulkUpdateResponse]], ResultWrapper[BulkUpdateResponse]), ) def delete( @@ -109,7 +111,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[BulkDeleteResponse]: """Remove multiple KV pairs from the namespace. Body should be an array of up to @@ -139,9 +141,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[BulkDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[BulkDeleteResponse]], ResultWrapper[BulkDeleteResponse]), ) @@ -177,7 +179,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[BulkUpdateResponse]: """Write multiple keys and values at once. Body should be an array of up to 10,000 @@ -212,9 +214,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[BulkUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[BulkUpdateResponse]], ResultWrapper[BulkUpdateResponse]), ) async def delete( @@ -228,7 +230,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[BulkDeleteResponse]: """Remove multiple KV pairs from the namespace. Body should be an array of up to @@ -258,9 +260,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[BulkDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[BulkDeleteResponse]], ResultWrapper[BulkDeleteResponse]), ) diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index bf0b088bd9f..95fea898307 100644 --- a/src/cloudflare/resources/kv/namespaces/namespaces.py +++ b/src/cloudflare/resources/kv/namespaces/namespaces.py @@ -57,6 +57,8 @@ from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray 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_update_response import NamespaceUpdateResponse __all__ = ["NamespacesResource", "AsyncNamespacesResource"] @@ -155,7 +157,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[NamespaceUpdateResponse]: """ Modifies a namespace's title. @@ -186,9 +188,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[NamespaceUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[NamespaceUpdateResponse]], ResultWrapper[NamespaceUpdateResponse]), ) def list( @@ -262,7 +264,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[NamespaceDeleteResponse]: """ Deletes the namespace corresponding to the given ID. @@ -290,9 +292,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[NamespaceDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[NamespaceDeleteResponse]], ResultWrapper[NamespaceDeleteResponse]), ) def get( @@ -434,7 +436,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[NamespaceUpdateResponse]: """ Modifies a namespace's title. @@ -465,9 +467,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[NamespaceUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[NamespaceUpdateResponse]], ResultWrapper[NamespaceUpdateResponse]), ) def list( @@ -541,7 +543,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[NamespaceDeleteResponse]: """ Deletes the namespace corresponding to the given ID. @@ -569,9 +571,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[NamespaceDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[NamespaceDeleteResponse]], ResultWrapper[NamespaceDeleteResponse]), ) async def get( diff --git a/src/cloudflare/resources/kv/namespaces/values.py b/src/cloudflare/resources/kv/namespaces/values.py index 84ed73dcb0c..5f0c28b6f5b 100644 --- a/src/cloudflare/resources/kv/namespaces/values.py +++ b/src/cloudflare/resources/kv/namespaces/values.py @@ -30,6 +30,8 @@ from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.kv.namespaces import value_update_params +from ....types.kv.namespaces.value_delete_response import ValueDeleteResponse +from ....types.kv.namespaces.value_update_response import ValueUpdateResponse __all__ = ["ValuesResource", "AsyncValuesResource"] @@ -68,7 +70,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[ValueUpdateResponse]: """Write a value identified by a key. Use URL-encoding to use special characters @@ -118,9 +120,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[ValueUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[ValueUpdateResponse]], ResultWrapper[ValueUpdateResponse]), ) def delete( @@ -135,7 +137,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[ValueDeleteResponse]: """Remove a KV pair from the namespace. Use URL-encoding to use special characters @@ -170,9 +172,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[ValueDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[ValueDeleteResponse]], ResultWrapper[ValueDeleteResponse]), ) def get( @@ -262,7 +264,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[ValueUpdateResponse]: """Write a value identified by a key. Use URL-encoding to use special characters @@ -312,9 +314,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[ValueUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[ValueUpdateResponse]], ResultWrapper[ValueUpdateResponse]), ) async def delete( @@ -329,7 +331,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[ValueDeleteResponse]: """Remove a KV pair from the namespace. Use URL-encoding to use special characters @@ -364,9 +366,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[ValueDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[ValueDeleteResponse]], ResultWrapper[ValueDeleteResponse]), ) async def get( diff --git a/src/cloudflare/resources/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption.py index 69096b7f376..bda025f507b 100644 --- a/src/cloudflare/resources/origin_post_quantum_encryption.py +++ b/src/cloudflare/resources/origin_post_quantum_encryption.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Any, cast from typing_extensions import Literal import httpx @@ -23,6 +23,12 @@ from .._wrappers import ResultWrapper from .._base_client import make_request_options from ..types.origin_post_quantum_encryption import origin_post_quantum_encryption_update_params +from ..types.origin_post_quantum_encryption.origin_post_quantum_encryption_get_response import ( + OriginPostQuantumEncryptionGetResponse, +) +from ..types.origin_post_quantum_encryption.origin_post_quantum_encryption_update_response import ( + OriginPostQuantumEncryptionUpdateResponse, +) __all__ = ["OriginPostQuantumEncryptionResource", "AsyncOriginPostQuantumEncryptionResource"] @@ -58,7 +64,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> OriginPostQuantumEncryptionUpdateResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -82,19 +88,25 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=maybe_transform( - {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams + return cast( + OriginPostQuantumEncryptionUpdateResponse, + self._put( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + body=maybe_transform( + {"value": value}, + origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionUpdateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, - ), - cast_to=cast(Type[object], ResultWrapper[object]), ) def get( @@ -107,7 +119,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> OriginPostQuantumEncryptionGetResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -129,16 +141,21 @@ def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + return cast( + OriginPostQuantumEncryptionGetResponse, + self._get( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -173,7 +190,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> OriginPostQuantumEncryptionUpdateResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -197,19 +214,25 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=await async_maybe_transform( - {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + return cast( + OriginPostQuantumEncryptionUpdateResponse, + await self._put( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + body=await async_maybe_transform( + {"value": value}, + origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionUpdateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[object], ResultWrapper[object]), ) async def get( @@ -222,7 +245,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> OriginPostQuantumEncryptionGetResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -244,16 +267,21 @@ async def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + return cast( + OriginPostQuantumEncryptionGetResponse, + await self._get( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/pages/projects/deployments/deployments.py b/src/cloudflare/resources/pages/projects/deployments/deployments.py index d185b4765c7..aed1fcd671e 100644 --- a/src/cloudflare/resources/pages/projects/deployments/deployments.py +++ b/src/cloudflare/resources/pages/projects/deployments/deployments.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -214,7 +214,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -544,7 +544,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/pages/projects/domains.py b/src/cloudflare/resources/pages/projects/domains.py index cb0ce2d3842..db10cae25ce 100644 --- a/src/cloudflare/resources/pages/projects/domains.py +++ b/src/cloudflare/resources/pages/projects/domains.py @@ -182,7 +182,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -439,7 +439,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/pages/projects/projects.py b/src/cloudflare/resources/pages/projects/projects.py index 98a42fa5a98..364a429ed6b 100644 --- a/src/cloudflare/resources/pages/projects/projects.py +++ b/src/cloudflare/resources/pages/projects/projects.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -209,7 +209,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -364,7 +364,7 @@ def purge_build_cache( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -533,7 +533,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -688,7 +688,7 @@ async def purge_build_cache( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index f0f19510cce..c6529e277b6 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -175,7 +175,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IndexDeleteResponse]: + ) -> IndexDeleteResponse: """ Deletes the specified Vectorize Index. @@ -195,7 +195,7 @@ def delete( if not index_name: raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") return cast( - Optional[IndexDeleteResponse], + IndexDeleteResponse, self._delete( f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}", options=make_request_options( @@ -203,7 +203,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IndexDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IndexDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IndexDeleteResponse] @@ -687,7 +687,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IndexDeleteResponse]: + ) -> IndexDeleteResponse: """ Deletes the specified Vectorize Index. @@ -707,7 +707,7 @@ async def delete( if not index_name: raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") return cast( - Optional[IndexDeleteResponse], + IndexDeleteResponse, await self._delete( f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}", options=make_request_options( @@ -715,7 +715,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IndexDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IndexDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IndexDeleteResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index ca92217077f..73e50bc540a 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Optional, cast +from typing import Any, cast import httpx @@ -187,7 +187,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceGetResponse]: + ) -> DeviceGetResponse: """ Fetches details for a single device. @@ -207,7 +207,7 @@ def get( if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") return cast( - Optional[DeviceGetResponse], + DeviceGetResponse, self._get( f"/accounts/{account_id}/devices/{device_id}", options=make_request_options( @@ -215,7 +215,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DeviceGetResponse]]._unwrapper, + post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[DeviceGetResponse] @@ -321,7 +321,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceGetResponse]: + ) -> DeviceGetResponse: """ Fetches details for a single device. @@ -341,7 +341,7 @@ async def get( if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") return cast( - Optional[DeviceGetResponse], + DeviceGetResponse, await self._get( f"/accounts/{account_id}/devices/{device_id}", options=make_request_options( @@ -349,7 +349,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DeviceGetResponse]]._unwrapper, + post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[DeviceGetResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/policies/certificates.py b/src/cloudflare/resources/zero_trust/devices/policies/certificates.py index 67b5180196d..6f361f32938 100755 --- a/src/cloudflare/resources/zero_trust/devices/policies/certificates.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Optional, cast +from typing import Any, cast import httpx @@ -59,7 +59,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateUpdateResponse]: + ) -> CertificateUpdateResponse: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, and referenced by Access device posture policies when the client visits MTLS @@ -80,7 +80,7 @@ def update( if not zone_tag: raise ValueError(f"Expected a non-empty value for `zone_tag` but received {zone_tag!r}") return cast( - Optional[CertificateUpdateResponse], + CertificateUpdateResponse, self._patch( f"/zones/{zone_tag}/devices/policy/certificates", body=maybe_transform({"enabled": enabled}, certificate_update_params.CertificateUpdateParams), @@ -89,7 +89,7 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateUpdateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateUpdateResponse] @@ -107,7 +107,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateGetResponse]: + ) -> CertificateGetResponse: """ Fetches device certificate provisioning @@ -123,7 +123,7 @@ def get( if not zone_tag: raise ValueError(f"Expected a non-empty value for `zone_tag` but received {zone_tag!r}") return cast( - Optional[CertificateGetResponse], + CertificateGetResponse, self._get( f"/zones/{zone_tag}/devices/policy/certificates", options=make_request_options( @@ -131,7 +131,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateGetResponse] @@ -171,7 +171,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateUpdateResponse]: + ) -> CertificateUpdateResponse: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, and referenced by Access device posture policies when the client visits MTLS @@ -192,7 +192,7 @@ async def update( if not zone_tag: raise ValueError(f"Expected a non-empty value for `zone_tag` but received {zone_tag!r}") return cast( - Optional[CertificateUpdateResponse], + CertificateUpdateResponse, await self._patch( f"/zones/{zone_tag}/devices/policy/certificates", body=await async_maybe_transform( @@ -203,7 +203,7 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateUpdateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateUpdateResponse] @@ -221,7 +221,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateGetResponse]: + ) -> CertificateGetResponse: """ Fetches device certificate provisioning @@ -237,7 +237,7 @@ async def get( if not zone_tag: raise ValueError(f"Expected a non-empty value for `zone_tag` but received {zone_tag!r}") return cast( - Optional[CertificateGetResponse], + CertificateGetResponse, await self._get( f"/zones/{zone_tag}/devices/policy/certificates", options=make_request_options( @@ -245,7 +245,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateGetResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py index c02ac6559f6..0074d8055da 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py @@ -156,7 +156,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IntegrationDeleteResponse]: + ) -> IntegrationDeleteResponse: """ Delete a configured device posture integration. @@ -176,7 +176,7 @@ def delete( if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") return cast( - Optional[IntegrationDeleteResponse], + IntegrationDeleteResponse, self._delete( f"/accounts/{account_id}/devices/posture/integration/{integration_id}", options=make_request_options( @@ -184,7 +184,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IntegrationDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IntegrationDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IntegrationDeleteResponse] @@ -428,7 +428,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IntegrationDeleteResponse]: + ) -> IntegrationDeleteResponse: """ Delete a configured device posture integration. @@ -448,7 +448,7 @@ async def delete( if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") return cast( - Optional[IntegrationDeleteResponse], + IntegrationDeleteResponse, await self._delete( f"/accounts/{account_id}/devices/posture/integration/{integration_id}", options=make_request_options( @@ -456,7 +456,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IntegrationDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IntegrationDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IntegrationDeleteResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index 3057bf6c62d..d14f3536764 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Optional, cast +from typing import Any, List, cast import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RevokeCreateResponse]: + ) -> RevokeCreateResponse: """ Revokes a list of devices. @@ -75,7 +75,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[RevokeCreateResponse], + RevokeCreateResponse, self._post( f"/accounts/{account_id}/devices/revoke", body=maybe_transform(body, List[str]), @@ -84,7 +84,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[RevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[RevokeCreateResponse] @@ -124,7 +124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RevokeCreateResponse]: + ) -> RevokeCreateResponse: """ Revokes a list of devices. @@ -142,7 +142,7 @@ 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( - Optional[RevokeCreateResponse], + RevokeCreateResponse, await self._post( f"/accounts/{account_id}/devices/revoke", body=await async_maybe_transform(body, List[str]), @@ -151,7 +151,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[RevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[RevokeCreateResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index b99f36a0037..3c4489edec1 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Optional, cast +from typing import Any, List, cast import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnrevokeCreateResponse]: + ) -> UnrevokeCreateResponse: """ Unrevokes a list of devices. @@ -75,7 +75,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[UnrevokeCreateResponse], + UnrevokeCreateResponse, self._post( f"/accounts/{account_id}/devices/unrevoke", body=maybe_transform(body, List[str]), @@ -84,7 +84,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UnrevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[UnrevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[UnrevokeCreateResponse] @@ -124,7 +124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnrevokeCreateResponse]: + ) -> UnrevokeCreateResponse: """ Unrevokes a list of devices. @@ -142,7 +142,7 @@ 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( - Optional[UnrevokeCreateResponse], + UnrevokeCreateResponse, await self._post( f"/accounts/{account_id}/devices/unrevoke", body=await async_maybe_transform(body, List[str]), @@ -151,7 +151,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UnrevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[UnrevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[UnrevokeCreateResponse] diff --git a/src/cloudflare/types/accounts/subscription_create_response.py b/src/cloudflare/types/accounts/subscription_create_response.py index 907605e38d7..5ba8b499d96 100644 --- a/src/cloudflare/types/accounts/subscription_create_response.py +++ b/src/cloudflare/types/accounts/subscription_create_response.py @@ -5,4 +5,4 @@ __all__ = ["SubscriptionCreateResponse"] -SubscriptionCreateResponse: TypeAlias = Union[Optional[str], object] +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 index 2938ede2a91..71628cdb370 100644 --- a/src/cloudflare/types/accounts/subscription_update_response.py +++ b/src/cloudflare/types/accounts/subscription_update_response.py @@ -5,4 +5,4 @@ __all__ = ["SubscriptionUpdateResponse"] -SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], object] +SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/argo/smart_routing_edit_response.py b/src/cloudflare/types/argo/smart_routing_edit_response.py index eb10a30c757..7fa39d8d0ca 100644 --- a/src/cloudflare/types/argo/smart_routing_edit_response.py +++ b/src/cloudflare/types/argo/smart_routing_edit_response.py @@ -5,4 +5,4 @@ __all__ = ["SmartRoutingEditResponse"] -SmartRoutingEditResponse: TypeAlias = Union[Optional[str], object] +SmartRoutingEditResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/argo/smart_routing_get_response.py b/src/cloudflare/types/argo/smart_routing_get_response.py index 44743a8c601..f65642d31d3 100644 --- a/src/cloudflare/types/argo/smart_routing_get_response.py +++ b/src/cloudflare/types/argo/smart_routing_get_response.py @@ -5,4 +5,4 @@ __all__ = ["SmartRoutingGetResponse"] -SmartRoutingGetResponse: TypeAlias = Union[Optional[str], object] +SmartRoutingGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/email_security/settings/domain_edit_response.py b/src/cloudflare/types/email_security/settings/domain_edit_response.py index 1ea68c2198c..31b8516678f 100644 --- a/src/cloudflare/types/email_security/settings/domain_edit_response.py +++ b/src/cloudflare/types/email_security/settings/domain_edit_response.py @@ -23,6 +23,8 @@ class DomainEditResponse(BaseModel): lookback_hops: int + folder: Optional[Literal["AllItems", "Inbox"]] = None + integration_id: Optional[str] = None o365_tenant_id: Optional[str] = None diff --git a/src/cloudflare/types/email_security/settings/domain_list_response.py b/src/cloudflare/types/email_security/settings/domain_list_response.py index a4722c26df9..fe9208e6a40 100644 --- a/src/cloudflare/types/email_security/settings/domain_list_response.py +++ b/src/cloudflare/types/email_security/settings/domain_list_response.py @@ -23,6 +23,8 @@ class DomainListResponse(BaseModel): lookback_hops: int + folder: Optional[Literal["AllItems", "Inbox"]] = None + integration_id: Optional[str] = None o365_tenant_id: Optional[str] = None diff --git a/src/cloudflare/types/firewall/access_rule_create_response.py b/src/cloudflare/types/firewall/access_rule_create_response.py index a22df9118bb..cf90fa66c02 100644 --- a/src/cloudflare/types/firewall/access_rule_create_response.py +++ b/src/cloudflare/types/firewall/access_rule_create_response.py @@ -5,4 +5,4 @@ __all__ = ["AccessRuleCreateResponse"] -AccessRuleCreateResponse: TypeAlias = Union[Optional[str], object] +AccessRuleCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/access_rule_edit_response.py b/src/cloudflare/types/firewall/access_rule_edit_response.py index 94d60856d78..9a812e80db2 100644 --- a/src/cloudflare/types/firewall/access_rule_edit_response.py +++ b/src/cloudflare/types/firewall/access_rule_edit_response.py @@ -5,4 +5,4 @@ __all__ = ["AccessRuleEditResponse"] -AccessRuleEditResponse: TypeAlias = Union[Optional[str], object] +AccessRuleEditResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/access_rule_get_response.py b/src/cloudflare/types/firewall/access_rule_get_response.py index 60bb66386e9..0e6dc7f7983 100644 --- a/src/cloudflare/types/firewall/access_rule_get_response.py +++ b/src/cloudflare/types/firewall/access_rule_get_response.py @@ -5,4 +5,4 @@ __all__ = ["AccessRuleGetResponse"] -AccessRuleGetResponse: TypeAlias = Union[Optional[str], object] +AccessRuleGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/ua_rule_create_response.py b/src/cloudflare/types/firewall/ua_rule_create_response.py index fdeab8ca53c..bb2d6671967 100644 --- a/src/cloudflare/types/firewall/ua_rule_create_response.py +++ b/src/cloudflare/types/firewall/ua_rule_create_response.py @@ -5,4 +5,4 @@ __all__ = ["UARuleCreateResponse"] -UARuleCreateResponse: TypeAlias = Union[Optional[str], object] +UARuleCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/ua_rule_get_response.py b/src/cloudflare/types/firewall/ua_rule_get_response.py index ce8cbcbc281..10613bd3d5b 100644 --- a/src/cloudflare/types/firewall/ua_rule_get_response.py +++ b/src/cloudflare/types/firewall/ua_rule_get_response.py @@ -5,4 +5,4 @@ __all__ = ["UARuleGetResponse"] -UARuleGetResponse: TypeAlias = Union[Optional[str], object] +UARuleGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/ua_rule_update_response.py b/src/cloudflare/types/firewall/ua_rule_update_response.py index 812b6ecb182..4dc4d0ae168 100644 --- a/src/cloudflare/types/firewall/ua_rule_update_response.py +++ b/src/cloudflare/types/firewall/ua_rule_update_response.py @@ -5,4 +5,4 @@ __all__ = ["UARuleUpdateResponse"] -UARuleUpdateResponse: TypeAlias = Union[Optional[str], object] +UARuleUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/waf/package_get_response.py b/src/cloudflare/types/firewall/waf/package_get_response.py index 218464c9db5..6c5fda24087 100644 --- a/src/cloudflare/types/firewall/waf/package_get_response.py +++ b/src/cloudflare/types/firewall/waf/package_get_response.py @@ -14,7 +14,7 @@ class FirewallAPIResponseSingle(BaseModel): messages: List[ResponseInfo] - result: Union[Optional[str], object] + result: Union[Optional[str], Optional[object]] success: Literal[True] """Whether the API call was successful""" diff --git a/src/cloudflare/types/firewall/waf/packages/group_edit_response.py b/src/cloudflare/types/firewall/waf/packages/group_edit_response.py index 4848a5e17c0..1c60b3dc5cd 100644 --- a/src/cloudflare/types/firewall/waf/packages/group_edit_response.py +++ b/src/cloudflare/types/firewall/waf/packages/group_edit_response.py @@ -5,4 +5,4 @@ __all__ = ["GroupEditResponse"] -GroupEditResponse: TypeAlias = Union[Optional[str], object] +GroupEditResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/waf/packages/group_get_response.py b/src/cloudflare/types/firewall/waf/packages/group_get_response.py index ee2add0082e..3a957c0f004 100644 --- a/src/cloudflare/types/firewall/waf/packages/group_get_response.py +++ b/src/cloudflare/types/firewall/waf/packages/group_get_response.py @@ -5,4 +5,4 @@ __all__ = ["GroupGetResponse"] -GroupGetResponse: TypeAlias = Union[Optional[str], object] +GroupGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/firewall/waf/packages/rule_get_response.py b/src/cloudflare/types/firewall/waf/packages/rule_get_response.py index 68d667fdb2a..13fee82f1b2 100644 --- a/src/cloudflare/types/firewall/waf/packages/rule_get_response.py +++ b/src/cloudflare/types/firewall/waf/packages/rule_get_response.py @@ -5,4 +5,4 @@ __all__ = ["RuleGetResponse"] -RuleGetResponse: TypeAlias = Union[Optional[str], object] +RuleGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/hyperdrive/config_delete_response.py b/src/cloudflare/types/hyperdrive/config_delete_response.py index 48d3bade3ab..271346e64df 100644 --- a/src/cloudflare/types/hyperdrive/config_delete_response.py +++ b/src/cloudflare/types/hyperdrive/config_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["ConfigDeleteResponse"] -ConfigDeleteResponse: TypeAlias = Union[str, object, None] +ConfigDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/images/v1/variant_delete_response.py b/src/cloudflare/types/images/v1/variant_delete_response.py index 3b3a97038ec..849e187534e 100644 --- a/src/cloudflare/types/images/v1/variant_delete_response.py +++ b/src/cloudflare/types/images/v1/variant_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["VariantDeleteResponse"] -VariantDeleteResponse: TypeAlias = Union[str, object] +VariantDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/images/v1_delete_response.py b/src/cloudflare/types/images/v1_delete_response.py index 0122c846f86..b616950e39c 100644 --- a/src/cloudflare/types/images/v1_delete_response.py +++ b/src/cloudflare/types/images/v1_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["V1DeleteResponse"] -V1DeleteResponse: TypeAlias = Union[str, object] +V1DeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/kv/__init__.py b/src/cloudflare/types/kv/__init__.py index 09b3bc52b28..e345eaf540a 100644 --- a/src/cloudflare/types/kv/__init__.py +++ b/src/cloudflare/types/kv/__init__.py @@ -6,3 +6,5 @@ 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_delete_response import NamespaceDeleteResponse as NamespaceDeleteResponse +from .namespace_update_response import NamespaceUpdateResponse as NamespaceUpdateResponse diff --git a/src/cloudflare/types/kv/namespace_delete_response.py b/src/cloudflare/types/kv/namespace_delete_response.py new file mode 100644 index 00000000000..eb6f28e4253 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_delete_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ..._models import BaseModel + +__all__ = ["NamespaceDeleteResponse"] + + +class NamespaceDeleteResponse(BaseModel): + pass diff --git a/src/cloudflare/types/kv/namespace_update_response.py b/src/cloudflare/types/kv/namespace_update_response.py new file mode 100644 index 00000000000..b8f763fc2e9 --- /dev/null +++ b/src/cloudflare/types/kv/namespace_update_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ..._models import BaseModel + +__all__ = ["NamespaceUpdateResponse"] + + +class NamespaceUpdateResponse(BaseModel): + pass diff --git a/src/cloudflare/types/kv/namespaces/__init__.py b/src/cloudflare/types/kv/namespaces/__init__.py index c76af0cc06c..69632f0965e 100644 --- a/src/cloudflare/types/kv/namespaces/__init__.py +++ b/src/cloudflare/types/kv/namespaces/__init__.py @@ -6,4 +6,8 @@ from .key_list_params import KeyListParams as KeyListParams from .bulk_update_params import BulkUpdateParams as BulkUpdateParams from .value_update_params import ValueUpdateParams as ValueUpdateParams +from .bulk_delete_response import BulkDeleteResponse as BulkDeleteResponse +from .bulk_update_response import BulkUpdateResponse as BulkUpdateResponse from .metadata_get_response import MetadataGetResponse as MetadataGetResponse +from .value_delete_response import ValueDeleteResponse as ValueDeleteResponse +from .value_update_response import ValueUpdateResponse as ValueUpdateResponse diff --git a/src/cloudflare/types/kv/namespaces/bulk_delete_response.py b/src/cloudflare/types/kv/namespaces/bulk_delete_response.py new file mode 100644 index 00000000000..4ae88607764 --- /dev/null +++ b/src/cloudflare/types/kv/namespaces/bulk_delete_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ...._models import BaseModel + +__all__ = ["BulkDeleteResponse"] + + +class BulkDeleteResponse(BaseModel): + pass diff --git a/src/cloudflare/types/kv/namespaces/bulk_update_response.py b/src/cloudflare/types/kv/namespaces/bulk_update_response.py new file mode 100644 index 00000000000..55544c65e54 --- /dev/null +++ b/src/cloudflare/types/kv/namespaces/bulk_update_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ...._models import BaseModel + +__all__ = ["BulkUpdateResponse"] + + +class BulkUpdateResponse(BaseModel): + pass diff --git a/src/cloudflare/types/kv/namespaces/value_delete_response.py b/src/cloudflare/types/kv/namespaces/value_delete_response.py new file mode 100644 index 00000000000..224a80852b0 --- /dev/null +++ b/src/cloudflare/types/kv/namespaces/value_delete_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ...._models import BaseModel + +__all__ = ["ValueDeleteResponse"] + + +class ValueDeleteResponse(BaseModel): + pass diff --git a/src/cloudflare/types/kv/namespaces/value_update_response.py b/src/cloudflare/types/kv/namespaces/value_update_response.py new file mode 100644 index 00000000000..40ffa943af8 --- /dev/null +++ b/src/cloudflare/types/kv/namespaces/value_update_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ...._models import BaseModel + +__all__ = ["ValueUpdateResponse"] + + +class ValueUpdateResponse(BaseModel): + pass diff --git a/src/cloudflare/types/load_balancers/region_get_response.py b/src/cloudflare/types/load_balancers/region_get_response.py index fd3582537fa..c4bbad7f15f 100644 --- a/src/cloudflare/types/load_balancers/region_get_response.py +++ b/src/cloudflare/types/load_balancers/region_get_response.py @@ -5,4 +5,4 @@ __all__ = ["RegionGetResponse"] -RegionGetResponse: TypeAlias = Union[Optional[str], object] +RegionGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/load_balancers/region_list_response.py b/src/cloudflare/types/load_balancers/region_list_response.py index 25d3aa695ef..668f256ec66 100644 --- a/src/cloudflare/types/load_balancers/region_list_response.py +++ b/src/cloudflare/types/load_balancers/region_list_response.py @@ -5,4 +5,4 @@ __all__ = ["RegionListResponse"] -RegionListResponse: TypeAlias = Union[Optional[str], object] +RegionListResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/origin_post_quantum_encryption/__init__.py b/src/cloudflare/types/origin_post_quantum_encryption/__init__.py index 0c34922d5b1..31525d2b891 100644 --- a/src/cloudflare/types/origin_post_quantum_encryption/__init__.py +++ b/src/cloudflare/types/origin_post_quantum_encryption/__init__.py @@ -2,6 +2,12 @@ from __future__ import annotations +from .origin_post_quantum_encryption_get_response import ( + OriginPostQuantumEncryptionGetResponse as OriginPostQuantumEncryptionGetResponse, +) from .origin_post_quantum_encryption_update_params import ( OriginPostQuantumEncryptionUpdateParams as OriginPostQuantumEncryptionUpdateParams, ) +from .origin_post_quantum_encryption_update_response import ( + OriginPostQuantumEncryptionUpdateResponse as OriginPostQuantumEncryptionUpdateResponse, +) diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py new file mode 100644 index 00000000000..6f1aa4dca49 --- /dev/null +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +__all__ = ["OriginPostQuantumEncryptionGetResponse"] + +OriginPostQuantumEncryptionGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py new file mode 100644 index 00000000000..bfc6dab7036 --- /dev/null +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +__all__ = ["OriginPostQuantumEncryptionUpdateResponse"] + +OriginPostQuantumEncryptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/pagerules/pagerule_create_response.py b/src/cloudflare/types/pagerules/pagerule_create_response.py index 279a337023e..c169da3be94 100644 --- a/src/cloudflare/types/pagerules/pagerule_create_response.py +++ b/src/cloudflare/types/pagerules/pagerule_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["PageruleCreateResponse"] -PageruleCreateResponse: TypeAlias = Union[str, object] +PageruleCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/pagerules/pagerule_edit_response.py b/src/cloudflare/types/pagerules/pagerule_edit_response.py index ff50de1e7f8..7b882ba930a 100644 --- a/src/cloudflare/types/pagerules/pagerule_edit_response.py +++ b/src/cloudflare/types/pagerules/pagerule_edit_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["PageruleEditResponse"] -PageruleEditResponse: TypeAlias = Union[str, object] +PageruleEditResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/pagerules/pagerule_get_response.py b/src/cloudflare/types/pagerules/pagerule_get_response.py index 961e4bdedaa..542af026355 100644 --- a/src/cloudflare/types/pagerules/pagerule_get_response.py +++ b/src/cloudflare/types/pagerules/pagerule_get_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["PageruleGetResponse"] -PageruleGetResponse: TypeAlias = Union[str, object] +PageruleGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/pagerules/pagerule_update_response.py b/src/cloudflare/types/pagerules/pagerule_update_response.py index fdb37486582..110b4c3282b 100644 --- a/src/cloudflare/types/pagerules/pagerule_update_response.py +++ b/src/cloudflare/types/pagerules/pagerule_update_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["PageruleUpdateResponse"] -PageruleUpdateResponse: TypeAlias = Union[str, object] +PageruleUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/rate_limits/rate_limit_create_response.py b/src/cloudflare/types/rate_limits/rate_limit_create_response.py index 46f90b4a90f..66dfea95151 100644 --- a/src/cloudflare/types/rate_limits/rate_limit_create_response.py +++ b/src/cloudflare/types/rate_limits/rate_limit_create_response.py @@ -5,4 +5,4 @@ __all__ = ["RateLimitCreateResponse"] -RateLimitCreateResponse: TypeAlias = Union[Optional[str], object] +RateLimitCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/rate_limits/rate_limit_edit_response.py b/src/cloudflare/types/rate_limits/rate_limit_edit_response.py index 6bf33364b45..f7c7ef2529a 100644 --- a/src/cloudflare/types/rate_limits/rate_limit_edit_response.py +++ b/src/cloudflare/types/rate_limits/rate_limit_edit_response.py @@ -5,4 +5,4 @@ __all__ = ["RateLimitEditResponse"] -RateLimitEditResponse: TypeAlias = Union[Optional[str], object] +RateLimitEditResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/rate_limits/rate_limit_get_response.py b/src/cloudflare/types/rate_limits/rate_limit_get_response.py index edefe69c807..a48c8258a4a 100644 --- a/src/cloudflare/types/rate_limits/rate_limit_get_response.py +++ b/src/cloudflare/types/rate_limits/rate_limit_get_response.py @@ -5,4 +5,4 @@ __all__ = ["RateLimitGetResponse"] -RateLimitGetResponse: TypeAlias = Union[Optional[str], object] +RateLimitGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/user/subscription_update_response.py b/src/cloudflare/types/user/subscription_update_response.py index 2938ede2a91..71628cdb370 100644 --- a/src/cloudflare/types/user/subscription_update_response.py +++ b/src/cloudflare/types/user/subscription_update_response.py @@ -5,4 +5,4 @@ __all__ = ["SubscriptionUpdateResponse"] -SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], object] +SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/vectorize/index_delete_response.py b/src/cloudflare/types/vectorize/index_delete_response.py index 04ceee6b545..2680eb61604 100644 --- a/src/cloudflare/types/vectorize/index_delete_response.py +++ b/src/cloudflare/types/vectorize/index_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["IndexDeleteResponse"] -IndexDeleteResponse: TypeAlias = Union[str, object, None] +IndexDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/device_get_response.py b/src/cloudflare/types/zero_trust/device_get_response.py index ba79380b7b3..0b11c5ec1cc 100644 --- a/src/cloudflare/types/zero_trust/device_get_response.py +++ b/src/cloudflare/types/zero_trust/device_get_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["DeviceGetResponse"] -DeviceGetResponse: TypeAlias = Union[str, object, None] +DeviceGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/certificate_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/certificate_get_response.py index 47253a71db8..055be51f531 100755 --- a/src/cloudflare/types/zero_trust/devices/policies/certificate_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/certificate_get_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["CertificateGetResponse"] -CertificateGetResponse: TypeAlias = Union[str, object, None] +CertificateGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/certificate_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/certificate_update_response.py index 19199b9c581..015f7860390 100755 --- a/src/cloudflare/types/zero_trust/devices/policies/certificate_update_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/certificate_update_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["CertificateUpdateResponse"] -CertificateUpdateResponse: TypeAlias = Union[str, object, None] +CertificateUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py b/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py index 5ad6c5cee94..df93cf5607b 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["IntegrationDeleteResponse"] -IntegrationDeleteResponse: TypeAlias = Union[str, object, None] +IntegrationDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/revoke_create_response.py b/src/cloudflare/types/zero_trust/devices/revoke_create_response.py index 42834980772..09aceb4935f 100644 --- a/src/cloudflare/types/zero_trust/devices/revoke_create_response.py +++ b/src/cloudflare/types/zero_trust/devices/revoke_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["RevokeCreateResponse"] -RevokeCreateResponse: TypeAlias = Union[str, object, None] +RevokeCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py b/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py index 80dd27e6b84..4b3977f4e98 100644 --- a/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py +++ b/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["UnrevokeCreateResponse"] -UnrevokeCreateResponse: TypeAlias = Union[str, object, None] +UnrevokeCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zones/subscription_create_response.py b/src/cloudflare/types/zones/subscription_create_response.py index 907605e38d7..5ba8b499d96 100644 --- a/src/cloudflare/types/zones/subscription_create_response.py +++ b/src/cloudflare/types/zones/subscription_create_response.py @@ -5,4 +5,4 @@ __all__ = ["SubscriptionCreateResponse"] -SubscriptionCreateResponse: TypeAlias = Union[Optional[str], object] +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 index 87b2b42959e..88f2f2b2875 100644 --- a/src/cloudflare/types/zones/subscription_get_response.py +++ b/src/cloudflare/types/zones/subscription_get_response.py @@ -5,4 +5,4 @@ __all__ = ["SubscriptionGetResponse"] -SubscriptionGetResponse: TypeAlias = Union[Optional[str], object] +SubscriptionGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zones/subscription_update_response.py b/src/cloudflare/types/zones/subscription_update_response.py index 2938ede2a91..71628cdb370 100644 --- a/src/cloudflare/types/zones/subscription_update_response.py +++ b/src/cloudflare/types/zones/subscription_update_response.py @@ -5,4 +5,4 @@ __all__ = ["SubscriptionUpdateResponse"] -SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], object] +SubscriptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/tests/api_resources/argo/test_tiered_caching.py b/tests/api_resources/argo/test_tiered_caching.py index d91060caa7b..9afbafa5d1c 100644 --- a/tests/api_resources/argo/test_tiered_caching.py +++ b/tests/api_resources/argo/test_tiered_caching.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -23,7 +23,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -35,7 +35,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" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ def test_method_get(self, client: Cloudflare) -> None: tiered_caching = client.argo.tiered_caching.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -75,7 +75,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" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +107,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -119,7 +119,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" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -131,7 +131,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: tiered_caching = await async_client.argo.tiered_caching.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,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" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_cache_reserve.py b/tests/api_resources/cache/test_cache_reserve.py index b1e3ec59f38..fb8eab75309 100644 --- a/tests/api_resources/cache/test_cache_reserve.py +++ b/tests/api_resources/cache/test_cache_reserve.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -28,7 +28,7 @@ def test_method_clear(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body="{}", ) - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_clear(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_raw_response_clear(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_clear(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_clear(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -82,7 +82,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" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -94,7 +94,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -111,7 +111,7 @@ def test_method_get(self, client: Cloudflare) -> None: cache_reserve = client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -122,7 +122,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" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -133,7 +133,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +149,7 @@ def test_method_status(self, client: Cloudflare) -> None: cache_reserve = client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_status(self, client: Cloudflare) -> None: @@ -160,7 +160,7 @@ def test_raw_response_status(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_status(self, client: Cloudflare) -> None: @@ -171,7 +171,7 @@ def test_streaming_response_status(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -192,7 +192,7 @@ async def test_method_clear(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body="{}", ) - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_clear(self, async_client: AsyncCloudflare) -> None: @@ -204,7 +204,7 @@ async def test_raw_response_clear(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_clear(self, async_client: AsyncCloudflare) -> None: @@ -216,7 +216,7 @@ async def test_streaming_response_clear(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +234,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -246,7 +246,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" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -258,7 +258,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -275,7 +275,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: cache_reserve = await async_client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -286,7 +286,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" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -297,7 +297,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -313,7 +313,7 @@ async def test_method_status(self, async_client: AsyncCloudflare) -> None: cache_reserve = await async_client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: @@ -324,7 +324,7 @@ async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> None: @@ -335,7 +335,7 @@ async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_regional_tiered_cache.py b/tests/api_resources/cache/test_regional_tiered_cache.py index 98deff2adf5..ec3ddfeb861 100644 --- a/tests/api_resources/cache/test_regional_tiered_cache.py +++ b/tests/api_resources/cache/test_regional_tiered_cache.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -38,7 +38,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" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ def test_method_get(self, client: Cloudflare) -> None: regional_tiered_cache = client.cache.regional_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +78,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" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +122,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" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +134,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: regional_tiered_cache = await async_client.cache.regional_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +162,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" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_smart_tiered_cache.py b/tests/api_resources/cache/test_smart_tiered_cache.py index 4502fff107d..b683f9fc4dc 100644 --- a/tests/api_resources/cache/test_smart_tiered_cache.py +++ b/tests/api_resources/cache/test_smart_tiered_cache.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_delete(self, client: Cloudflare) -> None: smart_tiered_cache = client.cache.smart_tiered_cache.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -37,7 +37,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -48,7 +48,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +65,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -77,7 +77,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" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -106,7 +106,7 @@ def test_method_get(self, client: Cloudflare) -> None: smart_tiered_cache = client.cache.smart_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -117,7 +117,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" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +128,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: smart_tiered_cache = await async_client.cache.smart_tiered_cache.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -187,7 +187,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -199,7 +199,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" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -211,7 +211,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -228,7 +228,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: smart_tiered_cache = await async_client.cache.smart_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -239,7 +239,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" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -250,7 +250,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_variants.py b/tests/api_resources/cache/test_variants.py index d274611a7f1..c46c601fbb8 100644 --- a/tests/api_resources/cache/test_variants.py +++ b/tests/api_resources/cache/test_variants.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -22,7 +22,7 @@ def test_method_delete(self, client: Cloudflare) -> None: variant = client.cache.variants.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheVariant], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[CacheVariant], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[CacheVariant], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -61,7 +61,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value={}, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -81,7 +81,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "webp": ["image/jpeg", "image/avif"], }, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -93,7 +93,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" variant = response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -105,7 +105,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -122,7 +122,7 @@ def test_method_get(self, client: Cloudflare) -> None: variant = client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -133,7 +133,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" variant = response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -144,7 +144,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -164,7 +164,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheVariant], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -175,7 +175,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[CacheVariant], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -186,7 +186,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[CacheVariant], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -203,7 +203,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value={}, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -223,7 +223,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "webp": ["image/jpeg", "image/avif"], }, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -235,7 +235,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" variant = await response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -247,7 +247,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -264,7 +264,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -275,7 +275,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" variant = await response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -286,7 +286,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index 48d09cf76f2..7451d922a7e 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -267,7 +267,7 @@ def test_method_delete(self, client: Cloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -279,7 +279,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -291,7 +291,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -682,7 +682,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -694,7 +694,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -706,7 +706,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/kv/namespaces/test_bulk.py b/tests/api_resources/kv/namespaces/test_bulk.py index be32c24ea39..42649742375 100644 --- a/tests/api_resources/kv/namespaces/test_bulk.py +++ b/tests/api_resources/kv/namespaces/test_bulk.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.kv.namespaces import BulkDeleteResponse, BulkUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[{}, {}, {}], ) - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkUpdateResponse], bulk, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -36,7 +37,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" bulk = response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkUpdateResponse], bulk, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -49,7 +50,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bulk = response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkUpdateResponse], bulk, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ def test_method_delete(self, client: Cloudflare) -> None: namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkDeleteResponse], bulk, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -87,7 +88,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bulk = response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkDeleteResponse], bulk, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -99,7 +100,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bulk = response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkDeleteResponse], bulk, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +129,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[{}, {}, {}], ) - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkUpdateResponse], bulk, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -141,7 +142,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" bulk = await response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkUpdateResponse], bulk, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -154,7 +155,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" bulk = await response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkUpdateResponse], bulk, path=["response"]) assert cast(Any, response.is_closed) is True @@ -180,7 +181,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkDeleteResponse], bulk, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -192,7 +193,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bulk = await response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkDeleteResponse], bulk, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -204,7 +205,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" bulk = await response.parse() - assert_matches_type(object, bulk, path=["response"]) + assert_matches_type(Optional[BulkDeleteResponse], bulk, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/kv/namespaces/test_values.py b/tests/api_resources/kv/namespaces/test_values.py index c9b8c299138..376ec1960ef 100644 --- a/tests/api_resources/kv/namespaces/test_values.py +++ b/tests/api_resources/kv/namespaces/test_values.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import httpx import pytest @@ -17,6 +17,7 @@ StreamedBinaryAPIResponse, AsyncStreamedBinaryAPIResponse, ) +from cloudflare.types.kv.namespaces import ValueDeleteResponse, ValueUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -34,7 +35,7 @@ def test_method_update(self, client: Cloudflare) -> None: metadata='{"someMetadataKey": "someMetadataValue"}', value="Some Value", ) - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueUpdateResponse], value, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -50,7 +51,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" value = response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueUpdateResponse], value, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -66,7 +67,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" value = response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueUpdateResponse], value, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +108,7 @@ def test_method_delete(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", namespace_id="0f2ac74b498b48028cb68387c421e279", ) - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueDeleteResponse], value, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -120,7 +121,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" value = response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueDeleteResponse], value, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -133,7 +134,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" value = response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueDeleteResponse], value, path=["response"]) assert cast(Any, response.is_closed) is True @@ -256,7 +257,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: metadata='{"someMetadataKey": "someMetadataValue"}', value="Some Value", ) - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueUpdateResponse], value, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -272,7 +273,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" value = await response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueUpdateResponse], value, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -288,7 +289,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" value = await response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueUpdateResponse], value, path=["response"]) assert cast(Any, response.is_closed) is True @@ -329,7 +330,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", namespace_id="0f2ac74b498b48028cb68387c421e279", ) - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueDeleteResponse], value, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -342,7 +343,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" value = await response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueDeleteResponse], value, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -355,7 +356,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" value = await response.parse() - assert_matches_type(object, value, path=["response"]) + assert_matches_type(Optional[ValueDeleteResponse], value, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/kv/test_namespaces.py b/tests/api_resources/kv/test_namespaces.py index ae45e68a4ee..aa2e9589dfe 100644 --- a/tests/api_resources/kv/test_namespaces.py +++ b/tests/api_resources/kv/test_namespaces.py @@ -9,7 +9,11 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.kv import Namespace +from cloudflare.types.kv import ( + Namespace, + NamespaceDeleteResponse, + NamespaceUpdateResponse, +) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -67,7 +71,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", title="My Own Namespace", ) - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceUpdateResponse], namespace, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -80,7 +84,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" namespace = response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceUpdateResponse], namespace, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -93,7 +97,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceUpdateResponse], namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -168,7 +172,7 @@ def test_method_delete(self, client: Cloudflare) -> None: namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceDeleteResponse], namespace, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -180,7 +184,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceDeleteResponse], namespace, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -192,7 +196,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceDeleteResponse], namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -311,7 +315,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", title="My Own Namespace", ) - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceUpdateResponse], namespace, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -324,7 +328,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" namespace = await response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceUpdateResponse], namespace, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -337,7 +341,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceUpdateResponse], namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -412,7 +416,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceDeleteResponse], namespace, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -424,7 +428,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceDeleteResponse], namespace, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -436,7 +440,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(object, namespace, path=["response"]) + assert_matches_type(Optional[NamespaceDeleteResponse], namespace, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_origin_post_quantum_encryption.py b/tests/api_resources/test_origin_post_quantum_encryption.py index bfe684e3849..7b671649427 100644 --- a/tests/api_resources/test_origin_post_quantum_encryption.py +++ b/tests/api_resources/test_origin_post_quantum_encryption.py @@ -9,6 +9,10 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types.origin_post_quantum_encryption import ( + OriginPostQuantumEncryptionGetResponse, + OriginPostQuantumEncryptionUpdateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +27,9 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="preferred", ) - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -36,7 +42,9 @@ 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" origin_post_quantum_encryption = response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -49,7 +57,9 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -68,7 +78,7 @@ def test_method_get(self, client: Cloudflare) -> None: origin_post_quantum_encryption = client.origin_post_quantum_encryption.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -80,7 +90,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -92,7 +102,9 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -115,7 +127,9 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="preferred", ) - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -128,7 +142,9 @@ 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" origin_post_quantum_encryption = await response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -141,7 +157,9 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -160,7 +178,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: origin_post_quantum_encryption = await async_client.origin_post_quantum_encryption.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -172,7 +190,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -184,7 +202,9 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() - assert_matches_type(object, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/vectorize/test_indexes.py b/tests/api_resources/vectorize/test_indexes.py index 272871b4418..97fe5c1b9e8 100644 --- a/tests/api_resources/vectorize/test_indexes.py +++ b/tests/api_resources/vectorize/test_indexes.py @@ -141,7 +141,7 @@ def test_method_delete(self, client: Cloudflare) -> None: index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -153,7 +153,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -165,7 +165,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) assert cast(Any, response.is_closed) is True @@ -717,7 +717,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -729,7 +729,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = await response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -741,7 +741,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = await response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/test_certificates.py b/tests/api_resources/zero_trust/devices/policies/test_certificates.py index f163b303b93..5bfe2d9b01a 100755 --- a/tests/api_resources/zero_trust/devices/policies/test_certificates.py +++ b/tests/api_resources/zero_trust/devices/policies/test_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_tag="699d98642c564d2e855e9661899b7252", enabled=True, ) - assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + assert_matches_type(CertificateUpdateResponse, certificate, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -38,7 +38,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" certificate = response.parse() - assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + assert_matches_type(CertificateUpdateResponse, certificate, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + assert_matches_type(CertificateUpdateResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ def test_method_get(self, client: Cloudflare) -> None: certificate = client.zero_trust.devices.policies.certificates.get( "699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +78,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" certificate = response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_tag="699d98642c564d2e855e9661899b7252", enabled=True, ) - assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + assert_matches_type(CertificateUpdateResponse, certificate, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +122,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" certificate = await response.parse() - assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + assert_matches_type(CertificateUpdateResponse, certificate, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +134,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + assert_matches_type(CertificateUpdateResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: certificate = await async_client.zero_trust.devices.policies.certificates.get( "699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +162,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" certificate = await response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/posture/test_integrations.py b/tests/api_resources/zero_trust/devices/posture/test_integrations.py index 35efacf4282..6ad1c0fabd0 100644 --- a/tests/api_resources/zero_trust/devices/posture/test_integrations.py +++ b/tests/api_resources/zero_trust/devices/posture/test_integrations.py @@ -155,7 +155,7 @@ def test_method_delete(self, client: Cloudflare) -> None: integration_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -167,7 +167,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -179,7 +179,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -448,7 +448,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: integration_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -460,7 +460,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = await response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -472,7 +472,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = await response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_revoke.py b/tests/api_resources/zero_trust/devices/test_revoke.py index 1eb2113f4f4..27aa2002b99 100644 --- a/tests/api_resources/zero_trust/devices/test_revoke.py +++ b/tests/api_resources/zero_trust/devices/test_revoke.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -27,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ], ) - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) assert cast(Any, response.is_closed) is True @@ -89,7 +89,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ], ) - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -105,7 +105,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" revoke = await response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -121,7 +121,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = await response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_unrevoke.py b/tests/api_resources/zero_trust/devices/test_unrevoke.py index 67e5a521a3e..f3b7f43a733 100644 --- a/tests/api_resources/zero_trust/devices/test_unrevoke.py +++ b/tests/api_resources/zero_trust/devices/test_unrevoke.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -27,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ], ) - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True @@ -89,7 +89,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ], ) - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -105,7 +105,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" unrevoke = await response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -121,7 +121,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = await response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/test_devices.py b/tests/api_resources/zero_trust/test_devices.py index e806fd8d30e..f814c7c80bc 100644 --- a/tests/api_resources/zero_trust/test_devices.py +++ b/tests/api_resources/zero_trust/test_devices.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -62,7 +62,7 @@ def test_method_get(self, client: Cloudflare) -> None: device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -74,7 +74,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" device = response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +152,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -164,7 +164,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" device = await response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -176,7 +176,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) assert cast(Any, response.is_closed) is True