From f44f8775470d00c1acd6eb194bf16f3bf39a5e35 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 07:27:03 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#239) --- api.md | 98 +++++++-------- src/cloudflare/resources/cache/__init__.py | 24 ++-- src/cloudflare/resources/cache/cache.py | 36 +++--- .../resources/cache/cache_reserve.py | 38 +++--- .../load_balancers/monitors/monitors.py | 50 ++++---- .../resources/load_balancers/pools/pools.py | 2 +- src/cloudflare/resources/logpush/ownership.py | 22 ++-- .../resources/user/load_balancers/monitors.py | 50 ++++---- .../resources/user/load_balancers/pools.py | 2 +- .../resources/workers/scripts/deployments.py | 6 +- .../resources/zero_trust/dlp/patterns.py | 16 +-- src/cloudflare/types/__init__.py | 4 - src/cloudflare/types/cache/__init__.py | 4 +- src/cloudflare/types/cache/cache_reserve.py | 7 ++ .../cache/cache_reserve_edit_response.py | 4 +- .../types/cache/cache_reserve_get_response.py | 4 +- ...ma_ref_37c385b4ebac5c7a6475b3f81ef9a7ad.py | 7 -- .../types/load_balancers/__init__.py | 5 + .../monitor_create_response.py} | 4 +- .../load_balancers/monitor_edit_response.py | 113 ++++++++++++++++++ .../load_balancers/monitor_get_response.py | 113 ++++++++++++++++++ .../load_balancers/monitor_list_response.py | 113 ++++++++++++++++++ .../load_balancers/monitor_update_response.py | 113 ++++++++++++++++++ src/cloudflare/types/logpush/__init__.py | 1 + .../ownership_validation.py} | 4 +- .../attacks/layer3/top_industry_response.py | 4 +- .../attacks/layer3/top_vertical_response.py | 4 +- .../attacks/layer7/top_industry_response.py | 4 +- .../attacks/layer7/top_vertical_response.py | 4 +- .../email/security/top/tld_get_response.py | 4 +- .../top/tlds/malicious_get_response.py | 4 +- .../security/top/tlds/spam_get_response.py | 4 +- .../security/top/tlds/spoof_get_response.py | 4 +- src/cloudflare/types/radar/http/__init__.py | 1 + src/cloudflare/types/radar/http/browser.py | 11 ++ .../http/top_browser_families_response.py | 4 +- .../types/radar/http/top_browsers_response.py | 4 +- src/cloudflare/types/shared/__init__.py | 12 -- ...ma_ref_2173d81a0b2d332c9e2ac46900fe8bb9.py | 13 -- ...ma_ref_b0ec5cc02c98b665099a5707a2db4ea6.py | 9 -- .../types/url_scanner/scan_get_response.py | 4 +- .../types/url_scanner/scan_har_response.py | 6 +- .../types/user/load_balancers/__init__.py | 7 +- .../load_balancers/monitor_create_response.py | 113 ++++++++++++++++++ .../load_balancers/monitor_edit_response.py | 113 ++++++++++++++++++ .../{monitor.py => monitor_get_response.py} | 4 +- .../load_balancers/monitor_list_response.py | 113 ++++++++++++++++++ .../load_balancers/monitor_update_response.py | 113 ++++++++++++++++++ .../types/user/load_balancers/pool.py | 107 +++++++++++++++++ .../types/waiting_rooms/__init__.py | 1 + src/cloudflare/types/waiting_rooms/setting.py | 14 +++ .../types/workers/scripts/__init__.py | 8 +- ...e763ae3b2964521f2fdd8.py => deployment.py} | 4 +- .../scripts/deployment_create_params.py | 6 +- .../scripts/deployment_create_response.py | 4 +- .../scripts/deployment_get_response.py | 4 +- ...521f2fdd8_param.py => deployment_param.py} | 4 +- .../load_balancers/test_monitors.py | 78 ++++++------ .../load_balancers/test_pools.py | 2 +- tests/api_resources/logpush/test_ownership.py | 26 ++-- .../user/load_balancers/test_monitors.py | 78 ++++++------ .../user/load_balancers/test_pools.py | 2 +- .../zero_trust/dlp/test_patterns.py | 14 +-- 63 files changed, 1376 insertions(+), 375 deletions(-) create mode 100644 src/cloudflare/types/cache/cache_reserve.py delete mode 100644 src/cloudflare/types/cache/unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad.py rename src/cloudflare/types/{shared/unnamed_schema_ref_b52ad7cf99890d19f16edcd84d16ef5b.py => load_balancers/monitor_create_response.py} (96%) create mode 100644 src/cloudflare/types/load_balancers/monitor_edit_response.py create mode 100644 src/cloudflare/types/load_balancers/monitor_get_response.py create mode 100644 src/cloudflare/types/load_balancers/monitor_list_response.py create mode 100644 src/cloudflare/types/load_balancers/monitor_update_response.py rename src/cloudflare/types/{shared/unnamed_schema_ref_cc2ac1a037e5d6702fc77b3bcb527854.py => logpush/ownership_validation.py} (58%) create mode 100644 src/cloudflare/types/radar/http/browser.py delete mode 100644 src/cloudflare/types/shared/unnamed_schema_ref_2173d81a0b2d332c9e2ac46900fe8bb9.py delete mode 100644 src/cloudflare/types/shared/unnamed_schema_ref_b0ec5cc02c98b665099a5707a2db4ea6.py create mode 100644 src/cloudflare/types/user/load_balancers/monitor_create_response.py create mode 100644 src/cloudflare/types/user/load_balancers/monitor_edit_response.py rename src/cloudflare/types/user/load_balancers/{monitor.py => monitor_get_response.py} (97%) create mode 100644 src/cloudflare/types/user/load_balancers/monitor_list_response.py create mode 100644 src/cloudflare/types/user/load_balancers/monitor_update_response.py create mode 100644 src/cloudflare/types/user/load_balancers/pool.py create mode 100644 src/cloudflare/types/waiting_rooms/setting.py rename src/cloudflare/types/workers/scripts/{unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8.py => deployment.py} (72%) rename src/cloudflare/types/workers/scripts/{unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8_param.py => deployment_param.py} (69%) diff --git a/api.md b/api.md index 521f0c8aff0..a23cb9c1d4a 100644 --- a/api.md +++ b/api.md @@ -8,15 +8,11 @@ from cloudflare.types import ( ResponseInfo, Result, UnnamedSchemaRef025497b7e63379c31929636b5186e45c, - UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9, UnnamedSchemaRef23001f1f0b697900e282236466a95fa3, UnnamedSchemaRef33f2e3917f3fe46ad98af0acbb1d9a19, UnnamedSchemaRef619309774d07ec6904f1e354560d6028, UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c, UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a, - UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6, - UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b, - UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854, UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24, ) ``` @@ -190,8 +186,12 @@ Types: ```python from cloudflare.types.user.load_balancers import ( - Monitor, + MonitorCreateResponse, + MonitorUpdateResponse, + MonitorListResponse, MonitorDeleteResponse, + MonitorEditResponse, + MonitorGetResponse, MonitorPreviewResponse, MonitorReferencesResponse, ) @@ -199,12 +199,12 @@ from cloudflare.types.user.load_balancers import ( Methods: -- client.user.load_balancers.monitors.create(\*\*params) -> Monitor -- client.user.load_balancers.monitors.update(monitor_id, \*\*params) -> Monitor -- client.user.load_balancers.monitors.list() -> SyncSinglePage[Monitor] +- client.user.load_balancers.monitors.create(\*\*params) -> MonitorCreateResponse +- client.user.load_balancers.monitors.update(monitor_id, \*\*params) -> MonitorUpdateResponse +- client.user.load_balancers.monitors.list() -> SyncSinglePage[MonitorListResponse] - client.user.load_balancers.monitors.delete(monitor_id, \*\*params) -> MonitorDeleteResponse -- client.user.load_balancers.monitors.edit(monitor_id, \*\*params) -> Monitor -- client.user.load_balancers.monitors.get(monitor_id) -> Monitor +- client.user.load_balancers.monitors.edit(monitor_id, \*\*params) -> MonitorEditResponse +- client.user.load_balancers.monitors.get(monitor_id) -> MonitorGetResponse - client.user.load_balancers.monitors.preview(monitor_id, \*\*params) -> MonitorPreviewResponse - client.user.load_balancers.monitors.references(monitor_id) -> Optional @@ -214,6 +214,7 @@ Types: ```python from cloudflare.types.user.load_balancers import ( + Pool, PoolDeleteResponse, PoolHealthResponse, PoolPreviewResponse, @@ -223,12 +224,12 @@ from cloudflare.types.user.load_balancers import ( Methods: -- client.user.load_balancers.pools.create(\*\*params) -> Pool -- client.user.load_balancers.pools.update(pool_id, \*\*params) -> Pool -- client.user.load_balancers.pools.list(\*\*params) -> SyncSinglePage[Pool] +- client.user.load_balancers.pools.create(\*\*params) -> Pool +- client.user.load_balancers.pools.update(pool_id, \*\*params) -> Pool +- client.user.load_balancers.pools.list(\*\*params) -> SyncSinglePage[Pool] - client.user.load_balancers.pools.delete(pool_id, \*\*params) -> PoolDeleteResponse -- client.user.load_balancers.pools.edit(pool_id, \*\*params) -> Pool -- client.user.load_balancers.pools.get(pool_id) -> Pool +- client.user.load_balancers.pools.edit(pool_id, \*\*params) -> Pool +- client.user.load_balancers.pools.get(pool_id) -> Pool - client.user.load_balancers.pools.health(pool_id) -> PoolHealthResponse - client.user.load_balancers.pools.preview(pool_id, \*\*params) -> PoolPreviewResponse - client.user.load_balancers.pools.references(pool_id) -> Optional @@ -1101,7 +1102,6 @@ from cloudflare.types import ( RandomSteering, RulesItem, SessionAffinityAttributes, - UnnamedSchemaRef06ba14ec7860c091efc98fd9af30f382, LoadBalancerDeleteResponse, ) ``` @@ -1120,17 +1120,24 @@ Methods: Types: ```python -from cloudflare.types.load_balancers import MonitorDeleteResponse +from cloudflare.types.load_balancers import ( + MonitorCreateResponse, + MonitorUpdateResponse, + MonitorListResponse, + MonitorDeleteResponse, + MonitorEditResponse, + MonitorGetResponse, +) ``` Methods: -- client.load_balancers.monitors.create(\*, account_id, \*\*params) -> Monitor -- client.load_balancers.monitors.update(monitor_id, \*, account_id, \*\*params) -> Monitor -- client.load_balancers.monitors.list(\*, account_id) -> SyncSinglePage[Monitor] +- client.load_balancers.monitors.create(\*, account_id, \*\*params) -> MonitorCreateResponse +- client.load_balancers.monitors.update(monitor_id, \*, account_id, \*\*params) -> MonitorUpdateResponse +- client.load_balancers.monitors.list(\*, account_id) -> SyncSinglePage[MonitorListResponse] - client.load_balancers.monitors.delete(monitor_id, \*, account_id, \*\*params) -> MonitorDeleteResponse -- client.load_balancers.monitors.edit(monitor_id, \*, account_id, \*\*params) -> Monitor -- client.load_balancers.monitors.get(monitor_id, \*, account_id) -> Monitor +- client.load_balancers.monitors.edit(monitor_id, \*, account_id, \*\*params) -> MonitorEditResponse +- client.load_balancers.monitors.get(monitor_id, \*, account_id) -> MonitorGetResponse ### Previews @@ -1166,12 +1173,12 @@ from cloudflare.types.load_balancers import Pool, PoolDeleteResponse Methods: -- client.load_balancers.pools.create(\*, account_id, \*\*params) -> Pool -- client.load_balancers.pools.update(pool_id, \*, account_id, \*\*params) -> Pool -- client.load_balancers.pools.list(\*, account_id, \*\*params) -> SyncSinglePage[Pool] +- client.load_balancers.pools.create(\*, account_id, \*\*params) -> Pool +- client.load_balancers.pools.update(pool_id, \*, account_id, \*\*params) -> Pool +- client.load_balancers.pools.list(\*, account_id, \*\*params) -> SyncSinglePage[Pool] - client.load_balancers.pools.delete(pool_id, \*, account_id, \*\*params) -> PoolDeleteResponse -- client.load_balancers.pools.edit(pool_id, \*, account_id, \*\*params) -> Pool -- client.load_balancers.pools.get(pool_id, \*, account_id) -> Pool +- client.load_balancers.pools.edit(pool_id, \*, account_id, \*\*params) -> Pool +- client.load_balancers.pools.get(pool_id, \*, account_id) -> Pool ### Health @@ -1241,14 +1248,14 @@ Methods: - client.cache.purge(\*, zone_id, \*\*params) -> Optional -## CacheReserve +## CacheReserveResource Types: ```python from cloudflare.types.cache import ( + CacheReserve, UnnamedSchemaRef2b5e755404a4bfd7892291ce97c4968d, - UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad, CacheReserveClearResponse, CacheReserveEditResponse, CacheReserveGetResponse, @@ -1687,7 +1694,6 @@ from cloudflare.types.dns import ( AttackMitigation, Firewall, FirewallIPsItem, - UnnamedSchemaRef7a0f93d9e1afc3221d2a57b7bab16955, UpstreamIPs, FirewallDeleteResponse, ) @@ -2104,13 +2110,13 @@ Methods: Types: ```python -from cloudflare.types.logpush import OwnershipCreateResponse +from cloudflare.types.logpush import OwnershipValidation, OwnershipCreateResponse ``` Methods: - client.logpush.ownership.create(\*, account_id, zone_id, \*\*params) -> Optional -- client.logpush.ownership.validate(\*, account_id, zone_id, \*\*params) -> Optional +- client.logpush.ownership.validate(\*, account_id, zone_id, \*\*params) -> Optional ## Validate @@ -2385,11 +2391,7 @@ Methods: Types: ```python -from cloudflare.types.secondary_dns import ( - ACL, - UnnamedSchemaRef08eaa2f22bb9ce0f80063d710d4edafd, - ACLDeleteResponse, -) +from cloudflare.types.secondary_dns import ACL, ACLDeleteResponse ``` Methods: @@ -2425,11 +2427,7 @@ Methods: Types: ```python -from cloudflare.types.secondary_dns import ( - TSIG, - UnnamedSchemaRefC3d6ffaf5dde0c570eaa72462c2ee738, - TSIGDeleteResponse, -) +from cloudflare.types.secondary_dns import TSIG, TSIGDeleteResponse ``` Methods: @@ -2449,7 +2447,6 @@ from cloudflare.types import ( AdditionalRoutesItem, CookieAttributes, Query, - UnnamedSchemaRefA282afe149b2cf60a204505bd4c53324, WaitingRoom, WaitingRoomDeleteResponse, ) @@ -2550,7 +2547,7 @@ Types: ```python from cloudflare.types.waiting_rooms import ( - UnnamedSchemaRef59ecd22a3d62548e441274daec82ee7a, + Setting, SettingUpdateResponse, SettingEditResponse, SettingGetResponse, @@ -2726,7 +2723,7 @@ Types: ```python from cloudflare.types.workers.scripts import ( - UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8, + Deployment, DeploymentCreateResponse, DeploymentGetResponse, ) @@ -5565,7 +5562,7 @@ Methods: Methods: -- client.zero_trust.dlp.patterns.validate(\*, account_id, \*\*params) -> Optional +- client.zero_trust.dlp.patterns.validate(\*, account_id, \*\*params) -> Optional ### PayloadLogs @@ -5718,11 +5715,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.gateway import ( - Lists, - UnnamedSchemaRef30ecd0f5ce68fc07dbb7760deda3d707, - ListCreateResponse, -) +from cloudflare.types.zero_trust.gateway import Lists, ListCreateResponse ``` Methods: @@ -5814,7 +5807,6 @@ from cloudflare.types.zero_trust.gateway import ( Rule, RuleSetting, Schedule, - UnnamedSchemaRef0b0764cdb06aad66b555fd74c8c78b2a, ) ``` @@ -6738,7 +6730,7 @@ Methods: Types: ```python -from cloudflare.types.radar.http import TopBrowserFamiliesResponse, TopBrowsersResponse +from cloudflare.types.radar.http import Browser, TopBrowserFamiliesResponse, TopBrowsersResponse ``` Methods: diff --git a/src/cloudflare/resources/cache/__init__.py b/src/cloudflare/resources/cache/__init__.py index 94f003573ac..8573b2019be 100644 --- a/src/cloudflare/resources/cache/__init__.py +++ b/src/cloudflare/resources/cache/__init__.py @@ -17,12 +17,12 @@ AsyncVariantsWithStreamingResponse, ) from .cache_reserve import ( - CacheReserve, - AsyncCacheReserve, - CacheReserveWithRawResponse, - AsyncCacheReserveWithRawResponse, - CacheReserveWithStreamingResponse, - AsyncCacheReserveWithStreamingResponse, + CacheReserveResource, + AsyncCacheReserveResource, + CacheReserveResourceWithRawResponse, + AsyncCacheReserveResourceWithRawResponse, + CacheReserveResourceWithStreamingResponse, + AsyncCacheReserveResourceWithStreamingResponse, ) from .smart_tiered_cache import ( SmartTieredCache, @@ -42,12 +42,12 @@ ) __all__ = [ - "CacheReserve", - "AsyncCacheReserve", - "CacheReserveWithRawResponse", - "AsyncCacheReserveWithRawResponse", - "CacheReserveWithStreamingResponse", - "AsyncCacheReserveWithStreamingResponse", + "CacheReserveResource", + "AsyncCacheReserveResource", + "CacheReserveResourceWithRawResponse", + "AsyncCacheReserveResourceWithRawResponse", + "CacheReserveResourceWithStreamingResponse", + "AsyncCacheReserveResourceWithStreamingResponse", "SmartTieredCache", "AsyncSmartTieredCache", "SmartTieredCacheWithRawResponse", diff --git a/src/cloudflare/resources/cache/cache.py b/src/cloudflare/resources/cache/cache.py index 2ba1cf15a19..2c82f409763 100644 --- a/src/cloudflare/resources/cache/cache.py +++ b/src/cloudflare/resources/cache/cache.py @@ -31,12 +31,12 @@ ) from ..._wrappers import ResultWrapper from .cache_reserve import ( - CacheReserve, - AsyncCacheReserve, - CacheReserveWithRawResponse, - AsyncCacheReserveWithRawResponse, - CacheReserveWithStreamingResponse, - AsyncCacheReserveWithStreamingResponse, + CacheReserveResource, + AsyncCacheReserveResource, + CacheReserveResourceWithRawResponse, + AsyncCacheReserveResourceWithRawResponse, + CacheReserveResourceWithStreamingResponse, + AsyncCacheReserveResourceWithStreamingResponse, ) from ..._base_client import ( make_request_options, @@ -63,8 +63,8 @@ class Cache(SyncAPIResource): @cached_property - def cache_reserve(self) -> CacheReserve: - return CacheReserve(self._client) + def cache_reserve(self) -> CacheReserveResource: + return CacheReserveResource(self._client) @cached_property def smart_tiered_cache(self) -> SmartTieredCache: @@ -415,8 +415,8 @@ def purge( class AsyncCache(AsyncAPIResource): @cached_property - def cache_reserve(self) -> AsyncCacheReserve: - return AsyncCacheReserve(self._client) + def cache_reserve(self) -> AsyncCacheReserveResource: + return AsyncCacheReserveResource(self._client) @cached_property def smart_tiered_cache(self) -> AsyncSmartTieredCache: @@ -774,8 +774,8 @@ def __init__(self, cache: Cache) -> None: ) @cached_property - def cache_reserve(self) -> CacheReserveWithRawResponse: - return CacheReserveWithRawResponse(self._cache.cache_reserve) + def cache_reserve(self) -> CacheReserveResourceWithRawResponse: + return CacheReserveResourceWithRawResponse(self._cache.cache_reserve) @cached_property def smart_tiered_cache(self) -> SmartTieredCacheWithRawResponse: @@ -799,8 +799,8 @@ def __init__(self, cache: AsyncCache) -> None: ) @cached_property - def cache_reserve(self) -> AsyncCacheReserveWithRawResponse: - return AsyncCacheReserveWithRawResponse(self._cache.cache_reserve) + def cache_reserve(self) -> AsyncCacheReserveResourceWithRawResponse: + return AsyncCacheReserveResourceWithRawResponse(self._cache.cache_reserve) @cached_property def smart_tiered_cache(self) -> AsyncSmartTieredCacheWithRawResponse: @@ -824,8 +824,8 @@ def __init__(self, cache: Cache) -> None: ) @cached_property - def cache_reserve(self) -> CacheReserveWithStreamingResponse: - return CacheReserveWithStreamingResponse(self._cache.cache_reserve) + def cache_reserve(self) -> CacheReserveResourceWithStreamingResponse: + return CacheReserveResourceWithStreamingResponse(self._cache.cache_reserve) @cached_property def smart_tiered_cache(self) -> SmartTieredCacheWithStreamingResponse: @@ -849,8 +849,8 @@ def __init__(self, cache: AsyncCache) -> None: ) @cached_property - def cache_reserve(self) -> AsyncCacheReserveWithStreamingResponse: - return AsyncCacheReserveWithStreamingResponse(self._cache.cache_reserve) + def cache_reserve(self) -> AsyncCacheReserveResourceWithStreamingResponse: + return AsyncCacheReserveResourceWithStreamingResponse(self._cache.cache_reserve) @cached_property def smart_tiered_cache(self) -> AsyncSmartTieredCacheWithStreamingResponse: diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index 023b8f1059e..f282b2b2af5 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -33,17 +33,17 @@ make_request_options, ) -__all__ = ["CacheReserve", "AsyncCacheReserve"] +__all__ = ["CacheReserveResource", "AsyncCacheReserveResource"] -class CacheReserve(SyncAPIResource): +class CacheReserveResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> CacheReserveWithRawResponse: - return CacheReserveWithRawResponse(self) + def with_raw_response(self) -> CacheReserveResourceWithRawResponse: + return CacheReserveResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> CacheReserveWithStreamingResponse: - return CacheReserveWithStreamingResponse(self) + def with_streaming_response(self) -> CacheReserveResourceWithStreamingResponse: + return CacheReserveResourceWithStreamingResponse(self) def clear( self, @@ -224,14 +224,14 @@ def status( ) -class AsyncCacheReserve(AsyncAPIResource): +class AsyncCacheReserveResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncCacheReserveWithRawResponse: - return AsyncCacheReserveWithRawResponse(self) + def with_raw_response(self) -> AsyncCacheReserveResourceWithRawResponse: + return AsyncCacheReserveResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncCacheReserveWithStreamingResponse: - return AsyncCacheReserveWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncCacheReserveResourceWithStreamingResponse: + return AsyncCacheReserveResourceWithStreamingResponse(self) async def clear( self, @@ -412,8 +412,8 @@ async def status( ) -class CacheReserveWithRawResponse: - def __init__(self, cache_reserve: CacheReserve) -> None: +class CacheReserveResourceWithRawResponse: + def __init__(self, cache_reserve: CacheReserveResource) -> None: self._cache_reserve = cache_reserve self.clear = to_raw_response_wrapper( @@ -430,8 +430,8 @@ def __init__(self, cache_reserve: CacheReserve) -> None: ) -class AsyncCacheReserveWithRawResponse: - def __init__(self, cache_reserve: AsyncCacheReserve) -> None: +class AsyncCacheReserveResourceWithRawResponse: + def __init__(self, cache_reserve: AsyncCacheReserveResource) -> None: self._cache_reserve = cache_reserve self.clear = async_to_raw_response_wrapper( @@ -448,8 +448,8 @@ def __init__(self, cache_reserve: AsyncCacheReserve) -> None: ) -class CacheReserveWithStreamingResponse: - def __init__(self, cache_reserve: CacheReserve) -> None: +class CacheReserveResourceWithStreamingResponse: + def __init__(self, cache_reserve: CacheReserveResource) -> None: self._cache_reserve = cache_reserve self.clear = to_streamed_response_wrapper( @@ -466,8 +466,8 @@ def __init__(self, cache_reserve: CacheReserve) -> None: ) -class AsyncCacheReserveWithStreamingResponse: - def __init__(self, cache_reserve: AsyncCacheReserve) -> None: +class AsyncCacheReserveResourceWithStreamingResponse: + def __init__(self, cache_reserve: AsyncCacheReserveResource) -> None: self._cache_reserve = cache_reserve self.clear = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/load_balancers/monitors/monitors.py b/src/cloudflare/resources/load_balancers/monitors/monitors.py index 25e7c0b2c72..389a8f6d5c5 100644 --- a/src/cloudflare/resources/load_balancers/monitors/monitors.py +++ b/src/cloudflare/resources/load_balancers/monitors/monitors.py @@ -43,13 +43,17 @@ make_request_options, ) from ....types.load_balancers import ( + MonitorGetResponse, + MonitorEditResponse, + MonitorListResponse, + MonitorCreateResponse, MonitorDeleteResponse, + MonitorUpdateResponse, monitor_edit_params, monitor_create_params, monitor_delete_params, monitor_update_params, ) -from ....types.user.load_balancers import Monitor __all__ = ["Monitors", "AsyncMonitors"] @@ -97,7 +101,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorCreateResponse: """ Create a configured monitor. @@ -193,7 +197,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorCreateResponse], ResultWrapper[MonitorCreateResponse]), ) def update( @@ -223,7 +227,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorUpdateResponse: """ Modify a configured monitor. @@ -321,7 +325,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorUpdateResponse], ResultWrapper[MonitorUpdateResponse]), ) def list( @@ -334,7 +338,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Monitor]: + ) -> SyncSinglePage[MonitorListResponse]: """ List configured monitors for an account. @@ -353,11 +357,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/load_balancers/monitors", - page=SyncSinglePage[Monitor], + page=SyncSinglePage[MonitorListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Monitor, + model=MonitorListResponse, ) def delete( @@ -431,7 +435,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorEditResponse: """ Apply changes to an existing monitor, overwriting the supplied properties. @@ -529,7 +533,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorEditResponse], ResultWrapper[MonitorEditResponse]), ) def get( @@ -543,7 +547,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorGetResponse: """ List a single configured monitor for an account. @@ -571,7 +575,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorGetResponse], ResultWrapper[MonitorGetResponse]), ) @@ -618,7 +622,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorCreateResponse: """ Create a configured monitor. @@ -714,7 +718,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorCreateResponse], ResultWrapper[MonitorCreateResponse]), ) async def update( @@ -744,7 +748,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorUpdateResponse: """ Modify a configured monitor. @@ -842,7 +846,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorUpdateResponse], ResultWrapper[MonitorUpdateResponse]), ) def list( @@ -855,7 +859,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Monitor, AsyncSinglePage[Monitor]]: + ) -> AsyncPaginator[MonitorListResponse, AsyncSinglePage[MonitorListResponse]]: """ List configured monitors for an account. @@ -874,11 +878,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/load_balancers/monitors", - page=AsyncSinglePage[Monitor], + page=AsyncSinglePage[MonitorListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Monitor, + model=MonitorListResponse, ) async def delete( @@ -952,7 +956,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorEditResponse: """ Apply changes to an existing monitor, overwriting the supplied properties. @@ -1050,7 +1054,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorEditResponse], ResultWrapper[MonitorEditResponse]), ) async def get( @@ -1064,7 +1068,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorGetResponse: """ List a single configured monitor for an account. @@ -1092,7 +1096,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorGetResponse], ResultWrapper[MonitorGetResponse]), ) diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index a2ff1ad7464..9c4f01c48c6 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -49,7 +49,6 @@ make_request_options, ) from ....types.load_balancers import ( - Pool, PoolDeleteResponse, pool_edit_params, pool_list_params, @@ -57,6 +56,7 @@ pool_delete_params, pool_update_params, ) +from ....types.user.load_balancers import Pool __all__ = ["Pools", "AsyncPools"] diff --git a/src/cloudflare/resources/logpush/ownership.py b/src/cloudflare/resources/logpush/ownership.py index 98767f35eea..aebacdfa977 100644 --- a/src/cloudflare/resources/logpush/ownership.py +++ b/src/cloudflare/resources/logpush/ownership.py @@ -23,8 +23,12 @@ from ..._base_client import ( make_request_options, ) -from ...types.shared import UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 -from ...types.logpush import OwnershipCreateResponse, ownership_create_params, ownership_validate_params +from ...types.logpush import ( + OwnershipValidation, + OwnershipCreateResponse, + ownership_create_params, + ownership_validate_params, +) __all__ = ["Ownership", "AsyncOwnership"] @@ -112,7 +116,7 @@ def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]: + ) -> Optional[OwnershipValidation]: """ Validates ownership challenge of the destination. @@ -166,10 +170,7 @@ def validate( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]], - ResultWrapper[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], - ), + cast_to=cast(Type[Optional[OwnershipValidation]], ResultWrapper[OwnershipValidation]), ) @@ -258,7 +259,7 @@ async def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]: + ) -> Optional[OwnershipValidation]: """ Validates ownership challenge of the destination. @@ -312,10 +313,7 @@ async def validate( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]], - ResultWrapper[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], - ), + cast_to=cast(Type[Optional[OwnershipValidation]], ResultWrapper[OwnershipValidation]), ) diff --git a/src/cloudflare/resources/user/load_balancers/monitors.py b/src/cloudflare/resources/user/load_balancers/monitors.py index 9ab21920c92..df03967b45b 100644 --- a/src/cloudflare/resources/user/load_balancers/monitors.py +++ b/src/cloudflare/resources/user/load_balancers/monitors.py @@ -27,8 +27,12 @@ make_request_options, ) from ....types.user.load_balancers import ( - Monitor, + MonitorGetResponse, + MonitorEditResponse, + MonitorListResponse, + MonitorCreateResponse, MonitorDeleteResponse, + MonitorUpdateResponse, MonitorPreviewResponse, MonitorReferencesResponse, monitor_edit_params, @@ -75,7 +79,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorCreateResponse: """ Create a configured monitor. @@ -167,7 +171,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorCreateResponse], ResultWrapper[MonitorCreateResponse]), ) def update( @@ -196,7 +200,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorUpdateResponse: """ Modify a configured monitor. @@ -290,7 +294,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorUpdateResponse], ResultWrapper[MonitorUpdateResponse]), ) def list( @@ -302,15 +306,15 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Monitor]: + ) -> SyncSinglePage[MonitorListResponse]: """List configured monitors for a user.""" return self._get_api_list( "/user/load_balancers/monitors", - page=SyncSinglePage[Monitor], + page=SyncSinglePage[MonitorListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Monitor, + model=MonitorListResponse, ) def delete( @@ -378,7 +382,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorEditResponse: """ Apply changes to an existing monitor, overwriting the supplied properties. @@ -472,7 +476,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorEditResponse], ResultWrapper[MonitorEditResponse]), ) def get( @@ -485,7 +489,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorGetResponse: """ List a single configured monitor for a user. @@ -509,7 +513,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorGetResponse], ResultWrapper[MonitorGetResponse]), ) def preview( @@ -709,7 +713,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorCreateResponse: """ Create a configured monitor. @@ -801,7 +805,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorCreateResponse], ResultWrapper[MonitorCreateResponse]), ) async def update( @@ -830,7 +834,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorUpdateResponse: """ Modify a configured monitor. @@ -924,7 +928,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorUpdateResponse], ResultWrapper[MonitorUpdateResponse]), ) def list( @@ -936,15 +940,15 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Monitor, AsyncSinglePage[Monitor]]: + ) -> AsyncPaginator[MonitorListResponse, AsyncSinglePage[MonitorListResponse]]: """List configured monitors for a user.""" return self._get_api_list( "/user/load_balancers/monitors", - page=AsyncSinglePage[Monitor], + page=AsyncSinglePage[MonitorListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Monitor, + model=MonitorListResponse, ) async def delete( @@ -1012,7 +1016,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorEditResponse: """ Apply changes to an existing monitor, overwriting the supplied properties. @@ -1106,7 +1110,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorEditResponse], ResultWrapper[MonitorEditResponse]), ) async def get( @@ -1119,7 +1123,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Monitor: + ) -> MonitorGetResponse: """ List a single configured monitor for a user. @@ -1143,7 +1147,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Monitor], ResultWrapper[Monitor]), + cast_to=cast(Type[MonitorGetResponse], ResultWrapper[MonitorGetResponse]), ) async def preview( diff --git a/src/cloudflare/resources/user/load_balancers/pools.py b/src/cloudflare/resources/user/load_balancers/pools.py index 58b1f964306..0df03ddaf73 100644 --- a/src/cloudflare/resources/user/load_balancers/pools.py +++ b/src/cloudflare/resources/user/load_balancers/pools.py @@ -33,8 +33,8 @@ AsyncPaginator, make_request_options, ) -from ....types.load_balancers import Pool from ....types.user.load_balancers import ( + Pool, PoolDeleteResponse, PoolHealthResponse, PoolPreviewResponse, diff --git a/src/cloudflare/resources/workers/scripts/deployments.py b/src/cloudflare/resources/workers/scripts/deployments.py index 17ef52deab1..a1fa83fad26 100644 --- a/src/cloudflare/resources/workers/scripts/deployments.py +++ b/src/cloudflare/resources/workers/scripts/deployments.py @@ -24,9 +24,9 @@ make_request_options, ) from ....types.workers.scripts import ( + DeploymentParam, DeploymentGetResponse, DeploymentCreateResponse, - UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param, deployment_create_params, ) @@ -47,7 +47,7 @@ def create( script_name: str, *, account_id: str, - annotations: UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param | NotGiven = NOT_GIVEN, + annotations: DeploymentParam | NotGiven = NOT_GIVEN, strategy: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -159,7 +159,7 @@ async def create( script_name: str, *, account_id: str, - annotations: UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param | NotGiven = NOT_GIVEN, + annotations: DeploymentParam | NotGiven = NOT_GIVEN, strategy: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/cloudflare/resources/zero_trust/dlp/patterns.py b/src/cloudflare/resources/zero_trust/dlp/patterns.py index cb93ccb7ade..378cac72df7 100644 --- a/src/cloudflare/resources/zero_trust/dlp/patterns.py +++ b/src/cloudflare/resources/zero_trust/dlp/patterns.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.shared import UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 +from ....types.logpush import OwnershipValidation from ....types.zero_trust.dlp import pattern_validate_params __all__ = ["Patterns", "AsyncPatterns"] @@ -49,7 +49,7 @@ def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]: + ) -> Optional[OwnershipValidation]: """Validates whether this pattern is a valid regular expression. Rejects it if the @@ -82,10 +82,7 @@ def validate( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]], - ResultWrapper[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], - ), + cast_to=cast(Type[Optional[OwnershipValidation]], ResultWrapper[OwnershipValidation]), ) @@ -109,7 +106,7 @@ async def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]: + ) -> Optional[OwnershipValidation]: """Validates whether this pattern is a valid regular expression. Rejects it if the @@ -142,10 +139,7 @@ async def validate( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854]], - ResultWrapper[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], - ), + cast_to=cast(Type[Optional[OwnershipValidation]], ResultWrapper[OwnershipValidation]), ) diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index eb40e1f2368..d236f5c7e53 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -25,13 +25,9 @@ UnnamedSchemaRef025497b7e63379c31929636b5186e45c as UnnamedSchemaRef025497b7e63379c31929636b5186e45c, UnnamedSchemaRef33f2e3917f3fe46ad98af0acbb1d9a19 as UnnamedSchemaRef33f2e3917f3fe46ad98af0acbb1d9a19, UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c as UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c, - UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 as UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9, UnnamedSchemaRef23001f1f0b697900e282236466a95fa3 as UnnamedSchemaRef23001f1f0b697900e282236466a95fa3, UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a as UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a, UnnamedSchemaRef619309774d07ec6904f1e354560d6028 as UnnamedSchemaRef619309774d07ec6904f1e354560d6028, - UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6 as UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6, - UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b as UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b, - UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 as UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854, UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24 as UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24, ) from .submit import Submit as Submit diff --git a/src/cloudflare/types/cache/__init__.py b/src/cloudflare/types/cache/__init__.py index 4c6bf3683d4..0f1101fda32 100644 --- a/src/cloudflare/types/cache/__init__.py +++ b/src/cloudflare/types/cache/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .cache_reserve import CacheReserve as CacheReserve from .cache_variants import CacheVariants as CacheVariants from .variant_edit_params import VariantEditParams as VariantEditParams from .variant_get_response import VariantGetResponse as VariantGetResponse @@ -22,9 +23,6 @@ from .unnamed_schema_ref_2b5e755404a4bfd7892291ce97c4968d import ( UnnamedSchemaRef2b5e755404a4bfd7892291ce97c4968d as UnnamedSchemaRef2b5e755404a4bfd7892291ce97c4968d, ) -from .unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad import ( - UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad as UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad, -) from .unnamed_schema_ref_669bfbb16c0913af7077c3c194fbfcd0 import ( UnnamedSchemaRef669bfbb16c0913af7077c3c194fbfcd0 as UnnamedSchemaRef669bfbb16c0913af7077c3c194fbfcd0, ) diff --git a/src/cloudflare/types/cache/cache_reserve.py b/src/cloudflare/types/cache/cache_reserve.py new file mode 100644 index 00000000000..2113d16a9fc --- /dev/null +++ b/src/cloudflare/types/cache/cache_reserve.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["CacheReserve"] + +CacheReserve = Literal["cache_reserve"] diff --git a/src/cloudflare/types/cache/cache_reserve_edit_response.py b/src/cloudflare/types/cache/cache_reserve_edit_response.py index f7c02261309..cf94dab2551 100644 --- a/src/cloudflare/types/cache/cache_reserve_edit_response.py +++ b/src/cloudflare/types/cache/cache_reserve_edit_response.py @@ -5,13 +5,13 @@ from typing_extensions import Literal from ..._models import BaseModel -from .unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad import UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad +from .cache_reserve import CacheReserve __all__ = ["CacheReserveEditResponse"] class CacheReserveEditResponse(BaseModel): - id: UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad + id: CacheReserve """ID of the zone setting.""" modified_on: Optional[datetime] = None diff --git a/src/cloudflare/types/cache/cache_reserve_get_response.py b/src/cloudflare/types/cache/cache_reserve_get_response.py index 2b9e0d8360b..78ddefe3883 100644 --- a/src/cloudflare/types/cache/cache_reserve_get_response.py +++ b/src/cloudflare/types/cache/cache_reserve_get_response.py @@ -5,13 +5,13 @@ from typing_extensions import Literal from ..._models import BaseModel -from .unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad import UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad +from .cache_reserve import CacheReserve __all__ = ["CacheReserveGetResponse"] class CacheReserveGetResponse(BaseModel): - id: UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad + id: CacheReserve """ID of the zone setting.""" modified_on: Optional[datetime] = None diff --git a/src/cloudflare/types/cache/unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad.py b/src/cloudflare/types/cache/unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad.py deleted file mode 100644 index c8d29abe593..00000000000 --- a/src/cloudflare/types/cache/unnamed_schema_ref_37c385b4ebac5c7a6475b3f81ef9a7ad.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -__all__ = ["UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad"] - -UnnamedSchemaRef37c385b4ebac5c7a6475b3f81ef9a7ad = Literal["cache_reserve"] diff --git a/src/cloudflare/types/load_balancers/__init__.py b/src/cloudflare/types/load_balancers/__init__.py index 1ddf89caabd..402466a6f48 100644 --- a/src/cloudflare/types/load_balancers/__init__.py +++ b/src/cloudflare/types/load_balancers/__init__.py @@ -13,8 +13,13 @@ from .monitor_edit_params import MonitorEditParams as MonitorEditParams from .region_get_response import RegionGetResponse as RegionGetResponse from .search_get_response import SearchGetResponse as SearchGetResponse +from .monitor_get_response import MonitorGetResponse as MonitorGetResponse from .pool_delete_response import PoolDeleteResponse as PoolDeleteResponse from .monitor_create_params import MonitorCreateParams as MonitorCreateParams from .monitor_delete_params import MonitorDeleteParams as MonitorDeleteParams +from .monitor_edit_response import MonitorEditResponse as MonitorEditResponse +from .monitor_list_response import MonitorListResponse as MonitorListResponse from .monitor_update_params import MonitorUpdateParams as MonitorUpdateParams +from .monitor_create_response import MonitorCreateResponse as MonitorCreateResponse from .monitor_delete_response import MonitorDeleteResponse as MonitorDeleteResponse +from .monitor_update_response import MonitorUpdateResponse as MonitorUpdateResponse diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_b52ad7cf99890d19f16edcd84d16ef5b.py b/src/cloudflare/types/load_balancers/monitor_create_response.py similarity index 96% rename from src/cloudflare/types/shared/unnamed_schema_ref_b52ad7cf99890d19f16edcd84d16ef5b.py rename to src/cloudflare/types/load_balancers/monitor_create_response.py index dab0b89d138..8089b74bcc5 100644 --- a/src/cloudflare/types/shared/unnamed_schema_ref_b52ad7cf99890d19f16edcd84d16ef5b.py +++ b/src/cloudflare/types/load_balancers/monitor_create_response.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b"] +__all__ = ["MonitorCreateResponse"] -class UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b(BaseModel): +class MonitorCreateResponse(BaseModel): id: Optional[str] = None allow_insecure: Optional[bool] = None diff --git a/src/cloudflare/types/load_balancers/monitor_edit_response.py b/src/cloudflare/types/load_balancers/monitor_edit_response.py new file mode 100644 index 00000000000..aeb05c5163b --- /dev/null +++ b/src/cloudflare/types/load_balancers/monitor_edit_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MonitorEditResponse"] + + +class MonitorEditResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/load_balancers/monitor_get_response.py b/src/cloudflare/types/load_balancers/monitor_get_response.py new file mode 100644 index 00000000000..8290d01dc43 --- /dev/null +++ b/src/cloudflare/types/load_balancers/monitor_get_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MonitorGetResponse"] + + +class MonitorGetResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/load_balancers/monitor_list_response.py b/src/cloudflare/types/load_balancers/monitor_list_response.py new file mode 100644 index 00000000000..9aa8ceb39c3 --- /dev/null +++ b/src/cloudflare/types/load_balancers/monitor_list_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MonitorListResponse"] + + +class MonitorListResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/load_balancers/monitor_update_response.py b/src/cloudflare/types/load_balancers/monitor_update_response.py new file mode 100644 index 00000000000..710f34caf93 --- /dev/null +++ b/src/cloudflare/types/load_balancers/monitor_update_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MonitorUpdateResponse"] + + +class MonitorUpdateResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/logpush/__init__.py b/src/cloudflare/types/logpush/__init__.py index f73721aa34f..395f3560aa8 100644 --- a/src/cloudflare/types/logpush/__init__.py +++ b/src/cloudflare/types/logpush/__init__.py @@ -9,6 +9,7 @@ from .edge_create_params import EdgeCreateParams as EdgeCreateParams from .instant_logpush_job import InstantLogpushJob as InstantLogpushJob from .job_delete_response import JobDeleteResponse as JobDeleteResponse +from .ownership_validation import OwnershipValidation as OwnershipValidation from .validate_origin_params import ValidateOriginParams as ValidateOriginParams from .ownership_create_params import OwnershipCreateParams as OwnershipCreateParams from .validate_origin_response import ValidateOriginResponse as ValidateOriginResponse diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_cc2ac1a037e5d6702fc77b3bcb527854.py b/src/cloudflare/types/logpush/ownership_validation.py similarity index 58% rename from src/cloudflare/types/shared/unnamed_schema_ref_cc2ac1a037e5d6702fc77b3bcb527854.py rename to src/cloudflare/types/logpush/ownership_validation.py index caa9da73a45..7cd567a2f45 100644 --- a/src/cloudflare/types/shared/unnamed_schema_ref_cc2ac1a037e5d6702fc77b3bcb527854.py +++ b/src/cloudflare/types/logpush/ownership_validation.py @@ -4,8 +4,8 @@ from ..._models import BaseModel -__all__ = ["UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854"] +__all__ = ["OwnershipValidation"] -class UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854(BaseModel): +class OwnershipValidation(BaseModel): valid: Optional[bool] = None diff --git a/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py b/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py index c6fe4b23fd5..6d18c1b2dff 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_industry_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ....shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from ...http import Browser from ....._models import BaseModel from ....unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ....unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TopIndustryResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py b/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py index b2b14bee5a7..417fae77085 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_vertical_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ....shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from ...http import Browser from ....._models import BaseModel from ....unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ....unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TopVerticalResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py b/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py index c6fe4b23fd5..6d18c1b2dff 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_industry_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ....shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from ...http import Browser from ....._models import BaseModel from ....unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ....unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TopIndustryResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py b/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py index b2b14bee5a7..417fae77085 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_vertical_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ....shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from ...http import Browser from ....._models import BaseModel from ....unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ....unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TopVerticalResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/email/security/top/tld_get_response.py b/src/cloudflare/types/radar/email/security/top/tld_get_response.py index 49ef0b7a363..0017f5c6517 100644 --- a/src/cloudflare/types/radar/email/security/top/tld_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tld_get_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from .....shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from ....http import Browser from ......_models import BaseModel from .....unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from .....unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TldGetResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py b/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py index deb4cc5dafe..514b54f2fe0 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ......shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from .....http import Browser from ......._models import BaseModel from ......unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ......unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class MaliciousGetResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py b/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py index 7e8ff1f3546..f6b6a0d279d 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/spam_get_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ......shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from .....http import Browser from ......._models import BaseModel from ......unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ......unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class SpamGetResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py b/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py index 50a0d8f3529..ac328832094 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ......shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from .....http import Browser from ......._models import BaseModel from ......unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ......unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class SpoofGetResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/http/__init__.py b/src/cloudflare/types/radar/http/__init__.py index e0fbe39c282..69bf6aa6074 100644 --- a/src/cloudflare/types/radar/http/__init__.py +++ b/src/cloudflare/types/radar/http/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .browser import Browser as Browser from .ase_get_params import AseGetParams as AseGetParams from .ase_get_response import AseGetResponse as AseGetResponse from .summary_os_params import SummaryOSParams as SummaryOSParams diff --git a/src/cloudflare/types/radar/http/browser.py b/src/cloudflare/types/radar/http/browser.py new file mode 100644 index 00000000000..48c2187f1d4 --- /dev/null +++ b/src/cloudflare/types/radar/http/browser.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ...._models import BaseModel + +__all__ = ["Browser"] + + +class Browser(BaseModel): + name: str + + value: str diff --git a/src/cloudflare/types/radar/http/top_browser_families_response.py b/src/cloudflare/types/radar/http/top_browser_families_response.py index 362cb415567..ee909f99589 100644 --- a/src/cloudflare/types/radar/http/top_browser_families_response.py +++ b/src/cloudflare/types/radar/http/top_browser_families_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ...shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from .browser import Browser from ...._models import BaseModel from ...unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ...unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TopBrowserFamiliesResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/radar/http/top_browsers_response.py b/src/cloudflare/types/radar/http/top_browsers_response.py index 548dc93c287..052b93a1321 100644 --- a/src/cloudflare/types/radar/http/top_browsers_response.py +++ b/src/cloudflare/types/radar/http/top_browsers_response.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ...shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 +from .browser import Browser from ...._models import BaseModel from ...unnamed_schema_ref_b5f3bd1840490bc487ffef84567807b1 import UnnamedSchemaRefB5f3bd1840490bc487ffef84567807b1 from ...unnamed_schema_ref_baac9d7da12de53e99142f8ecd3982e5 import UnnamedSchemaRefBaac9d7da12de53e99142f8ecd3982e5 @@ -29,4 +29,4 @@ class Meta(BaseModel): class TopBrowsersResponse(BaseModel): meta: Meta - top_0: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + top_0: List[Browser] diff --git a/src/cloudflare/types/shared/__init__.py b/src/cloudflare/types/shared/__init__.py index 520ddfdd28f..a93b1d9d2af 100644 --- a/src/cloudflare/types/shared/__init__.py +++ b/src/cloudflare/types/shared/__init__.py @@ -14,9 +14,6 @@ from .unnamed_schema_ref_70f2c6ccd8a405358ac7ef8fc3d6751c import ( UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c as UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c, ) -from .unnamed_schema_ref_2173d81a0b2d332c9e2ac46900fe8bb9 import ( - UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 as UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9, -) from .unnamed_schema_ref_23001f1f0b697900e282236466a95fa3 import ( UnnamedSchemaRef23001f1f0b697900e282236466a95fa3 as UnnamedSchemaRef23001f1f0b697900e282236466a95fa3, ) @@ -26,15 +23,6 @@ from .unnamed_schema_ref_619309774d07ec6904f1e354560d6028 import ( UnnamedSchemaRef619309774d07ec6904f1e354560d6028 as UnnamedSchemaRef619309774d07ec6904f1e354560d6028, ) -from .unnamed_schema_ref_b0ec5cc02c98b665099a5707a2db4ea6 import ( - UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6 as UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6, -) -from .unnamed_schema_ref_b52ad7cf99890d19f16edcd84d16ef5b import ( - UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b as UnnamedSchemaRefB52ad7cf99890d19f16edcd84d16ef5b, -) -from .unnamed_schema_ref_cc2ac1a037e5d6702fc77b3bcb527854 import ( - UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 as UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854, -) from .unnamed_schema_ref_ee1e79edcb234d14c4dd266880f2fd24 import ( UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24 as UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24, ) diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_2173d81a0b2d332c9e2ac46900fe8bb9.py b/src/cloudflare/types/shared/unnamed_schema_ref_2173d81a0b2d332c9e2ac46900fe8bb9.py deleted file mode 100644 index 64e74877ef0..00000000000 --- a/src/cloudflare/types/shared/unnamed_schema_ref_2173d81a0b2d332c9e2ac46900fe8bb9.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - - -from ..._models import BaseModel - -__all__ = ["UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9"] - - -class UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9(BaseModel): - name: str - - value: str diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_b0ec5cc02c98b665099a5707a2db4ea6.py b/src/cloudflare/types/shared/unnamed_schema_ref_b0ec5cc02c98b665099a5707a2db4ea6.py deleted file mode 100644 index aeab148302d..00000000000 --- a/src/cloudflare/types/shared/unnamed_schema_ref_b0ec5cc02c98b665099a5707a2db4ea6.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..load_balancers import Pool - -__all__ = ["UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6"] - -UnnamedSchemaRefB0ec5cc02c98b665099a5707a2db4ea6 = List[Pool] diff --git a/src/cloudflare/types/url_scanner/scan_get_response.py b/src/cloudflare/types/url_scanner/scan_get_response.py index 0e09b7bebd1..6afa38ffaa2 100644 --- a/src/cloudflare/types/url_scanner/scan_get_response.py +++ b/src/cloudflare/types/url_scanner/scan_get_response.py @@ -5,8 +5,8 @@ from pydantic import Field as FieldInfo -from ..shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 from ..._models import BaseModel +from ..radar.http import Browser from .unnamed_schema_ref_6d7a78acccfc753a8e931b1c4e72b6a6 import UnnamedSchemaRef6d7a78acccfc753a8e931b1c4e72b6a6 __all__ = [ @@ -239,7 +239,7 @@ class ScanPage(BaseModel): domain: str - headers: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + headers: List[Browser] ip: str diff --git a/src/cloudflare/types/url_scanner/scan_har_response.py b/src/cloudflare/types/url_scanner/scan_har_response.py index b2d8df130f7..d58f9ed3539 100644 --- a/src/cloudflare/types/url_scanner/scan_har_response.py +++ b/src/cloudflare/types/url_scanner/scan_har_response.py @@ -4,8 +4,8 @@ from pydantic import Field as FieldInfo -from ..shared import UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9 from ..._models import BaseModel +from ..radar.http import Browser __all__ = [ "ScanHarResponse", @@ -32,7 +32,7 @@ class HarLogCreator(BaseModel): class HarLogEntryRequest(BaseModel): body_size: float = FieldInfo(alias="bodySize") - headers: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + headers: List[Browser] headers_size: float = FieldInfo(alias="headersSize") @@ -58,7 +58,7 @@ class HarLogEntryResponse(BaseModel): content: HarLogEntryResponseContent - headers: List[UnnamedSchemaRef2173d81a0b2d332c9e2ac46900fe8bb9] + headers: List[Browser] headers_size: float = FieldInfo(alias="headersSize") diff --git a/src/cloudflare/types/user/load_balancers/__init__.py b/src/cloudflare/types/user/load_balancers/__init__.py index 2fdb708a73b..99f7696aa51 100644 --- a/src/cloudflare/types/user/load_balancers/__init__.py +++ b/src/cloudflare/types/user/load_balancers/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .monitor import Monitor as Monitor +from .pool import Pool as Pool from .preview import Preview as Preview from .analytics import Analytics as Analytics from .pool_edit_params import PoolEditParams as PoolEditParams @@ -12,14 +12,19 @@ from .pool_update_params import PoolUpdateParams as PoolUpdateParams from .monitor_edit_params import MonitorEditParams as MonitorEditParams from .pool_preview_params import PoolPreviewParams as PoolPreviewParams +from .monitor_get_response import MonitorGetResponse as MonitorGetResponse from .pool_delete_response import PoolDeleteResponse as PoolDeleteResponse from .pool_health_response import PoolHealthResponse as PoolHealthResponse from .monitor_create_params import MonitorCreateParams as MonitorCreateParams from .monitor_delete_params import MonitorDeleteParams as MonitorDeleteParams +from .monitor_edit_response import MonitorEditResponse as MonitorEditResponse +from .monitor_list_response import MonitorListResponse as MonitorListResponse from .monitor_update_params import MonitorUpdateParams as MonitorUpdateParams from .pool_preview_response import PoolPreviewResponse as PoolPreviewResponse from .monitor_preview_params import MonitorPreviewParams as MonitorPreviewParams +from .monitor_create_response import MonitorCreateResponse as MonitorCreateResponse from .monitor_delete_response import MonitorDeleteResponse as MonitorDeleteResponse +from .monitor_update_response import MonitorUpdateResponse as MonitorUpdateResponse from .monitor_preview_response import MonitorPreviewResponse as MonitorPreviewResponse from .pool_references_response import PoolReferencesResponse as PoolReferencesResponse from .monitor_references_response import MonitorReferencesResponse as MonitorReferencesResponse diff --git a/src/cloudflare/types/user/load_balancers/monitor_create_response.py b/src/cloudflare/types/user/load_balancers/monitor_create_response.py new file mode 100644 index 00000000000..e0635d6b875 --- /dev/null +++ b/src/cloudflare/types/user/load_balancers/monitor_create_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MonitorCreateResponse"] + + +class MonitorCreateResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/user/load_balancers/monitor_edit_response.py b/src/cloudflare/types/user/load_balancers/monitor_edit_response.py new file mode 100644 index 00000000000..756de508e00 --- /dev/null +++ b/src/cloudflare/types/user/load_balancers/monitor_edit_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MonitorEditResponse"] + + +class MonitorEditResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/user/load_balancers/monitor.py b/src/cloudflare/types/user/load_balancers/monitor_get_response.py similarity index 97% rename from src/cloudflare/types/user/load_balancers/monitor.py rename to src/cloudflare/types/user/load_balancers/monitor_get_response.py index 716caa49ec0..71cda006b73 100644 --- a/src/cloudflare/types/user/load_balancers/monitor.py +++ b/src/cloudflare/types/user/load_balancers/monitor_get_response.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["Monitor"] +__all__ = ["MonitorGetResponse"] -class Monitor(BaseModel): +class MonitorGetResponse(BaseModel): id: Optional[str] = None allow_insecure: Optional[bool] = None diff --git a/src/cloudflare/types/user/load_balancers/monitor_list_response.py b/src/cloudflare/types/user/load_balancers/monitor_list_response.py new file mode 100644 index 00000000000..a580ccb4f68 --- /dev/null +++ b/src/cloudflare/types/user/load_balancers/monitor_list_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MonitorListResponse"] + + +class MonitorListResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/user/load_balancers/monitor_update_response.py b/src/cloudflare/types/user/load_balancers/monitor_update_response.py new file mode 100644 index 00000000000..db59e3db72b --- /dev/null +++ b/src/cloudflare/types/user/load_balancers/monitor_update_response.py @@ -0,0 +1,113 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MonitorUpdateResponse"] + + +class MonitorUpdateResponse(BaseModel): + id: Optional[str] = None + + allow_insecure: Optional[bool] = None + """Do not validate the certificate when monitor use HTTPS. + + This parameter is currently only valid for HTTP and HTTPS monitors. + """ + + consecutive_down: Optional[int] = None + """ + To be marked unhealthy the monitored origin must fail this healthcheck N + consecutive times. + """ + + consecutive_up: Optional[int] = None + """ + To be marked healthy the monitored origin must pass this healthcheck N + consecutive times. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """Object description.""" + + expected_body: Optional[str] = None + """A case-insensitive sub-string to look for in the response body. + + If this string is not found, the origin will be marked as unhealthy. This + parameter is only valid for HTTP and HTTPS monitors. + """ + + expected_codes: Optional[str] = None + """The expected HTTP response code or code range of the health check. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + follow_redirects: Optional[bool] = None + """Follow redirects if returned by the origin. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + header: Optional[object] = None + """The HTTP request headers to send in the health check. + + It is recommended you set a Host header by default. The User-Agent header cannot + be overridden. This parameter is only valid for HTTP and HTTPS monitors. + """ + + interval: Optional[int] = None + """The interval between each health check. + + Shorter intervals may improve failover time, but will increase load on the + origins as we check from multiple locations. + """ + + method: Optional[str] = None + """The method to use for the health check. + + This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' + for TCP based health checks. + """ + + modified_on: Optional[datetime] = None + + path: Optional[str] = None + """The endpoint path you want to conduct a health check against. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + port: Optional[int] = None + """The port number to connect to for the health check. + + Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define + the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). + """ + + probe_zone: Optional[str] = None + """Assign this monitor to emulate the specified zone while probing. + + This parameter is only valid for HTTP and HTTPS monitors. + """ + + retries: Optional[int] = None + """ + The number of retries to attempt in case of a timeout before marking the origin + as unhealthy. Retries are attempted immediately. + """ + + timeout: Optional[int] = None + """The timeout (in seconds) before marking the health check as failed.""" + + type: Optional[Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"]] = None + """The protocol to use for the health check. + + Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', + 'UDP-ICMP', and 'SMTP'. + """ diff --git a/src/cloudflare/types/user/load_balancers/pool.py b/src/cloudflare/types/user/load_balancers/pool.py new file mode 100644 index 00000000000..4083c2a1157 --- /dev/null +++ b/src/cloudflare/types/user/load_balancers/pool.py @@ -0,0 +1,107 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...origin import Origin +from ...._models import BaseModel +from ...check_region import CheckRegion +from ...load_shedding import LoadShedding +from ...origin_steering import OriginSteering +from ...notification_filter import NotificationFilter + +__all__ = ["Pool"] + + +class Pool(BaseModel): + id: Optional[str] = None + + check_regions: Optional[List[CheckRegion]] = None + """A list of regions from which to run health checks. + + Null means every Cloudflare data center. + """ + + created_on: Optional[datetime] = None + + description: Optional[str] = None + """A human-readable description of the pool.""" + + disabled_at: Optional[datetime] = None + """This field shows up only if the pool is disabled. + + This field is set with the time the pool was disabled at. + """ + + enabled: Optional[bool] = None + """Whether to enable (the default) or disable this pool. + + Disabled pools will not receive traffic and are excluded from health checks. + Disabling a pool will cause any load balancers using it to failover to the next + pool (if any). + """ + + latitude: Optional[float] = None + """ + The latitude of the data center containing the origins used in this pool in + decimal degrees. If this is set, longitude must also be set. + """ + + load_shedding: Optional[LoadShedding] = None + """Configures load shedding policies and percentages for the pool.""" + + longitude: Optional[float] = None + """ + The longitude of the data center containing the origins used in this pool in + decimal degrees. If this is set, latitude must also be set. + """ + + minimum_origins: Optional[int] = None + """ + The minimum number of origins that must be healthy for this pool to serve + traffic. If the number of healthy origins falls below this number, the pool will + be marked unhealthy and will failover to the next available pool. + """ + + modified_on: Optional[datetime] = None + + monitor: Optional[object] = None + """ + The ID of the Monitor to use for checking the health of origins within this + pool. + """ + + name: Optional[str] = None + """A short name (tag) for the pool. + + Only alphanumeric characters, hyphens, and underscores are allowed. + """ + + notification_email: Optional[str] = None + """This field is now deprecated. + + It has been moved to Cloudflare's Centralized Notification service + https://developers.cloudflare.com/fundamentals/notifications/. The email address + to send health status notifications to. This can be an individual mailbox or a + mailing list. Multiple emails can be supplied as a comma delimited list. + """ + + notification_filter: Optional[NotificationFilter] = None + """Filter pool and origin health notifications by resource type or health status. + + Use null to reset. + """ + + origin_steering: Optional[OriginSteering] = None + """Configures origin steering for the pool. + + Controls how origins are selected for new sessions and traffic without session + affinity. + """ + + origins: Optional[List[Origin]] = None + """The list of origins within this pool. + + Traffic directed at this pool is balanced across all currently healthy origins, + provided the pool itself is healthy. + """ diff --git a/src/cloudflare/types/waiting_rooms/__init__.py b/src/cloudflare/types/waiting_rooms/__init__.py index 0d1414bcc8d..aace334e939 100644 --- a/src/cloudflare/types/waiting_rooms/__init__.py +++ b/src/cloudflare/types/waiting_rooms/__init__.py @@ -4,6 +4,7 @@ from .rule import Rule as Rule from .event import Event as Event +from .setting import Setting as Setting from .rule_edit_params import RuleEditParams as RuleEditParams from .event_edit_params import EventEditParams as EventEditParams from .rule_create_params import RuleCreateParams as RuleCreateParams diff --git a/src/cloudflare/types/waiting_rooms/setting.py b/src/cloudflare/types/waiting_rooms/setting.py new file mode 100644 index 00000000000..62555a567ef --- /dev/null +++ b/src/cloudflare/types/waiting_rooms/setting.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["Setting"] + + +class Setting(BaseModel): + search_engine_crawler_bypass: bool + """ + Whether to allow verified search engine crawlers to bypass all waiting rooms on + this zone. Verified search engine crawlers will not be tracked or counted by the + waiting room system, and will not appear in waiting room analytics. + """ diff --git a/src/cloudflare/types/workers/scripts/__init__.py b/src/cloudflare/types/workers/scripts/__init__.py index e55a1ffa5b3..f9ca689a984 100644 --- a/src/cloudflare/types/workers/scripts/__init__.py +++ b/src/cloudflare/types/workers/scripts/__init__.py @@ -2,6 +2,8 @@ from __future__ import annotations +from .deployment import Deployment as Deployment +from .deployment_param import DeploymentParam as DeploymentParam from .tail_get_response import TailGetResponse as TailGetResponse from .tail_create_params import TailCreateParams as TailCreateParams from .tail_delete_params import TailDeleteParams as TailDeleteParams @@ -24,9 +26,3 @@ from .unnamed_schema_ref_c8302c265937f9d6f96fd69644e56b26 import ( UnnamedSchemaRefC8302c265937f9d6f96fd69644e56b26 as UnnamedSchemaRefC8302c265937f9d6f96fd69644e56b26, ) -from .unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8 import ( - UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8 as UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8, -) -from .unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8_param import ( - UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param as UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param, -) diff --git a/src/cloudflare/types/workers/scripts/unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8.py b/src/cloudflare/types/workers/scripts/deployment.py similarity index 72% rename from src/cloudflare/types/workers/scripts/unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8.py rename to src/cloudflare/types/workers/scripts/deployment.py index 7954f5006f9..a07f4231c28 100644 --- a/src/cloudflare/types/workers/scripts/unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8.py +++ b/src/cloudflare/types/workers/scripts/deployment.py @@ -6,9 +6,9 @@ from ...._models import BaseModel -__all__ = ["UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8"] +__all__ = ["Deployment"] -class UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8(BaseModel): +class Deployment(BaseModel): workers_message: Optional[str] = FieldInfo(alias="workers/message", default=None) """Human-readable message about the deployment.""" diff --git a/src/cloudflare/types/workers/scripts/deployment_create_params.py b/src/cloudflare/types/workers/scripts/deployment_create_params.py index ff9c06c169a..e9f1f6b7a17 100644 --- a/src/cloudflare/types/workers/scripts/deployment_create_params.py +++ b/src/cloudflare/types/workers/scripts/deployment_create_params.py @@ -4,9 +4,7 @@ from typing_extensions import Required, TypedDict -from .unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8_param import ( - UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param, -) +from .deployment_param import DeploymentParam __all__ = ["DeploymentCreateParams"] @@ -15,6 +13,6 @@ class DeploymentCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - annotations: UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param + annotations: DeploymentParam strategy: str diff --git a/src/cloudflare/types/workers/scripts/deployment_create_response.py b/src/cloudflare/types/workers/scripts/deployment_create_response.py index 205e144fd99..8625732c33c 100644 --- a/src/cloudflare/types/workers/scripts/deployment_create_response.py +++ b/src/cloudflare/types/workers/scripts/deployment_create_response.py @@ -3,7 +3,7 @@ from typing import Optional from ...._models import BaseModel -from .unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8 import UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8 +from .deployment import Deployment __all__ = ["DeploymentCreateResponse"] @@ -11,7 +11,7 @@ class DeploymentCreateResponse(BaseModel): id: Optional[str] = None - annotations: Optional[UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8] = None + annotations: Optional[Deployment] = None author_email: Optional[str] = None diff --git a/src/cloudflare/types/workers/scripts/deployment_get_response.py b/src/cloudflare/types/workers/scripts/deployment_get_response.py index 854a1dbac8c..9224f4034cc 100644 --- a/src/cloudflare/types/workers/scripts/deployment_get_response.py +++ b/src/cloudflare/types/workers/scripts/deployment_get_response.py @@ -2,8 +2,8 @@ from typing import List, Optional +from . import deployment from ...._models import BaseModel -from .unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8 import UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8 __all__ = ["DeploymentGetResponse", "Deployment"] @@ -11,7 +11,7 @@ class Deployment(BaseModel): id: Optional[str] = None - annotations: Optional[UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8] = None + annotations: Optional[deployment.Deployment] = None author_email: Optional[str] = None diff --git a/src/cloudflare/types/workers/scripts/unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8_param.py b/src/cloudflare/types/workers/scripts/deployment_param.py similarity index 69% rename from src/cloudflare/types/workers/scripts/unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8_param.py rename to src/cloudflare/types/workers/scripts/deployment_param.py index c2993691717..c25292cba40 100644 --- a/src/cloudflare/types/workers/scripts/unnamed_schema_ref_fda1c6f6758e763ae3b2964521f2fdd8_param.py +++ b/src/cloudflare/types/workers/scripts/deployment_param.py @@ -6,9 +6,9 @@ from ...._utils import PropertyInfo -__all__ = ["UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param"] +__all__ = ["DeploymentParam"] -class UnnamedSchemaRefFda1c6f6758e763ae3b2964521f2fdd8Param(TypedDict, total=False): +class DeploymentParam(TypedDict, total=False): workers_message: Annotated[str, PropertyInfo(alias="workers/message")] """Human-readable message about the deployment.""" diff --git a/tests/api_resources/load_balancers/test_monitors.py b/tests/api_resources/load_balancers/test_monitors.py index 662cd697a31..0bb56cc5368 100644 --- a/tests/api_resources/load_balancers/test_monitors.py +++ b/tests/api_resources/load_balancers/test_monitors.py @@ -11,9 +11,13 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.load_balancers import ( + MonitorGetResponse, + MonitorEditResponse, + MonitorListResponse, + MonitorCreateResponse, MonitorDeleteResponse, + MonitorUpdateResponse, ) -from cloudflare.types.user.load_balancers import Monitor base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +32,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +59,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -68,7 +72,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +85,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -102,7 +106,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +134,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -144,7 +148,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -158,7 +162,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -185,7 +189,7 @@ def test_method_list(self, client: Cloudflare) -> None: monitor = client.load_balancers.monitors.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(SyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -197,7 +201,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(SyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(SyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -209,7 +213,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(SyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(SyncSinglePage[MonitorListResponse], monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -286,7 +290,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -314,7 +318,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -328,7 +332,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -342,7 +346,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -370,7 +374,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -383,7 +387,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -396,7 +400,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -426,7 +430,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -453,7 +457,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -466,7 +470,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -479,7 +483,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -500,7 +504,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -528,7 +532,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -542,7 +546,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -556,7 +560,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -583,7 +587,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: monitor = await async_client.load_balancers.monitors.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(AsyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -595,7 +599,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(AsyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(AsyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -607,7 +611,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(AsyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(AsyncSinglePage[MonitorListResponse], monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -684,7 +688,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -712,7 +716,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -726,7 +730,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -740,7 +744,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -768,7 +772,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -781,7 +785,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -794,7 +798,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/load_balancers/test_pools.py b/tests/api_resources/load_balancers/test_pools.py index da5c771f17b..75d188bc943 100644 --- a/tests/api_resources/load_balancers/test_pools.py +++ b/tests/api_resources/load_balancers/test_pools.py @@ -11,9 +11,9 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.load_balancers import ( - Pool, PoolDeleteResponse, ) +from cloudflare.types.user.load_balancers import Pool base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/logpush/test_ownership.py b/tests/api_resources/logpush/test_ownership.py index 773105d19db..034653393d7 100644 --- a/tests/api_resources/logpush/test_ownership.py +++ b/tests/api_resources/logpush/test_ownership.py @@ -9,8 +9,10 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.shared import UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 -from cloudflare.types.logpush import OwnershipCreateResponse +from cloudflare.types.logpush import ( + OwnershipValidation, + OwnershipCreateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -94,7 +96,7 @@ def test_method_validate(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +107,7 @@ def test_method_validate_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -120,7 +122,7 @@ def test_raw_response_validate(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,9 +137,7 @@ def test_streaming_response_validate(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type( - Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"] - ) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +240,7 @@ async def test_method_validate(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -251,7 +251,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncCloudfla account_id="string", zone_id="string", ) - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -266,7 +266,7 @@ async def test_raw_response_validate(self, async_client: AsyncCloudflare) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -281,9 +281,7 @@ async def test_streaming_response_validate(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type( - Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], ownership, path=["response"] - ) + assert_matches_type(Optional[OwnershipValidation], ownership, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/load_balancers/test_monitors.py b/tests/api_resources/user/load_balancers/test_monitors.py index 5050fb3346a..2c2955c7342 100644 --- a/tests/api_resources/user/load_balancers/test_monitors.py +++ b/tests/api_resources/user/load_balancers/test_monitors.py @@ -11,8 +11,12 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.user.load_balancers import ( - Monitor, + MonitorGetResponse, + MonitorEditResponse, + MonitorListResponse, + MonitorCreateResponse, MonitorDeleteResponse, + MonitorUpdateResponse, MonitorPreviewResponse, MonitorReferencesResponse, ) @@ -29,7 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: monitor = client.user.load_balancers.monitors.create( expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +59,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +71,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -79,7 +83,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -90,7 +94,7 @@ def test_method_update(self, client: Cloudflare) -> None: "f1aba936b94213e5b8dca0c0dbf1f9cc", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -117,7 +121,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +134,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -143,7 +147,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -160,7 +164,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: monitor = client.user.load_balancers.monitors.list() - assert_matches_type(SyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(SyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -170,7 +174,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(SyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(SyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -180,7 +184,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(SyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(SyncSinglePage[MonitorListResponse], monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -237,7 +241,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "f1aba936b94213e5b8dca0c0dbf1f9cc", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -264,7 +268,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -277,7 +281,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -290,7 +294,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -309,7 +313,7 @@ def test_method_get(self, client: Cloudflare) -> None: monitor = client.user.load_balancers.monitors.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -321,7 +325,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" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -333,7 +337,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -470,7 +474,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: monitor = await async_client.user.load_balancers.monitors.create( expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -496,7 +500,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -508,7 +512,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -520,7 +524,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorCreateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -531,7 +535,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "f1aba936b94213e5b8dca0c0dbf1f9cc", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -558,7 +562,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -571,7 +575,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -584,7 +588,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorUpdateResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -601,7 +605,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: monitor = await async_client.user.load_balancers.monitors.list() - assert_matches_type(AsyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(AsyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -611,7 +615,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(AsyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(AsyncSinglePage[MonitorListResponse], monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -621,7 +625,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(AsyncSinglePage[Monitor], monitor, path=["response"]) + assert_matches_type(AsyncSinglePage[MonitorListResponse], monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -678,7 +682,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "f1aba936b94213e5b8dca0c0dbf1f9cc", expected_codes="2xx", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -705,7 +709,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) load_balancer_monitor_timeout=0, type="https", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -718,7 +722,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -731,7 +735,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorEditResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True @@ -750,7 +754,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: monitor = await async_client.user.load_balancers.monitors.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", ) - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -762,7 +766,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" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) @pytest.mark.skip() @parametrize @@ -774,7 +778,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" monitor = await response.parse() - assert_matches_type(Monitor, monitor, path=["response"]) + assert_matches_type(MonitorGetResponse, monitor, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/load_balancers/test_pools.py b/tests/api_resources/user/load_balancers/test_pools.py index 4875ba28f5e..32c46bceded 100644 --- a/tests/api_resources/user/load_balancers/test_pools.py +++ b/tests/api_resources/user/load_balancers/test_pools.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.load_balancers import Pool from cloudflare.types.user.load_balancers import ( + Pool, PoolDeleteResponse, PoolHealthResponse, PoolPreviewResponse, diff --git a/tests/api_resources/zero_trust/dlp/test_patterns.py b/tests/api_resources/zero_trust/dlp/test_patterns.py index d51b48494bf..4f3c0ded98d 100644 --- a/tests/api_resources/zero_trust/dlp/test_patterns.py +++ b/tests/api_resources/zero_trust/dlp/test_patterns.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.shared import UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 +from cloudflare.types.logpush import OwnershipValidation base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_validate(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", regex="^4[0-9]{6,}$", ) - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], pattern, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], pattern, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_validate(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pattern = response.parse() - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], pattern, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], pattern, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_validate(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pattern = response.parse() - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], pattern, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], pattern, path=["response"]) assert cast(Any, response.is_closed) is True @@ -74,7 +74,7 @@ async def test_method_validate(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", regex="^4[0-9]{6,}$", ) - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], pattern, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], pattern, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +87,7 @@ async def test_raw_response_validate(self, async_client: AsyncCloudflare) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pattern = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], pattern, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], pattern, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ async def test_streaming_response_validate(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" pattern = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854], pattern, path=["response"]) + assert_matches_type(Optional[OwnershipValidation], pattern, path=["response"]) assert cast(Any, response.is_closed) is True