From 37163eafc0304e92604fd8cec5df0807b2b512c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 04:59:10 +0000 Subject: [PATCH] feat: update via SDK Studio (#43) --- api.md | 72 ++-- .../resources/access/users/failed_logins.py | 36 +- src/cloudflare/resources/acms/total_tls.py | 34 +- src/cloudflare/resources/certificates.py | 284 +++++++------- .../resources/custom_ns/verifies.py | 30 +- src/cloudflare/resources/logpush/edges.py | 34 +- .../mtls_certificates/mtls_certificates.py | 36 +- src/cloudflare/resources/ssls/analyzes.py | 41 ++- .../certificate_packs/certificate_packs.py | 132 ++++--- .../ssls/certificate_packs/orders.py | 43 ++- .../ssls/certificate_packs/quotas.py | 36 +- src/cloudflare/resources/stream/stream.py | 36 +- src/cloudflare/resources/subscriptions.py | 284 +++++++------- .../resources/teamnets/routes/networks.py | 36 +- src/cloudflare/resources/zones/__init__.py | 26 +- .../resources/zones/{holds.py => hold.py} | 70 ++-- src/cloudflare/resources/zones/zones.py | 38 +- src/cloudflare/types/__init__.py | 32 +- src/cloudflare/types/access/users/__init__.py | 4 +- .../access/users/failed_login_get_response.py | 16 - ..._trust_users_get_failed_logins_response.py | 16 + src/cloudflare/types/acms/__init__.py | 4 +- ...e_params.py => total_tls_update_params.py} | 4 +- ...sponse.py => total_tls_update_response.py} | 4 +- .../types/certificate_create_response.py | 7 - ...te_origin_ca_create_certificate_params.py} | 4 +- ...e_origin_ca_create_certificate_response.py | 7 + ...e_origin_ca_list_certificates_response.py} | 6 +- src/cloudflare/types/custom_ns/__init__.py | 2 +- ..._response.py => verify_update_response.py} | 10 +- src/cloudflare/types/logpush/__init__.py | 4 +- ...create_params.py => edge_update_params.py} | 4 +- ...te_response.py => edge_update_response.py} | 4 +- ...s.py => mtls_certificate_update_params.py} | 4 +- ...py => mtls_certificate_update_response.py} | 4 +- src/cloudflare/types/ssls/__init__.py | 16 +- ...certificate_analyze_certificate_params.py} | 4 +- ...ertificate_analyze_certificate_response.py | 7 + .../types/ssls/analyze_create_response.py | 7 - ...te_packs_list_certificate_packs_params.py} | 4 +- ...e_packs_list_certificate_packs_response.py | 7 + .../ssls/certificate_pack_list_response.py | 7 - .../types/ssls/certificate_packs/__init__.py | 12 +- ...ficate_manager_certificate_pack_params.py} | 4 +- ...cate_manager_certificate_pack_response.py} | 4 +- ...s_get_certificate_pack_quotas_response.py} | 4 +- ...eate_params.py => stream_update_params.py} | 4 +- ..._response.py => stream_update_response.py} | 4 +- .../types/subscription_create_response.py | 7 - .../types/subscription_get_response.py | 7 - ...iption_create_zone_subscription_params.py} | 4 +- ...ption_create_zone_subscription_response.py | 7 + ...tion_zone_subscription_details_response.py | 7 + .../types/teamnets/routes/__init__.py | 4 +- ...ate_params.py => network_update_params.py} | 4 +- ...response.py => network_update_response.py} | 4 +- .../access/users/test_failed_logins.py | 54 +-- tests/api_resources/acms/test_total_tls.py | 58 +-- .../api_resources/custom_ns/test_verifies.py | 46 +-- tests/api_resources/logpush/test_edges.py | 58 +-- .../ssls/certificate_packs/test_orders.py | 126 ++++--- .../ssls/certificate_packs/test_quotas.py | 52 +-- tests/api_resources/ssls/test_analyzes.py | 64 ++-- .../ssls/test_certificate_packs.py | 190 +++++----- .../teamnets/routes/test_networks.py | 62 ++-- tests/api_resources/test_certificates.py | 196 +++++----- tests/api_resources/test_mtls_certificates.py | 58 +-- tests/api_resources/test_stream.py | 62 ++-- tests/api_resources/test_subscriptions.py | 348 ++++++++++-------- .../zones/{test_holds.py => test_hold.py} | 60 +-- 70 files changed, 1574 insertions(+), 1392 deletions(-) rename src/cloudflare/resources/zones/{holds.py => hold.py} (90%) delete mode 100644 src/cloudflare/types/access/users/failed_login_get_response.py create mode 100644 src/cloudflare/types/access/users/failed_login_zero_trust_users_get_failed_logins_response.py rename src/cloudflare/types/acms/{total_tls_create_params.py => total_tls_update_params.py} (84%) rename src/cloudflare/types/acms/{total_tls_create_response.py => total_tls_update_response.py} (89%) delete mode 100644 src/cloudflare/types/certificate_create_response.py rename src/cloudflare/types/{certificate_create_params.py => certificate_origin_ca_create_certificate_params.py} (85%) create mode 100644 src/cloudflare/types/certificate_origin_ca_create_certificate_response.py rename src/cloudflare/types/{certificate_list_response.py => certificate_origin_ca_list_certificates_response.py} (78%) rename src/cloudflare/types/custom_ns/{verify_create_response.py => verify_update_response.py} (69%) rename src/cloudflare/types/logpush/{edge_create_params.py => edge_update_params.py} (84%) rename src/cloudflare/types/logpush/{edge_create_response.py => edge_update_response.py} (90%) rename src/cloudflare/types/{mtls_certificate_create_params.py => mtls_certificate_update_params.py} (82%) rename src/cloudflare/types/{mtls_certificate_create_response.py => mtls_certificate_update_response.py} (91%) rename src/cloudflare/types/ssls/{analyze_create_params.py => analyze_analyze_certificate_analyze_certificate_params.py} (80%) create mode 100644 src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_response.py delete mode 100644 src/cloudflare/types/ssls/analyze_create_response.py rename src/cloudflare/types/ssls/{certificate_pack_list_params.py => certificate_pack_certificate_packs_list_certificate_packs_params.py} (60%) create mode 100644 src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_response.py delete mode 100644 src/cloudflare/types/ssls/certificate_pack_list_response.py rename src/cloudflare/types/ssls/certificate_packs/{order_create_params.py => order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params.py} (86%) rename src/cloudflare/types/ssls/certificate_packs/{order_create_response.py => order_certificate_packs_order_advanced_certificate_manager_certificate_pack_response.py} (91%) rename src/cloudflare/types/ssls/certificate_packs/{quota_get_response.py => quota_certificate_packs_get_certificate_pack_quotas_response.py} (67%) rename src/cloudflare/types/{stream_create_params.py => stream_update_params.py} (96%) rename src/cloudflare/types/{stream_create_response.py => stream_update_response.py} (98%) delete mode 100644 src/cloudflare/types/subscription_create_response.py delete mode 100644 src/cloudflare/types/subscription_get_response.py rename src/cloudflare/types/{subscription_create_params.py => subscription_zone_subscription_create_zone_subscription_params.py} (88%) create mode 100644 src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_response.py create mode 100644 src/cloudflare/types/subscription_zone_subscription_zone_subscription_details_response.py rename src/cloudflare/types/teamnets/routes/{network_create_params.py => network_update_params.py} (85%) rename src/cloudflare/types/teamnets/routes/{network_create_response.py => network_update_response.py} (92%) rename tests/api_resources/zones/{test_holds.py => test_hold.py} (85%) diff --git a/api.md b/api.md index 5ce19b552db..d34e102455e 100644 --- a/api.md +++ b/api.md @@ -18,19 +18,19 @@ Types: ```python from cloudflare.types import ( - CertificateCreateResponse, - CertificateListResponse, CertificateDeleteResponse, CertificateGetResponse, + CertificateOriginCaCreateCertificateResponse, + CertificateOriginCaListCertificatesResponse, ) ``` Methods: -- client.certificates.create(\*\*params) -> CertificateCreateResponse -- client.certificates.list() -> Optional - client.certificates.delete(certificate_id) -> CertificateDeleteResponse - client.certificates.get(certificate_id) -> CertificateGetResponse +- client.certificates.origin_ca_create_certificate(\*\*params) -> CertificateOriginCaCreateCertificateResponse +- client.certificates.origin_ca_list_certificates() -> Optional # IPs @@ -419,7 +419,7 @@ Methods: - client.zones.delete(zone_id) -> Optional - client.zones.get(zone_id) -> Optional -## Holds +## Hold Types: @@ -429,9 +429,9 @@ from cloudflare.types.zones import HoldEnforceResponse, HoldGetResponse, HoldRem Methods: -- client.zones.holds.enforce(zone_id, \*\*params) -> HoldEnforceResponse -- client.zones.holds.get(zone_id) -> HoldGetResponse -- client.zones.holds.remove(zone_id, \*\*params) -> Optional +- client.zones.hold.enforce(zone_id, \*\*params) -> HoldEnforceResponse +- client.zones.hold.get(zone_id) -> HoldGetResponse +- client.zones.hold.remove(zone_id, \*\*params) -> Optional # AI @@ -973,12 +973,12 @@ Methods: Types: ```python -from cloudflare.types.access.users import FailedLoginGetResponse +from cloudflare.types.access.users import FailedLoginZeroTrustUsersGetFailedLoginsResponse ``` Methods: -- client.access.users.failed_logins.get(id, \*, identifier) -> Optional +- client.access.users.failed_logins.zero_trust_users_get_failed_logins(id, \*, identifier) -> Optional ## CustomPages @@ -1059,12 +1059,12 @@ Methods: Types: ```python -from cloudflare.types.ssls import AnalyzeCreateResponse +from cloudflare.types.ssls import AnalyzeAnalyzeCertificateAnalyzeCertificateResponse ``` Methods: -- client.ssls.analyzes.create(zone_id, \*\*params) -> AnalyzeCreateResponse +- client.ssls.analyzes.analyze_certificate_analyze_certificate(zone_id, \*\*params) -> AnalyzeAnalyzeCertificateAnalyzeCertificateResponse ## CertificatePacks @@ -1073,8 +1073,8 @@ Types: ```python from cloudflare.types.ssls import ( CertificatePackUpdateResponse, - CertificatePackListResponse, CertificatePackDeleteResponse, + CertificatePackCertificatePacksListCertificatePacksResponse, CertificatePackGetResponse, ) ``` @@ -1082,8 +1082,8 @@ from cloudflare.types.ssls import ( Methods: - client.ssls.certificate_packs.update(certificate_pack_id, \*, zone_id) -> CertificatePackUpdateResponse -- client.ssls.certificate_packs.list(zone_id, \*\*params) -> Optional - client.ssls.certificate_packs.delete(certificate_pack_id, \*, zone_id) -> CertificatePackDeleteResponse +- client.ssls.certificate_packs.certificate_packs_list_certificate_packs(zone_id, \*\*params) -> Optional - client.ssls.certificate_packs.get(certificate_pack_id, \*, zone_id) -> CertificatePackGetResponse ### Orders @@ -1091,24 +1091,28 @@ Methods: Types: ```python -from cloudflare.types.ssls.certificate_packs import OrderCreateResponse +from cloudflare.types.ssls.certificate_packs import ( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, +) ``` Methods: -- client.ssls.certificate_packs.orders.create(zone_id, \*\*params) -> OrderCreateResponse +- client.ssls.certificate_packs.orders.certificate_packs_order_advanced_certificate_manager_certificate_pack(zone_id, \*\*params) -> OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse ### Quotas Types: ```python -from cloudflare.types.ssls.certificate_packs import QuotaGetResponse +from cloudflare.types.ssls.certificate_packs import ( + QuotaCertificatePacksGetCertificatePackQuotasResponse, +) ``` Methods: -- client.ssls.certificate_packs.quotas.get(zone_id) -> QuotaGetResponse +- client.ssls.certificate_packs.quotas.certificate_packs_get_certificate_pack_quotas(zone_id) -> QuotaCertificatePacksGetCertificatePackQuotasResponse ## Recommendations @@ -1159,25 +1163,25 @@ Types: ```python from cloudflare.types import ( - SubscriptionCreateResponse, SubscriptionUpdateResponse, SubscriptionDeleteResponse, SubscriptionAccountSubscriptionsCreateSubscriptionResponse, SubscriptionAccountSubscriptionsListSubscriptionsResponse, - SubscriptionGetResponse, + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse, + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, ) ``` Methods: -- client.subscriptions.create(identifier, \*\*params) -> SubscriptionCreateResponse - client.subscriptions.update(subscription_identifier, \*, account_identifier, \*\*params) -> SubscriptionUpdateResponse - client.subscriptions.delete(subscription_identifier, \*, account_identifier) -> SubscriptionDeleteResponse - client.subscriptions.account_subscriptions_create_subscription(account_identifier, \*\*params) -> SubscriptionAccountSubscriptionsCreateSubscriptionResponse - client.subscriptions.account_subscriptions_list_subscriptions(account_identifier) -> Optional -- client.subscriptions.get(identifier) -> SubscriptionGetResponse +- client.subscriptions.zone_subscription_create_zone_subscription(identifier, \*\*params) -> SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse - client.subscriptions.zone_subscription_update_zone_subscription(identifier, \*\*params) -> SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse +- client.subscriptions.zone_subscription_zone_subscription_details(identifier) -> SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse # Acms @@ -1186,12 +1190,12 @@ Methods: Types: ```python -from cloudflare.types.acms import TotalTLSCreateResponse, TotalTLSGetResponse +from cloudflare.types.acms import TotalTLSUpdateResponse, TotalTLSGetResponse ``` Methods: -- client.acms.total_tls.create(zone_id, \*\*params) -> TotalTLSCreateResponse +- client.acms.total_tls.update(zone_id, \*\*params) -> TotalTLSUpdateResponse - client.acms.total_tls.get(zone_id) -> TotalTLSGetResponse # Analytics @@ -1503,12 +1507,12 @@ Methods: Types: ```python -from cloudflare.types.custom_ns import VerifyCreateResponse +from cloudflare.types.custom_ns import VerifyUpdateResponse ``` Methods: -- client.custom_ns.verifies.create(account_id) -> Optional +- client.custom_ns.verifies.update(account_id) -> Optional # DNSRecords @@ -1945,12 +1949,12 @@ Methods: Types: ```python -from cloudflare.types.logpush import EdgeCreateResponse, EdgeGetResponse +from cloudflare.types.logpush import EdgeUpdateResponse, EdgeGetResponse ``` Methods: -- client.logpush.edges.create(zone_id, \*\*params) -> Optional +- client.logpush.edges.update(zone_id, \*\*params) -> Optional - client.logpush.edges.get(zone_id) -> EdgeGetResponse ## Jobs @@ -4712,7 +4716,7 @@ Types: ```python from cloudflare.types import ( - MtlsCertificateCreateResponse, + MtlsCertificateUpdateResponse, MtlsCertificateListResponse, MtlsCertificateDeleteResponse, MtlsCertificateGetResponse, @@ -4721,7 +4725,7 @@ from cloudflare.types import ( Methods: -- client.mtls_certificates.create(account_id, \*\*params) -> MtlsCertificateCreateResponse +- client.mtls_certificates.update(account_id, \*\*params) -> MtlsCertificateUpdateResponse - client.mtls_certificates.list(account_id) -> Optional - client.mtls_certificates.delete(mtls_certificate_id, \*, account_id) -> MtlsCertificateDeleteResponse - client.mtls_certificates.get(mtls_certificate_id, \*, account_id) -> MtlsCertificateGetResponse @@ -5105,7 +5109,7 @@ Types: ```python from cloudflare.types import ( - StreamCreateResponse, + StreamUpdateResponse, StreamGetResponse, StreamStreamVideosListVideosResponse, ) @@ -5113,7 +5117,7 @@ from cloudflare.types import ( Methods: -- client.stream.create(identifier, \*, account_id, \*\*params) -> StreamCreateResponse +- client.stream.update(identifier, \*, account_id, \*\*params) -> StreamUpdateResponse - client.stream.delete(identifier, \*, account_id) -> None - client.stream.get(identifier, \*, account_id) -> StreamGetResponse - client.stream.stream_videos_initiate_video_uploads_using_tus(account_id) -> None @@ -5374,12 +5378,12 @@ Methods: Types: ```python -from cloudflare.types.teamnets.routes import NetworkCreateResponse, NetworkDeleteResponse +from cloudflare.types.teamnets.routes import NetworkUpdateResponse, NetworkDeleteResponse ``` Methods: -- client.teamnets.routes.networks.create(ip_network_encoded, \*, account_id, \*\*params) -> NetworkCreateResponse +- client.teamnets.routes.networks.update(ip_network_encoded, \*, account_id, \*\*params) -> NetworkUpdateResponse - client.teamnets.routes.networks.delete(ip_network_encoded, \*, account_id, \*\*params) -> NetworkDeleteResponse ## VirtualNetworks diff --git a/src/cloudflare/resources/access/users/failed_logins.py b/src/cloudflare/resources/access/users/failed_logins.py index 896de27c137..fd61d88b66f 100644 --- a/src/cloudflare/resources/access/users/failed_logins.py +++ b/src/cloudflare/resources/access/users/failed_logins.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.access.users import FailedLoginGetResponse +from ....types.access.users import FailedLoginZeroTrustUsersGetFailedLoginsResponse __all__ = ["FailedLogins", "AsyncFailedLogins"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> FailedLoginsWithRawResponse: def with_streaming_response(self) -> FailedLoginsWithStreamingResponse: return FailedLoginsWithStreamingResponse(self) - def get( + def zero_trust_users_get_failed_logins( self, id: str, *, @@ -44,7 +44,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FailedLoginGetResponse]: + ) -> Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse]: """ Get all failed login attempts for a single user. @@ -74,7 +74,10 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FailedLoginGetResponse]], ResultWrapper[FailedLoginGetResponse]), + cast_to=cast( + Type[Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse]], + ResultWrapper[FailedLoginZeroTrustUsersGetFailedLoginsResponse], + ), ) @@ -87,7 +90,7 @@ def with_raw_response(self) -> AsyncFailedLoginsWithRawResponse: def with_streaming_response(self) -> AsyncFailedLoginsWithStreamingResponse: return AsyncFailedLoginsWithStreamingResponse(self) - async def get( + async def zero_trust_users_get_failed_logins( self, id: str, *, @@ -98,7 +101,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FailedLoginGetResponse]: + ) -> Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse]: """ Get all failed login attempts for a single user. @@ -128,7 +131,10 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FailedLoginGetResponse]], ResultWrapper[FailedLoginGetResponse]), + cast_to=cast( + Type[Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse]], + ResultWrapper[FailedLoginZeroTrustUsersGetFailedLoginsResponse], + ), ) @@ -136,8 +142,8 @@ class FailedLoginsWithRawResponse: def __init__(self, failed_logins: FailedLogins) -> None: self._failed_logins = failed_logins - self.get = to_raw_response_wrapper( - failed_logins.get, + self.zero_trust_users_get_failed_logins = to_raw_response_wrapper( + failed_logins.zero_trust_users_get_failed_logins, ) @@ -145,8 +151,8 @@ class AsyncFailedLoginsWithRawResponse: def __init__(self, failed_logins: AsyncFailedLogins) -> None: self._failed_logins = failed_logins - self.get = async_to_raw_response_wrapper( - failed_logins.get, + self.zero_trust_users_get_failed_logins = async_to_raw_response_wrapper( + failed_logins.zero_trust_users_get_failed_logins, ) @@ -154,8 +160,8 @@ class FailedLoginsWithStreamingResponse: def __init__(self, failed_logins: FailedLogins) -> None: self._failed_logins = failed_logins - self.get = to_streamed_response_wrapper( - failed_logins.get, + self.zero_trust_users_get_failed_logins = to_streamed_response_wrapper( + failed_logins.zero_trust_users_get_failed_logins, ) @@ -163,6 +169,6 @@ class AsyncFailedLoginsWithStreamingResponse: def __init__(self, failed_logins: AsyncFailedLogins) -> None: self._failed_logins = failed_logins - self.get = async_to_streamed_response_wrapper( - failed_logins.get, + self.zero_trust_users_get_failed_logins = async_to_streamed_response_wrapper( + failed_logins.zero_trust_users_get_failed_logins, ) diff --git a/src/cloudflare/resources/acms/total_tls.py b/src/cloudflare/resources/acms/total_tls.py index a6a84eb4ab2..28940463faa 100644 --- a/src/cloudflare/resources/acms/total_tls.py +++ b/src/cloudflare/resources/acms/total_tls.py @@ -18,7 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.acms import TotalTLSGetResponse, TotalTLSCreateResponse, total_tls_create_params +from ...types.acms import TotalTLSGetResponse, TotalTLSUpdateResponse, total_tls_update_params from ..._base_client import ( make_request_options, ) @@ -35,7 +35,7 @@ def with_raw_response(self) -> TotalTLSWithRawResponse: def with_streaming_response(self) -> TotalTLSWithStreamingResponse: return TotalTLSWithStreamingResponse(self) - def create( + def update( self, zone_id: str, *, @@ -47,7 +47,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TotalTLSCreateResponse: + ) -> TotalTLSUpdateResponse: """ Set Total TLS Settings or disable the feature for a Zone. @@ -76,7 +76,7 @@ def create( "enabled": enabled, "certificate_authority": certificate_authority, }, - total_tls_create_params.TotalTLSCreateParams, + total_tls_update_params.TotalTLSUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -85,7 +85,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]), + cast_to=cast(Type[TotalTLSUpdateResponse], ResultWrapper[TotalTLSUpdateResponse]), ) def get( @@ -137,7 +137,7 @@ def with_raw_response(self) -> AsyncTotalTLSWithRawResponse: def with_streaming_response(self) -> AsyncTotalTLSWithStreamingResponse: return AsyncTotalTLSWithStreamingResponse(self) - async def create( + async def update( self, zone_id: str, *, @@ -149,7 +149,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TotalTLSCreateResponse: + ) -> TotalTLSUpdateResponse: """ Set Total TLS Settings or disable the feature for a Zone. @@ -178,7 +178,7 @@ async def create( "enabled": enabled, "certificate_authority": certificate_authority, }, - total_tls_create_params.TotalTLSCreateParams, + total_tls_update_params.TotalTLSUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -187,7 +187,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]), + cast_to=cast(Type[TotalTLSUpdateResponse], ResultWrapper[TotalTLSUpdateResponse]), ) async def get( @@ -234,8 +234,8 @@ class TotalTLSWithRawResponse: def __init__(self, total_tls: TotalTLS) -> None: self._total_tls = total_tls - self.create = to_raw_response_wrapper( - total_tls.create, + self.update = to_raw_response_wrapper( + total_tls.update, ) self.get = to_raw_response_wrapper( total_tls.get, @@ -246,8 +246,8 @@ class AsyncTotalTLSWithRawResponse: def __init__(self, total_tls: AsyncTotalTLS) -> None: self._total_tls = total_tls - self.create = async_to_raw_response_wrapper( - total_tls.create, + self.update = async_to_raw_response_wrapper( + total_tls.update, ) self.get = async_to_raw_response_wrapper( total_tls.get, @@ -258,8 +258,8 @@ class TotalTLSWithStreamingResponse: def __init__(self, total_tls: TotalTLS) -> None: self._total_tls = total_tls - self.create = to_streamed_response_wrapper( - total_tls.create, + self.update = to_streamed_response_wrapper( + total_tls.update, ) self.get = to_streamed_response_wrapper( total_tls.get, @@ -270,8 +270,8 @@ class AsyncTotalTLSWithStreamingResponse: def __init__(self, total_tls: AsyncTotalTLS) -> None: self._total_tls = total_tls - self.create = async_to_streamed_response_wrapper( - total_tls.create, + self.update = async_to_streamed_response_wrapper( + total_tls.update, ) self.get = async_to_streamed_response_wrapper( total_tls.get, diff --git a/src/cloudflare/resources/certificates.py b/src/cloudflare/resources/certificates.py index f965e2e7e5c..57ac7236f6c 100644 --- a/src/cloudflare/resources/certificates.py +++ b/src/cloudflare/resources/certificates.py @@ -9,10 +9,10 @@ from ..types import ( CertificateGetResponse, - CertificateListResponse, - CertificateCreateResponse, CertificateDeleteResponse, - certificate_create_params, + CertificateOriginCaListCertificatesResponse, + CertificateOriginCaCreateCertificateResponse, + certificate_origin_ca_create_certificate_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform @@ -41,98 +41,6 @@ def with_raw_response(self) -> CertificatesWithRawResponse: def with_streaming_response(self) -> CertificatesWithStreamingResponse: return CertificatesWithStreamingResponse(self) - def create( - self, - *, - csr: str | NotGiven = NOT_GIVEN, - hostnames: Iterable[object] | NotGiven = NOT_GIVEN, - request_type: Literal["origin-rsa", "origin-ecc", "keyless-certificate"] | NotGiven = NOT_GIVEN, - requested_validity: Literal[7, 30, 90, 365, 730, 1095, 5475] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateCreateResponse: - """Create an Origin CA certificate. - - Use your Origin CA Key as your User Service Key - when calling this endpoint ([see above](#requests)). - - Args: - csr: The Certificate Signing Request (CSR). Must be newline-encoded. - - hostnames: Array of hostnames or wildcard names (e.g., \\**.example.com) bound to the - certificate. - - request_type: Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), - or "keyless-certificate" (for Keyless SSL servers). - - requested_validity: The number of days for which the certificate should be valid. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return cast( - CertificateCreateResponse, - self._post( - "/certificates", - body=maybe_transform( - { - "csr": csr, - "hostnames": hostnames, - "request_type": request_type, - "requested_validity": requested_validity, - }, - certificate_create_params.CertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[CertificateCreateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateListResponse]: - """List all existing Origin CA certificates for a given zone. - - Use your Origin CA - Key as your User Service Key when calling this endpoint - ([see above](#requests)). - """ - return self._get( - "/certificates", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[CertificateListResponse]], ResultWrapper[CertificateListResponse]), - ) - def delete( self, certificate_id: str, @@ -222,17 +130,7 @@ def get( ), ) - -class AsyncCertificates(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncCertificatesWithRawResponse: - return AsyncCertificatesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncCertificatesWithStreamingResponse: - return AsyncCertificatesWithStreamingResponse(self) - - async def create( + def origin_ca_create_certificate( self, *, csr: str | NotGiven = NOT_GIVEN, @@ -245,7 +143,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateCreateResponse: + ) -> CertificateOriginCaCreateCertificateResponse: """Create an Origin CA certificate. Use your Origin CA Key as your User Service Key @@ -271,8 +169,8 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ return cast( - CertificateCreateResponse, - await self._post( + CertificateOriginCaCreateCertificateResponse, + self._post( "/certificates", body=maybe_transform( { @@ -281,7 +179,7 @@ async def create( "request_type": request_type, "requested_validity": requested_validity, }, - certificate_create_params.CertificateCreateParams, + certificate_origin_ca_create_certificate_params.CertificateOriginCaCreateCertificateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -291,12 +189,12 @@ async def create( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CertificateCreateResponse] + Any, ResultWrapper[CertificateOriginCaCreateCertificateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) - async def list( + def origin_ca_list_certificates( self, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -305,14 +203,14 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateListResponse]: + ) -> Optional[CertificateOriginCaListCertificatesResponse]: """List all existing Origin CA certificates for a given zone. Use your Origin CA Key as your User Service Key when calling this endpoint ([see above](#requests)). """ - return await self._get( + return self._get( "/certificates", options=make_request_options( extra_headers=extra_headers, @@ -321,9 +219,22 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[CertificateListResponse]], ResultWrapper[CertificateListResponse]), + cast_to=cast( + Type[Optional[CertificateOriginCaListCertificatesResponse]], + ResultWrapper[CertificateOriginCaListCertificatesResponse], + ), ) + +class AsyncCertificates(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCertificatesWithRawResponse: + return AsyncCertificatesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCertificatesWithStreamingResponse: + return AsyncCertificatesWithStreamingResponse(self) + async def delete( self, certificate_id: str, @@ -413,74 +324,169 @@ async def get( ), ) + async def origin_ca_create_certificate( + self, + *, + csr: str | NotGiven = NOT_GIVEN, + hostnames: Iterable[object] | NotGiven = NOT_GIVEN, + request_type: Literal["origin-rsa", "origin-ecc", "keyless-certificate"] | NotGiven = NOT_GIVEN, + requested_validity: Literal[7, 30, 90, 365, 730, 1095, 5475] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CertificateOriginCaCreateCertificateResponse: + """Create an Origin CA certificate. + + Use your Origin CA Key as your User Service Key + when calling this endpoint ([see above](#requests)). + + Args: + csr: The Certificate Signing Request (CSR). Must be newline-encoded. + + hostnames: Array of hostnames or wildcard names (e.g., \\**.example.com) bound to the + certificate. + + request_type: Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), + or "keyless-certificate" (for Keyless SSL servers). + + requested_validity: The number of days for which the certificate should be valid. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return cast( + CertificateOriginCaCreateCertificateResponse, + await self._post( + "/certificates", + body=maybe_transform( + { + "csr": csr, + "hostnames": hostnames, + "request_type": request_type, + "requested_validity": requested_validity, + }, + certificate_origin_ca_create_certificate_params.CertificateOriginCaCreateCertificateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CertificateOriginCaCreateCertificateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def origin_ca_list_certificates( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CertificateOriginCaListCertificatesResponse]: + """List all existing Origin CA certificates for a given zone. + + Use your Origin CA + Key as your User Service Key when calling this endpoint + ([see above](#requests)). + """ + return await self._get( + "/certificates", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Type[Optional[CertificateOriginCaListCertificatesResponse]], + ResultWrapper[CertificateOriginCaListCertificatesResponse], + ), + ) + class CertificatesWithRawResponse: def __init__(self, certificates: Certificates) -> None: self._certificates = certificates - self.create = to_raw_response_wrapper( - certificates.create, - ) - self.list = to_raw_response_wrapper( - certificates.list, - ) self.delete = to_raw_response_wrapper( certificates.delete, ) self.get = to_raw_response_wrapper( certificates.get, ) + self.origin_ca_create_certificate = to_raw_response_wrapper( + certificates.origin_ca_create_certificate, + ) + self.origin_ca_list_certificates = to_raw_response_wrapper( + certificates.origin_ca_list_certificates, + ) class AsyncCertificatesWithRawResponse: def __init__(self, certificates: AsyncCertificates) -> None: self._certificates = certificates - self.create = async_to_raw_response_wrapper( - certificates.create, - ) - self.list = async_to_raw_response_wrapper( - certificates.list, - ) self.delete = async_to_raw_response_wrapper( certificates.delete, ) self.get = async_to_raw_response_wrapper( certificates.get, ) + self.origin_ca_create_certificate = async_to_raw_response_wrapper( + certificates.origin_ca_create_certificate, + ) + self.origin_ca_list_certificates = async_to_raw_response_wrapper( + certificates.origin_ca_list_certificates, + ) class CertificatesWithStreamingResponse: def __init__(self, certificates: Certificates) -> None: self._certificates = certificates - self.create = to_streamed_response_wrapper( - certificates.create, - ) - self.list = to_streamed_response_wrapper( - certificates.list, - ) self.delete = to_streamed_response_wrapper( certificates.delete, ) self.get = to_streamed_response_wrapper( certificates.get, ) + self.origin_ca_create_certificate = to_streamed_response_wrapper( + certificates.origin_ca_create_certificate, + ) + self.origin_ca_list_certificates = to_streamed_response_wrapper( + certificates.origin_ca_list_certificates, + ) class AsyncCertificatesWithStreamingResponse: def __init__(self, certificates: AsyncCertificates) -> None: self._certificates = certificates - self.create = async_to_streamed_response_wrapper( - certificates.create, - ) - self.list = async_to_streamed_response_wrapper( - certificates.list, - ) self.delete = async_to_streamed_response_wrapper( certificates.delete, ) self.get = async_to_streamed_response_wrapper( certificates.get, ) + self.origin_ca_create_certificate = async_to_streamed_response_wrapper( + certificates.origin_ca_create_certificate, + ) + self.origin_ca_list_certificates = async_to_streamed_response_wrapper( + certificates.origin_ca_list_certificates, + ) diff --git a/src/cloudflare/resources/custom_ns/verifies.py b/src/cloudflare/resources/custom_ns/verifies.py index aaa6a9f4b47..7b5bf88779f 100644 --- a/src/cloudflare/resources/custom_ns/verifies.py +++ b/src/cloudflare/resources/custom_ns/verifies.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.custom_ns import VerifyCreateResponse +from ...types.custom_ns import VerifyUpdateResponse __all__ = ["Verifies", "AsyncVerifies"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> VerifiesWithRawResponse: def with_streaming_response(self) -> VerifiesWithStreamingResponse: return VerifiesWithStreamingResponse(self) - def create( + def update( self, account_id: str, *, @@ -43,7 +43,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VerifyCreateResponse]: + ) -> Optional[VerifyUpdateResponse]: """ Verify Account Custom Nameserver Glue Records @@ -69,7 +69,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[VerifyCreateResponse]], ResultWrapper[VerifyCreateResponse]), + cast_to=cast(Type[Optional[VerifyUpdateResponse]], ResultWrapper[VerifyUpdateResponse]), ) @@ -82,7 +82,7 @@ def with_raw_response(self) -> AsyncVerifiesWithRawResponse: def with_streaming_response(self) -> AsyncVerifiesWithStreamingResponse: return AsyncVerifiesWithStreamingResponse(self) - async def create( + async def update( self, account_id: str, *, @@ -92,7 +92,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VerifyCreateResponse]: + ) -> Optional[VerifyUpdateResponse]: """ Verify Account Custom Nameserver Glue Records @@ -118,7 +118,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[VerifyCreateResponse]], ResultWrapper[VerifyCreateResponse]), + cast_to=cast(Type[Optional[VerifyUpdateResponse]], ResultWrapper[VerifyUpdateResponse]), ) @@ -126,8 +126,8 @@ class VerifiesWithRawResponse: def __init__(self, verifies: Verifies) -> None: self._verifies = verifies - self.create = to_raw_response_wrapper( - verifies.create, + self.update = to_raw_response_wrapper( + verifies.update, ) @@ -135,8 +135,8 @@ class AsyncVerifiesWithRawResponse: def __init__(self, verifies: AsyncVerifies) -> None: self._verifies = verifies - self.create = async_to_raw_response_wrapper( - verifies.create, + self.update = async_to_raw_response_wrapper( + verifies.update, ) @@ -144,8 +144,8 @@ class VerifiesWithStreamingResponse: def __init__(self, verifies: Verifies) -> None: self._verifies = verifies - self.create = to_streamed_response_wrapper( - verifies.create, + self.update = to_streamed_response_wrapper( + verifies.update, ) @@ -153,6 +153,6 @@ class AsyncVerifiesWithStreamingResponse: def __init__(self, verifies: AsyncVerifies) -> None: self._verifies = verifies - self.create = async_to_streamed_response_wrapper( - verifies.create, + self.update = async_to_streamed_response_wrapper( + verifies.update, ) diff --git a/src/cloudflare/resources/logpush/edges.py b/src/cloudflare/resources/logpush/edges.py index 40b25414dcc..0437389e80a 100644 --- a/src/cloudflare/resources/logpush/edges.py +++ b/src/cloudflare/resources/logpush/edges.py @@ -20,7 +20,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.logpush import EdgeGetResponse, EdgeCreateResponse, edge_create_params +from ...types.logpush import EdgeGetResponse, EdgeUpdateResponse, edge_update_params __all__ = ["Edges", "AsyncEdges"] @@ -34,7 +34,7 @@ def with_raw_response(self) -> EdgesWithRawResponse: def with_streaming_response(self) -> EdgesWithStreamingResponse: return EdgesWithStreamingResponse(self) - def create( + def update( self, zone_id: str, *, @@ -47,7 +47,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EdgeCreateResponse]: + ) -> Optional[EdgeUpdateResponse]: """ Creates a new Instant Logs job for a zone. @@ -80,7 +80,7 @@ def create( "filter": filter, "sample": sample, }, - edge_create_params.EdgeCreateParams, + edge_update_params.EdgeUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -89,7 +89,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[EdgeCreateResponse]], ResultWrapper[EdgeCreateResponse]), + cast_to=cast(Type[Optional[EdgeUpdateResponse]], ResultWrapper[EdgeUpdateResponse]), ) def get( @@ -141,7 +141,7 @@ def with_raw_response(self) -> AsyncEdgesWithRawResponse: def with_streaming_response(self) -> AsyncEdgesWithStreamingResponse: return AsyncEdgesWithStreamingResponse(self) - async def create( + async def update( self, zone_id: str, *, @@ -154,7 +154,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EdgeCreateResponse]: + ) -> Optional[EdgeUpdateResponse]: """ Creates a new Instant Logs job for a zone. @@ -187,7 +187,7 @@ async def create( "filter": filter, "sample": sample, }, - edge_create_params.EdgeCreateParams, + edge_update_params.EdgeUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -196,7 +196,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[EdgeCreateResponse]], ResultWrapper[EdgeCreateResponse]), + cast_to=cast(Type[Optional[EdgeUpdateResponse]], ResultWrapper[EdgeUpdateResponse]), ) async def get( @@ -243,8 +243,8 @@ class EdgesWithRawResponse: def __init__(self, edges: Edges) -> None: self._edges = edges - self.create = to_raw_response_wrapper( - edges.create, + self.update = to_raw_response_wrapper( + edges.update, ) self.get = to_raw_response_wrapper( edges.get, @@ -255,8 +255,8 @@ class AsyncEdgesWithRawResponse: def __init__(self, edges: AsyncEdges) -> None: self._edges = edges - self.create = async_to_raw_response_wrapper( - edges.create, + self.update = async_to_raw_response_wrapper( + edges.update, ) self.get = async_to_raw_response_wrapper( edges.get, @@ -267,8 +267,8 @@ class EdgesWithStreamingResponse: def __init__(self, edges: Edges) -> None: self._edges = edges - self.create = to_streamed_response_wrapper( - edges.create, + self.update = to_streamed_response_wrapper( + edges.update, ) self.get = to_streamed_response_wrapper( edges.get, @@ -279,8 +279,8 @@ class AsyncEdgesWithStreamingResponse: def __init__(self, edges: AsyncEdges) -> None: self._edges = edges - self.create = async_to_streamed_response_wrapper( - edges.create, + self.update = async_to_streamed_response_wrapper( + edges.update, ) self.get = async_to_streamed_response_wrapper( edges.get, diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index cf63de4e4f3..21f61412431 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -9,9 +9,9 @@ from ...types import ( MtlsCertificateGetResponse, MtlsCertificateListResponse, - MtlsCertificateCreateResponse, MtlsCertificateDeleteResponse, - mtls_certificate_create_params, + MtlsCertificateUpdateResponse, + mtls_certificate_update_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import maybe_transform @@ -52,7 +52,7 @@ def with_raw_response(self) -> MtlsCertificatesWithRawResponse: def with_streaming_response(self) -> MtlsCertificatesWithStreamingResponse: return MtlsCertificatesWithStreamingResponse(self) - def create( + def update( self, account_id: str, *, @@ -66,7 +66,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MtlsCertificateCreateResponse: + ) -> MtlsCertificateUpdateResponse: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -100,7 +100,7 @@ def create( "name": name, "private_key": private_key, }, - mtls_certificate_create_params.MtlsCertificateCreateParams, + mtls_certificate_update_params.MtlsCertificateUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -109,7 +109,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MtlsCertificateCreateResponse], ResultWrapper[MtlsCertificateCreateResponse]), + cast_to=cast(Type[MtlsCertificateUpdateResponse], ResultWrapper[MtlsCertificateUpdateResponse]), ) def list( @@ -258,7 +258,7 @@ def with_raw_response(self) -> AsyncMtlsCertificatesWithRawResponse: def with_streaming_response(self) -> AsyncMtlsCertificatesWithStreamingResponse: return AsyncMtlsCertificatesWithStreamingResponse(self) - async def create( + async def update( self, account_id: str, *, @@ -272,7 +272,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MtlsCertificateCreateResponse: + ) -> MtlsCertificateUpdateResponse: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -306,7 +306,7 @@ async def create( "name": name, "private_key": private_key, }, - mtls_certificate_create_params.MtlsCertificateCreateParams, + mtls_certificate_update_params.MtlsCertificateUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -315,7 +315,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MtlsCertificateCreateResponse], ResultWrapper[MtlsCertificateCreateResponse]), + cast_to=cast(Type[MtlsCertificateUpdateResponse], ResultWrapper[MtlsCertificateUpdateResponse]), ) async def list( @@ -455,8 +455,8 @@ class MtlsCertificatesWithRawResponse: def __init__(self, mtls_certificates: MtlsCertificates) -> None: self._mtls_certificates = mtls_certificates - self.create = to_raw_response_wrapper( - mtls_certificates.create, + self.update = to_raw_response_wrapper( + mtls_certificates.update, ) self.list = to_raw_response_wrapper( mtls_certificates.list, @@ -477,8 +477,8 @@ class AsyncMtlsCertificatesWithRawResponse: def __init__(self, mtls_certificates: AsyncMtlsCertificates) -> None: self._mtls_certificates = mtls_certificates - self.create = async_to_raw_response_wrapper( - mtls_certificates.create, + self.update = async_to_raw_response_wrapper( + mtls_certificates.update, ) self.list = async_to_raw_response_wrapper( mtls_certificates.list, @@ -499,8 +499,8 @@ class MtlsCertificatesWithStreamingResponse: def __init__(self, mtls_certificates: MtlsCertificates) -> None: self._mtls_certificates = mtls_certificates - self.create = to_streamed_response_wrapper( - mtls_certificates.create, + self.update = to_streamed_response_wrapper( + mtls_certificates.update, ) self.list = to_streamed_response_wrapper( mtls_certificates.list, @@ -521,8 +521,8 @@ class AsyncMtlsCertificatesWithStreamingResponse: def __init__(self, mtls_certificates: AsyncMtlsCertificates) -> None: self._mtls_certificates = mtls_certificates - self.create = async_to_streamed_response_wrapper( - mtls_certificates.create, + self.update = async_to_streamed_response_wrapper( + mtls_certificates.update, ) self.list = async_to_streamed_response_wrapper( mtls_certificates.list, diff --git a/src/cloudflare/resources/ssls/analyzes.py b/src/cloudflare/resources/ssls/analyzes.py index b81260d5beb..c9c1264c29a 100644 --- a/src/cloudflare/resources/ssls/analyzes.py +++ b/src/cloudflare/resources/ssls/analyzes.py @@ -18,7 +18,10 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.ssls import AnalyzeCreateResponse, analyze_create_params +from ...types.ssls import ( + AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, + analyze_analyze_certificate_analyze_certificate_params, +) from ..._base_client import ( make_request_options, ) @@ -35,7 +38,7 @@ def with_raw_response(self) -> AnalyzesWithRawResponse: def with_streaming_response(self) -> AnalyzesWithStreamingResponse: return AnalyzesWithStreamingResponse(self) - def create( + def analyze_certificate_analyze_certificate( self, zone_id: str, *, @@ -47,7 +50,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AnalyzeCreateResponse: + ) -> AnalyzeAnalyzeCertificateAnalyzeCertificateResponse: """ Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate. @@ -73,7 +76,7 @@ def create( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - AnalyzeCreateResponse, + AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, self._post( f"/zones/{zone_id}/ssl/analyze", body=maybe_transform( @@ -81,7 +84,7 @@ def create( "bundle_method": bundle_method, "certificate": certificate, }, - analyze_create_params.AnalyzeCreateParams, + analyze_analyze_certificate_analyze_certificate_params.AnalyzeAnalyzeCertificateAnalyzeCertificateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -91,7 +94,7 @@ def create( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[AnalyzeCreateResponse] + Any, ResultWrapper[AnalyzeAnalyzeCertificateAnalyzeCertificateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -106,7 +109,7 @@ def with_raw_response(self) -> AsyncAnalyzesWithRawResponse: def with_streaming_response(self) -> AsyncAnalyzesWithStreamingResponse: return AsyncAnalyzesWithStreamingResponse(self) - async def create( + async def analyze_certificate_analyze_certificate( self, zone_id: str, *, @@ -118,7 +121,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AnalyzeCreateResponse: + ) -> AnalyzeAnalyzeCertificateAnalyzeCertificateResponse: """ Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate. @@ -144,7 +147,7 @@ async def create( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - AnalyzeCreateResponse, + AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, await self._post( f"/zones/{zone_id}/ssl/analyze", body=maybe_transform( @@ -152,7 +155,7 @@ async def create( "bundle_method": bundle_method, "certificate": certificate, }, - analyze_create_params.AnalyzeCreateParams, + analyze_analyze_certificate_analyze_certificate_params.AnalyzeAnalyzeCertificateAnalyzeCertificateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -162,7 +165,7 @@ async def create( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[AnalyzeCreateResponse] + Any, ResultWrapper[AnalyzeAnalyzeCertificateAnalyzeCertificateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -172,8 +175,8 @@ class AnalyzesWithRawResponse: def __init__(self, analyzes: Analyzes) -> None: self._analyzes = analyzes - self.create = to_raw_response_wrapper( - analyzes.create, + self.analyze_certificate_analyze_certificate = to_raw_response_wrapper( + analyzes.analyze_certificate_analyze_certificate, ) @@ -181,8 +184,8 @@ class AsyncAnalyzesWithRawResponse: def __init__(self, analyzes: AsyncAnalyzes) -> None: self._analyzes = analyzes - self.create = async_to_raw_response_wrapper( - analyzes.create, + self.analyze_certificate_analyze_certificate = async_to_raw_response_wrapper( + analyzes.analyze_certificate_analyze_certificate, ) @@ -190,8 +193,8 @@ class AnalyzesWithStreamingResponse: def __init__(self, analyzes: Analyzes) -> None: self._analyzes = analyzes - self.create = to_streamed_response_wrapper( - analyzes.create, + self.analyze_certificate_analyze_certificate = to_streamed_response_wrapper( + analyzes.analyze_certificate_analyze_certificate, ) @@ -199,6 +202,6 @@ class AsyncAnalyzesWithStreamingResponse: def __init__(self, analyzes: AsyncAnalyzes) -> None: self._analyzes = analyzes - self.create = async_to_streamed_response_wrapper( - analyzes.create, + self.analyze_certificate_analyze_certificate = async_to_streamed_response_wrapper( + analyzes.analyze_certificate_analyze_certificate, ) diff --git a/src/cloudflare/resources/ssls/certificate_packs/certificate_packs.py b/src/cloudflare/resources/ssls/certificate_packs/certificate_packs.py index 17a824b0fd3..6d47ad8ddfc 100644 --- a/src/cloudflare/resources/ssls/certificate_packs/certificate_packs.py +++ b/src/cloudflare/resources/ssls/certificate_packs/certificate_packs.py @@ -36,10 +36,10 @@ from ...._wrappers import ResultWrapper from ....types.ssls import ( CertificatePackGetResponse, - CertificatePackListResponse, CertificatePackDeleteResponse, CertificatePackUpdateResponse, - certificate_pack_list_params, + CertificatePackCertificatePacksListCertificatePacksResponse, + certificate_pack_certificate_packs_list_certificate_packs_params, ) from ...._base_client import ( make_request_options, @@ -114,25 +114,25 @@ def update( cast_to=cast(Type[CertificatePackUpdateResponse], ResultWrapper[CertificatePackUpdateResponse]), ) - def list( + def delete( self, - zone_id: str, + certificate_pack_id: str, *, - status: Literal["all"] | NotGiven = NOT_GIVEN, + zone_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificatePackListResponse]: + ) -> CertificatePackDeleteResponse: """ - For a given zone, list all active certificate packs. + For a given zone, delete an advanced certificate pack. Args: zone_id: Identifier - status: Include Certificate Packs of all statuses, not just active ones. + certificate_pack_id: Identifier extra_headers: Send extra headers @@ -144,38 +144,41 @@ def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( - f"/zones/{zone_id}/ssl/certificate_packs", + if not certificate_pack_id: + raise ValueError( + f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" + ) + return self._delete( + f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"status": status}, certificate_pack_list_params.CertificatePackListParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[CertificatePackListResponse]], ResultWrapper[CertificatePackListResponse]), + cast_to=cast(Type[CertificatePackDeleteResponse], ResultWrapper[CertificatePackDeleteResponse]), ) - def delete( + def certificate_packs_list_certificate_packs( self, - certificate_pack_id: str, - *, zone_id: str, + *, + status: Literal["all"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackDeleteResponse: + ) -> Optional[CertificatePackCertificatePacksListCertificatePacksResponse]: """ - For a given zone, delete an advanced certificate pack. + For a given zone, list all active certificate packs. Args: zone_id: Identifier - certificate_pack_id: Identifier + status: Include Certificate Packs of all statuses, not just active ones. extra_headers: Send extra headers @@ -187,20 +190,23 @@ def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not certificate_pack_id: - raise ValueError( - f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" - ) - return self._delete( - f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}", + return self._get( + f"/zones/{zone_id}/ssl/certificate_packs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform( + {"status": status}, + certificate_pack_certificate_packs_list_certificate_packs_params.CertificatePackCertificatePacksListCertificatePacksParams, + ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CertificatePackDeleteResponse], ResultWrapper[CertificatePackDeleteResponse]), + cast_to=cast( + Type[Optional[CertificatePackCertificatePacksListCertificatePacksResponse]], + ResultWrapper[CertificatePackCertificatePacksListCertificatePacksResponse], + ), ) def get( @@ -321,25 +327,25 @@ async def update( cast_to=cast(Type[CertificatePackUpdateResponse], ResultWrapper[CertificatePackUpdateResponse]), ) - async def list( + async def delete( self, - zone_id: str, + certificate_pack_id: str, *, - status: Literal["all"] | NotGiven = NOT_GIVEN, + zone_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificatePackListResponse]: + ) -> CertificatePackDeleteResponse: """ - For a given zone, list all active certificate packs. + For a given zone, delete an advanced certificate pack. Args: zone_id: Identifier - status: Include Certificate Packs of all statuses, not just active ones. + certificate_pack_id: Identifier extra_headers: Send extra headers @@ -351,38 +357,41 @@ async def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( - f"/zones/{zone_id}/ssl/certificate_packs", + if not certificate_pack_id: + raise ValueError( + f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" + ) + return await self._delete( + f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"status": status}, certificate_pack_list_params.CertificatePackListParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[CertificatePackListResponse]], ResultWrapper[CertificatePackListResponse]), + cast_to=cast(Type[CertificatePackDeleteResponse], ResultWrapper[CertificatePackDeleteResponse]), ) - async def delete( + async def certificate_packs_list_certificate_packs( self, - certificate_pack_id: str, - *, zone_id: str, + *, + status: Literal["all"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackDeleteResponse: + ) -> Optional[CertificatePackCertificatePacksListCertificatePacksResponse]: """ - For a given zone, delete an advanced certificate pack. + For a given zone, list all active certificate packs. Args: zone_id: Identifier - certificate_pack_id: Identifier + status: Include Certificate Packs of all statuses, not just active ones. extra_headers: Send extra headers @@ -394,20 +403,23 @@ async def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not certificate_pack_id: - raise ValueError( - f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" - ) - return await self._delete( - f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}", + return await self._get( + f"/zones/{zone_id}/ssl/certificate_packs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform( + {"status": status}, + certificate_pack_certificate_packs_list_certificate_packs_params.CertificatePackCertificatePacksListCertificatePacksParams, + ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CertificatePackDeleteResponse], ResultWrapper[CertificatePackDeleteResponse]), + cast_to=cast( + Type[Optional[CertificatePackCertificatePacksListCertificatePacksResponse]], + ResultWrapper[CertificatePackCertificatePacksListCertificatePacksResponse], + ), ) async def get( @@ -469,12 +481,12 @@ def __init__(self, certificate_packs: CertificatePacks) -> None: self.update = to_raw_response_wrapper( certificate_packs.update, ) - self.list = to_raw_response_wrapper( - certificate_packs.list, - ) self.delete = to_raw_response_wrapper( certificate_packs.delete, ) + self.certificate_packs_list_certificate_packs = to_raw_response_wrapper( + certificate_packs.certificate_packs_list_certificate_packs, + ) self.get = to_raw_response_wrapper( certificate_packs.get, ) @@ -495,12 +507,12 @@ def __init__(self, certificate_packs: AsyncCertificatePacks) -> None: self.update = async_to_raw_response_wrapper( certificate_packs.update, ) - self.list = async_to_raw_response_wrapper( - certificate_packs.list, - ) self.delete = async_to_raw_response_wrapper( certificate_packs.delete, ) + self.certificate_packs_list_certificate_packs = async_to_raw_response_wrapper( + certificate_packs.certificate_packs_list_certificate_packs, + ) self.get = async_to_raw_response_wrapper( certificate_packs.get, ) @@ -521,12 +533,12 @@ def __init__(self, certificate_packs: CertificatePacks) -> None: self.update = to_streamed_response_wrapper( certificate_packs.update, ) - self.list = to_streamed_response_wrapper( - certificate_packs.list, - ) self.delete = to_streamed_response_wrapper( certificate_packs.delete, ) + self.certificate_packs_list_certificate_packs = to_streamed_response_wrapper( + certificate_packs.certificate_packs_list_certificate_packs, + ) self.get = to_streamed_response_wrapper( certificate_packs.get, ) @@ -547,12 +559,12 @@ def __init__(self, certificate_packs: AsyncCertificatePacks) -> None: self.update = async_to_streamed_response_wrapper( certificate_packs.update, ) - self.list = async_to_streamed_response_wrapper( - certificate_packs.list, - ) self.delete = async_to_streamed_response_wrapper( certificate_packs.delete, ) + self.certificate_packs_list_certificate_packs = async_to_streamed_response_wrapper( + certificate_packs.certificate_packs_list_certificate_packs, + ) self.get = async_to_streamed_response_wrapper( certificate_packs.get, ) diff --git a/src/cloudflare/resources/ssls/certificate_packs/orders.py b/src/cloudflare/resources/ssls/certificate_packs/orders.py index 39a86241da4..b4095b436c3 100644 --- a/src/cloudflare/resources/ssls/certificate_packs/orders.py +++ b/src/cloudflare/resources/ssls/certificate_packs/orders.py @@ -21,7 +21,10 @@ from ...._base_client import ( make_request_options, ) -from ....types.ssls.certificate_packs import OrderCreateResponse, order_create_params +from ....types.ssls.certificate_packs import ( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, + order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params, +) __all__ = ["Orders", "AsyncOrders"] @@ -35,7 +38,7 @@ def with_raw_response(self) -> OrdersWithRawResponse: def with_streaming_response(self) -> OrdersWithStreamingResponse: return OrdersWithStreamingResponse(self) - def create( + def certificate_packs_order_advanced_certificate_manager_certificate_pack( self, zone_id: str, *, @@ -51,7 +54,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrderCreateResponse: + ) -> OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse: """ For a given zone, order an advanced certificate pack. @@ -95,7 +98,7 @@ def create( "validity_days": validity_days, "cloudflare_branding": cloudflare_branding, }, - order_create_params.OrderCreateParams, + order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params.OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams, ), options=make_request_options( extra_headers=extra_headers, @@ -104,7 +107,10 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OrderCreateResponse], ResultWrapper[OrderCreateResponse]), + cast_to=cast( + Type[OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse], + ResultWrapper[OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse], + ), ) @@ -117,7 +123,7 @@ def with_raw_response(self) -> AsyncOrdersWithRawResponse: def with_streaming_response(self) -> AsyncOrdersWithStreamingResponse: return AsyncOrdersWithStreamingResponse(self) - async def create( + async def certificate_packs_order_advanced_certificate_manager_certificate_pack( self, zone_id: str, *, @@ -133,7 +139,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrderCreateResponse: + ) -> OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse: """ For a given zone, order an advanced certificate pack. @@ -177,7 +183,7 @@ async def create( "validity_days": validity_days, "cloudflare_branding": cloudflare_branding, }, - order_create_params.OrderCreateParams, + order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params.OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams, ), options=make_request_options( extra_headers=extra_headers, @@ -186,7 +192,10 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OrderCreateResponse], ResultWrapper[OrderCreateResponse]), + cast_to=cast( + Type[OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse], + ResultWrapper[OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse], + ), ) @@ -194,8 +203,8 @@ class OrdersWithRawResponse: def __init__(self, orders: Orders) -> None: self._orders = orders - self.create = to_raw_response_wrapper( - orders.create, + self.certificate_packs_order_advanced_certificate_manager_certificate_pack = to_raw_response_wrapper( + orders.certificate_packs_order_advanced_certificate_manager_certificate_pack, ) @@ -203,8 +212,8 @@ class AsyncOrdersWithRawResponse: def __init__(self, orders: AsyncOrders) -> None: self._orders = orders - self.create = async_to_raw_response_wrapper( - orders.create, + self.certificate_packs_order_advanced_certificate_manager_certificate_pack = async_to_raw_response_wrapper( + orders.certificate_packs_order_advanced_certificate_manager_certificate_pack, ) @@ -212,8 +221,8 @@ class OrdersWithStreamingResponse: def __init__(self, orders: Orders) -> None: self._orders = orders - self.create = to_streamed_response_wrapper( - orders.create, + self.certificate_packs_order_advanced_certificate_manager_certificate_pack = to_streamed_response_wrapper( + orders.certificate_packs_order_advanced_certificate_manager_certificate_pack, ) @@ -221,6 +230,6 @@ class AsyncOrdersWithStreamingResponse: def __init__(self, orders: AsyncOrders) -> None: self._orders = orders - self.create = async_to_streamed_response_wrapper( - orders.create, + self.certificate_packs_order_advanced_certificate_manager_certificate_pack = async_to_streamed_response_wrapper( + orders.certificate_packs_order_advanced_certificate_manager_certificate_pack, ) diff --git a/src/cloudflare/resources/ssls/certificate_packs/quotas.py b/src/cloudflare/resources/ssls/certificate_packs/quotas.py index cea0758a6aa..a7564ecd731 100644 --- a/src/cloudflare/resources/ssls/certificate_packs/quotas.py +++ b/src/cloudflare/resources/ssls/certificate_packs/quotas.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.ssls.certificate_packs import QuotaGetResponse +from ....types.ssls.certificate_packs import QuotaCertificatePacksGetCertificatePackQuotasResponse __all__ = ["Quotas", "AsyncQuotas"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> QuotasWithRawResponse: def with_streaming_response(self) -> QuotasWithStreamingResponse: return QuotasWithStreamingResponse(self) - def get( + def certificate_packs_get_certificate_pack_quotas( self, zone_id: str, *, @@ -43,7 +43,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> QuotaGetResponse: + ) -> QuotaCertificatePacksGetCertificatePackQuotasResponse: """ For a given zone, list certificate pack quotas. @@ -69,7 +69,10 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[QuotaGetResponse], ResultWrapper[QuotaGetResponse]), + cast_to=cast( + Type[QuotaCertificatePacksGetCertificatePackQuotasResponse], + ResultWrapper[QuotaCertificatePacksGetCertificatePackQuotasResponse], + ), ) @@ -82,7 +85,7 @@ def with_raw_response(self) -> AsyncQuotasWithRawResponse: def with_streaming_response(self) -> AsyncQuotasWithStreamingResponse: return AsyncQuotasWithStreamingResponse(self) - async def get( + async def certificate_packs_get_certificate_pack_quotas( self, zone_id: str, *, @@ -92,7 +95,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> QuotaGetResponse: + ) -> QuotaCertificatePacksGetCertificatePackQuotasResponse: """ For a given zone, list certificate pack quotas. @@ -118,7 +121,10 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[QuotaGetResponse], ResultWrapper[QuotaGetResponse]), + cast_to=cast( + Type[QuotaCertificatePacksGetCertificatePackQuotasResponse], + ResultWrapper[QuotaCertificatePacksGetCertificatePackQuotasResponse], + ), ) @@ -126,8 +132,8 @@ class QuotasWithRawResponse: def __init__(self, quotas: Quotas) -> None: self._quotas = quotas - self.get = to_raw_response_wrapper( - quotas.get, + self.certificate_packs_get_certificate_pack_quotas = to_raw_response_wrapper( + quotas.certificate_packs_get_certificate_pack_quotas, ) @@ -135,8 +141,8 @@ class AsyncQuotasWithRawResponse: def __init__(self, quotas: AsyncQuotas) -> None: self._quotas = quotas - self.get = async_to_raw_response_wrapper( - quotas.get, + self.certificate_packs_get_certificate_pack_quotas = async_to_raw_response_wrapper( + quotas.certificate_packs_get_certificate_pack_quotas, ) @@ -144,8 +150,8 @@ class QuotasWithStreamingResponse: def __init__(self, quotas: Quotas) -> None: self._quotas = quotas - self.get = to_streamed_response_wrapper( - quotas.get, + self.certificate_packs_get_certificate_pack_quotas = to_streamed_response_wrapper( + quotas.certificate_packs_get_certificate_pack_quotas, ) @@ -153,6 +159,6 @@ class AsyncQuotasWithStreamingResponse: def __init__(self, quotas: AsyncQuotas) -> None: self._quotas = quotas - self.get = async_to_streamed_response_wrapper( - quotas.get, + self.certificate_packs_get_certificate_pack_quotas = async_to_streamed_response_wrapper( + quotas.certificate_packs_get_certificate_pack_quotas, ) diff --git a/src/cloudflare/resources/stream/stream.py b/src/cloudflare/resources/stream/stream.py index c2b4f73ee07..32d3a6122dc 100644 --- a/src/cloudflare/resources/stream/stream.py +++ b/src/cloudflare/resources/stream/stream.py @@ -58,9 +58,9 @@ ) from ...types import ( StreamGetResponse, - StreamCreateResponse, + StreamUpdateResponse, StreamStreamVideosListVideosResponse, - stream_create_params, + stream_update_params, stream_stream_videos_list_videos_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven @@ -199,7 +199,7 @@ def with_raw_response(self) -> StreamWithRawResponse: def with_streaming_response(self) -> StreamWithStreamingResponse: return StreamWithStreamingResponse(self) - def create( + def update( self, identifier: str, *, @@ -218,7 +218,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamCreateResponse: + ) -> StreamUpdateResponse: """ Edit details for a single video. @@ -281,7 +281,7 @@ def create( "thumbnail_timestamp_pct": thumbnail_timestamp_pct, "upload_expiry": upload_expiry, }, - stream_create_params.StreamCreateParams, + stream_update_params.StreamUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -290,7 +290,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamCreateResponse], ResultWrapper[StreamCreateResponse]), + cast_to=cast(Type[StreamUpdateResponse], ResultWrapper[StreamUpdateResponse]), ) def delete( @@ -563,7 +563,7 @@ def with_raw_response(self) -> AsyncStreamWithRawResponse: def with_streaming_response(self) -> AsyncStreamWithStreamingResponse: return AsyncStreamWithStreamingResponse(self) - async def create( + async def update( self, identifier: str, *, @@ -582,7 +582,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamCreateResponse: + ) -> StreamUpdateResponse: """ Edit details for a single video. @@ -645,7 +645,7 @@ async def create( "thumbnail_timestamp_pct": thumbnail_timestamp_pct, "upload_expiry": upload_expiry, }, - stream_create_params.StreamCreateParams, + stream_update_params.StreamUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -654,7 +654,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamCreateResponse], ResultWrapper[StreamCreateResponse]), + cast_to=cast(Type[StreamUpdateResponse], ResultWrapper[StreamUpdateResponse]), ) async def delete( @@ -870,8 +870,8 @@ class StreamWithRawResponse: def __init__(self, stream: Stream) -> None: self._stream = stream - self.create = to_raw_response_wrapper( - stream.create, + self.update = to_raw_response_wrapper( + stream.update, ) self.delete = to_raw_response_wrapper( stream.delete, @@ -943,8 +943,8 @@ class AsyncStreamWithRawResponse: def __init__(self, stream: AsyncStream) -> None: self._stream = stream - self.create = async_to_raw_response_wrapper( - stream.create, + self.update = async_to_raw_response_wrapper( + stream.update, ) self.delete = async_to_raw_response_wrapper( stream.delete, @@ -1016,8 +1016,8 @@ class StreamWithStreamingResponse: def __init__(self, stream: Stream) -> None: self._stream = stream - self.create = to_streamed_response_wrapper( - stream.create, + self.update = to_streamed_response_wrapper( + stream.update, ) self.delete = to_streamed_response_wrapper( stream.delete, @@ -1089,8 +1089,8 @@ class AsyncStreamWithStreamingResponse: def __init__(self, stream: AsyncStream) -> None: self._stream = stream - self.create = async_to_streamed_response_wrapper( - stream.create, + self.update = async_to_streamed_response_wrapper( + stream.update, ) self.delete = async_to_streamed_response_wrapper( stream.delete, diff --git a/src/cloudflare/resources/subscriptions.py b/src/cloudflare/resources/subscriptions.py index 06e619fd388..ca0878b153d 100644 --- a/src/cloudflare/resources/subscriptions.py +++ b/src/cloudflare/resources/subscriptions.py @@ -8,16 +8,16 @@ import httpx from ..types import ( - SubscriptionGetResponse, - SubscriptionCreateResponse, SubscriptionDeleteResponse, SubscriptionUpdateResponse, SubscriptionAccountSubscriptionsListSubscriptionsResponse, SubscriptionAccountSubscriptionsCreateSubscriptionResponse, + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse, - subscription_create_params, + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription_update_params, subscription_account_subscriptions_create_subscription_params, + subscription_zone_subscription_create_zone_subscription_params, subscription_zone_subscription_update_zone_subscription_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -47,73 +47,6 @@ def with_raw_response(self) -> SubscriptionsWithRawResponse: def with_streaming_response(self) -> SubscriptionsWithStreamingResponse: return SubscriptionsWithStreamingResponse(self) - def create( - self, - identifier: str, - *, - app: subscription_create_params.App | NotGiven = NOT_GIVEN, - component_values: Iterable[subscription_create_params.ComponentValue] | NotGiven = NOT_GIVEN, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: subscription_create_params.RatePlan | NotGiven = NOT_GIVEN, - zone: subscription_create_params.Zone | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionCreateResponse: - """ - Create a zone subscription, either plan or add-ons. - - Args: - identifier: Subscription identifier tag. - - component_values: The list of add-ons subscribed to. - - frequency: How often the subscription is renewed automatically. - - rate_plan: The rate plan applied to the subscription. - - zone: A simple zone object. May have null properties if not a zone subscription. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return cast( - SubscriptionCreateResponse, - self._post( - f"/zones/{identifier}/subscription", - body=maybe_transform( - { - "app": app, - "component_values": component_values, - "frequency": frequency, - "rate_plan": rate_plan, - "zone": zone, - }, - subscription_create_params.SubscriptionCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SubscriptionCreateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - def update( self, subscription_identifier: str, @@ -344,23 +277,37 @@ def account_subscriptions_list_subscriptions( ), ) - def get( + def zone_subscription_create_zone_subscription( self, identifier: str, *, + app: subscription_zone_subscription_create_zone_subscription_params.App | NotGiven = NOT_GIVEN, + component_values: Iterable[subscription_zone_subscription_create_zone_subscription_params.ComponentValue] + | NotGiven = NOT_GIVEN, + frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, + rate_plan: subscription_zone_subscription_create_zone_subscription_params.RatePlan | NotGiven = NOT_GIVEN, + zone: subscription_zone_subscription_create_zone_subscription_params.Zone | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionGetResponse: + ) -> SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse: """ - Lists zone subscription details. + Create a zone subscription, either plan or add-ons. Args: identifier: Subscription identifier tag. + component_values: The list of add-ons subscribed to. + + frequency: How often the subscription is renewed automatically. + + rate_plan: The rate plan applied to the subscription. + + zone: A simple zone object. May have null properties if not a zone subscription. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -372,9 +319,19 @@ def get( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - SubscriptionGetResponse, - self._get( + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, + self._post( f"/zones/{identifier}/subscription", + body=maybe_transform( + { + "app": app, + "component_values": component_values, + "frequency": frequency, + "rate_plan": rate_plan, + "zone": zone, + }, + subscription_zone_subscription_create_zone_subscription_params.SubscriptionZoneSubscriptionCreateZoneSubscriptionParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -383,7 +340,7 @@ def get( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[SubscriptionGetResponse] + Any, ResultWrapper[SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -456,46 +413,23 @@ def zone_subscription_update_zone_subscription( ), ) - -class AsyncSubscriptions(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncSubscriptionsWithRawResponse: - return AsyncSubscriptionsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncSubscriptionsWithStreamingResponse: - return AsyncSubscriptionsWithStreamingResponse(self) - - async def create( + def zone_subscription_zone_subscription_details( self, identifier: str, *, - app: subscription_create_params.App | NotGiven = NOT_GIVEN, - component_values: Iterable[subscription_create_params.ComponentValue] | NotGiven = NOT_GIVEN, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: subscription_create_params.RatePlan | NotGiven = NOT_GIVEN, - zone: subscription_create_params.Zone | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionCreateResponse: + ) -> SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse: """ - Create a zone subscription, either plan or add-ons. + Lists zone subscription details. Args: identifier: Subscription identifier tag. - component_values: The list of add-ons subscribed to. - - frequency: How often the subscription is renewed automatically. - - rate_plan: The rate plan applied to the subscription. - - zone: A simple zone object. May have null properties if not a zone subscription. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -507,19 +441,9 @@ async def create( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - SubscriptionCreateResponse, - await self._post( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, + self._get( f"/zones/{identifier}/subscription", - body=maybe_transform( - { - "app": app, - "component_values": component_values, - "frequency": frequency, - "rate_plan": rate_plan, - "zone": zone, - }, - subscription_create_params.SubscriptionCreateParams, - ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -528,11 +452,21 @@ async def create( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[SubscriptionCreateResponse] + Any, ResultWrapper[SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse] ), # Union types cannot be passed in as arguments in the type system ), ) + +class AsyncSubscriptions(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSubscriptionsWithRawResponse: + return AsyncSubscriptionsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSubscriptionsWithStreamingResponse: + return AsyncSubscriptionsWithStreamingResponse(self) + async def update( self, subscription_identifier: str, @@ -763,23 +697,37 @@ async def account_subscriptions_list_subscriptions( ), ) - async def get( + async def zone_subscription_create_zone_subscription( self, identifier: str, *, + app: subscription_zone_subscription_create_zone_subscription_params.App | NotGiven = NOT_GIVEN, + component_values: Iterable[subscription_zone_subscription_create_zone_subscription_params.ComponentValue] + | NotGiven = NOT_GIVEN, + frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, + rate_plan: subscription_zone_subscription_create_zone_subscription_params.RatePlan | NotGiven = NOT_GIVEN, + zone: subscription_zone_subscription_create_zone_subscription_params.Zone | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionGetResponse: + ) -> SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse: """ - Lists zone subscription details. + Create a zone subscription, either plan or add-ons. Args: identifier: Subscription identifier tag. + component_values: The list of add-ons subscribed to. + + frequency: How often the subscription is renewed automatically. + + rate_plan: The rate plan applied to the subscription. + + zone: A simple zone object. May have null properties if not a zone subscription. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -791,9 +739,19 @@ async def get( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - SubscriptionGetResponse, - await self._get( + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, + await self._post( f"/zones/{identifier}/subscription", + body=maybe_transform( + { + "app": app, + "component_values": component_values, + "frequency": frequency, + "rate_plan": rate_plan, + "zone": zone, + }, + subscription_zone_subscription_create_zone_subscription_params.SubscriptionZoneSubscriptionCreateZoneSubscriptionParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -802,7 +760,7 @@ async def get( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[SubscriptionGetResponse] + Any, ResultWrapper[SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -875,14 +833,55 @@ async def zone_subscription_update_zone_subscription( ), ) + async def zone_subscription_zone_subscription_details( + self, + identifier: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse: + """ + Lists zone subscription details. + + Args: + identifier: Subscription identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not identifier: + raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") + return cast( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, + await self._get( + f"/zones/{identifier}/subscription", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + class SubscriptionsWithRawResponse: def __init__(self, subscriptions: Subscriptions) -> None: self._subscriptions = subscriptions - self.create = to_raw_response_wrapper( - subscriptions.create, - ) self.update = to_raw_response_wrapper( subscriptions.update, ) @@ -895,21 +894,21 @@ def __init__(self, subscriptions: Subscriptions) -> None: self.account_subscriptions_list_subscriptions = to_raw_response_wrapper( subscriptions.account_subscriptions_list_subscriptions, ) - self.get = to_raw_response_wrapper( - subscriptions.get, + self.zone_subscription_create_zone_subscription = to_raw_response_wrapper( + subscriptions.zone_subscription_create_zone_subscription, ) self.zone_subscription_update_zone_subscription = to_raw_response_wrapper( subscriptions.zone_subscription_update_zone_subscription, ) + self.zone_subscription_zone_subscription_details = to_raw_response_wrapper( + subscriptions.zone_subscription_zone_subscription_details, + ) class AsyncSubscriptionsWithRawResponse: def __init__(self, subscriptions: AsyncSubscriptions) -> None: self._subscriptions = subscriptions - self.create = async_to_raw_response_wrapper( - subscriptions.create, - ) self.update = async_to_raw_response_wrapper( subscriptions.update, ) @@ -922,21 +921,21 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: self.account_subscriptions_list_subscriptions = async_to_raw_response_wrapper( subscriptions.account_subscriptions_list_subscriptions, ) - self.get = async_to_raw_response_wrapper( - subscriptions.get, + self.zone_subscription_create_zone_subscription = async_to_raw_response_wrapper( + subscriptions.zone_subscription_create_zone_subscription, ) self.zone_subscription_update_zone_subscription = async_to_raw_response_wrapper( subscriptions.zone_subscription_update_zone_subscription, ) + self.zone_subscription_zone_subscription_details = async_to_raw_response_wrapper( + subscriptions.zone_subscription_zone_subscription_details, + ) class SubscriptionsWithStreamingResponse: def __init__(self, subscriptions: Subscriptions) -> None: self._subscriptions = subscriptions - self.create = to_streamed_response_wrapper( - subscriptions.create, - ) self.update = to_streamed_response_wrapper( subscriptions.update, ) @@ -949,21 +948,21 @@ def __init__(self, subscriptions: Subscriptions) -> None: self.account_subscriptions_list_subscriptions = to_streamed_response_wrapper( subscriptions.account_subscriptions_list_subscriptions, ) - self.get = to_streamed_response_wrapper( - subscriptions.get, + self.zone_subscription_create_zone_subscription = to_streamed_response_wrapper( + subscriptions.zone_subscription_create_zone_subscription, ) self.zone_subscription_update_zone_subscription = to_streamed_response_wrapper( subscriptions.zone_subscription_update_zone_subscription, ) + self.zone_subscription_zone_subscription_details = to_streamed_response_wrapper( + subscriptions.zone_subscription_zone_subscription_details, + ) class AsyncSubscriptionsWithStreamingResponse: def __init__(self, subscriptions: AsyncSubscriptions) -> None: self._subscriptions = subscriptions - self.create = async_to_streamed_response_wrapper( - subscriptions.create, - ) self.update = async_to_streamed_response_wrapper( subscriptions.update, ) @@ -976,9 +975,12 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: self.account_subscriptions_list_subscriptions = async_to_streamed_response_wrapper( subscriptions.account_subscriptions_list_subscriptions, ) - self.get = async_to_streamed_response_wrapper( - subscriptions.get, + self.zone_subscription_create_zone_subscription = async_to_streamed_response_wrapper( + subscriptions.zone_subscription_create_zone_subscription, ) self.zone_subscription_update_zone_subscription = async_to_streamed_response_wrapper( subscriptions.zone_subscription_update_zone_subscription, ) + self.zone_subscription_zone_subscription_details = async_to_streamed_response_wrapper( + subscriptions.zone_subscription_zone_subscription_details, + ) diff --git a/src/cloudflare/resources/teamnets/routes/networks.py b/src/cloudflare/resources/teamnets/routes/networks.py index 8a7885a6a1d..1be49a02858 100644 --- a/src/cloudflare/resources/teamnets/routes/networks.py +++ b/src/cloudflare/resources/teamnets/routes/networks.py @@ -22,10 +22,10 @@ make_request_options, ) from ....types.teamnets.routes import ( - NetworkCreateResponse, NetworkDeleteResponse, - network_create_params, + NetworkUpdateResponse, network_delete_params, + network_update_params, ) __all__ = ["Networks", "AsyncNetworks"] @@ -40,7 +40,7 @@ def with_raw_response(self) -> NetworksWithRawResponse: def with_streaming_response(self) -> NetworksWithStreamingResponse: return NetworksWithStreamingResponse(self) - def create( + def update( self, ip_network_encoded: str, *, @@ -53,7 +53,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> NetworkCreateResponse: + ) -> NetworkUpdateResponse: """Routes a private network through a Cloudflare Tunnel. The CIDR in @@ -89,7 +89,7 @@ def create( "comment": comment, "virtual_network_id": virtual_network_id, }, - network_create_params.NetworkCreateParams, + network_update_params.NetworkUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -98,7 +98,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[NetworkCreateResponse], ResultWrapper[NetworkCreateResponse]), + cast_to=cast(Type[NetworkUpdateResponse], ResultWrapper[NetworkUpdateResponse]), ) def delete( @@ -166,7 +166,7 @@ def with_raw_response(self) -> AsyncNetworksWithRawResponse: def with_streaming_response(self) -> AsyncNetworksWithStreamingResponse: return AsyncNetworksWithStreamingResponse(self) - async def create( + async def update( self, ip_network_encoded: str, *, @@ -179,7 +179,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> NetworkCreateResponse: + ) -> NetworkUpdateResponse: """Routes a private network through a Cloudflare Tunnel. The CIDR in @@ -215,7 +215,7 @@ async def create( "comment": comment, "virtual_network_id": virtual_network_id, }, - network_create_params.NetworkCreateParams, + network_update_params.NetworkUpdateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -224,7 +224,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[NetworkCreateResponse], ResultWrapper[NetworkCreateResponse]), + cast_to=cast(Type[NetworkUpdateResponse], ResultWrapper[NetworkUpdateResponse]), ) async def delete( @@ -287,8 +287,8 @@ class NetworksWithRawResponse: def __init__(self, networks: Networks) -> None: self._networks = networks - self.create = to_raw_response_wrapper( - networks.create, + self.update = to_raw_response_wrapper( + networks.update, ) self.delete = to_raw_response_wrapper( networks.delete, @@ -299,8 +299,8 @@ class AsyncNetworksWithRawResponse: def __init__(self, networks: AsyncNetworks) -> None: self._networks = networks - self.create = async_to_raw_response_wrapper( - networks.create, + self.update = async_to_raw_response_wrapper( + networks.update, ) self.delete = async_to_raw_response_wrapper( networks.delete, @@ -311,8 +311,8 @@ class NetworksWithStreamingResponse: def __init__(self, networks: Networks) -> None: self._networks = networks - self.create = to_streamed_response_wrapper( - networks.create, + self.update = to_streamed_response_wrapper( + networks.update, ) self.delete = to_streamed_response_wrapper( networks.delete, @@ -323,8 +323,8 @@ class AsyncNetworksWithStreamingResponse: def __init__(self, networks: AsyncNetworks) -> None: self._networks = networks - self.create = async_to_streamed_response_wrapper( - networks.create, + self.update = async_to_streamed_response_wrapper( + networks.update, ) self.delete = async_to_streamed_response_wrapper( networks.delete, diff --git a/src/cloudflare/resources/zones/__init__.py b/src/cloudflare/resources/zones/__init__.py index 93436167862..1409eafbe98 100644 --- a/src/cloudflare/resources/zones/__init__.py +++ b/src/cloudflare/resources/zones/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. -from .holds import ( - Holds, - AsyncHolds, - HoldsWithRawResponse, - AsyncHoldsWithRawResponse, - HoldsWithStreamingResponse, - AsyncHoldsWithStreamingResponse, +from .hold import ( + Hold, + AsyncHold, + HoldWithRawResponse, + AsyncHoldWithRawResponse, + HoldWithStreamingResponse, + AsyncHoldWithStreamingResponse, ) from .zones import ( Zones, @@ -18,12 +18,12 @@ ) __all__ = [ - "Holds", - "AsyncHolds", - "HoldsWithRawResponse", - "AsyncHoldsWithRawResponse", - "HoldsWithStreamingResponse", - "AsyncHoldsWithStreamingResponse", + "Hold", + "AsyncHold", + "HoldWithRawResponse", + "AsyncHoldWithRawResponse", + "HoldWithStreamingResponse", + "AsyncHoldWithStreamingResponse", "Zones", "AsyncZones", "ZonesWithRawResponse", diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/hold.py similarity index 90% rename from src/cloudflare/resources/zones/holds.py rename to src/cloudflare/resources/zones/hold.py index 6e120c3f636..54e02af182e 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/hold.py @@ -28,17 +28,17 @@ make_request_options, ) -__all__ = ["Holds", "AsyncHolds"] +__all__ = ["Hold", "AsyncHold"] -class Holds(SyncAPIResource): +class Hold(SyncAPIResource): @cached_property - def with_raw_response(self) -> HoldsWithRawResponse: - return HoldsWithRawResponse(self) + def with_raw_response(self) -> HoldWithRawResponse: + return HoldWithRawResponse(self) @cached_property - def with_streaming_response(self) -> HoldsWithStreamingResponse: - return HoldsWithStreamingResponse(self) + def with_streaming_response(self) -> HoldWithStreamingResponse: + return HoldWithStreamingResponse(self) def enforce( self, @@ -176,14 +176,14 @@ def remove( ) -class AsyncHolds(AsyncAPIResource): +class AsyncHold(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncHoldsWithRawResponse: - return AsyncHoldsWithRawResponse(self) + def with_raw_response(self) -> AsyncHoldWithRawResponse: + return AsyncHoldWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncHoldsWithStreamingResponse: - return AsyncHoldsWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncHoldWithStreamingResponse: + return AsyncHoldWithStreamingResponse(self) async def enforce( self, @@ -321,61 +321,61 @@ async def remove( ) -class HoldsWithRawResponse: - def __init__(self, holds: Holds) -> None: - self._holds = holds +class HoldWithRawResponse: + def __init__(self, hold: Hold) -> None: + self._hold = hold self.enforce = to_raw_response_wrapper( - holds.enforce, + hold.enforce, ) self.get = to_raw_response_wrapper( - holds.get, + hold.get, ) self.remove = to_raw_response_wrapper( - holds.remove, + hold.remove, ) -class AsyncHoldsWithRawResponse: - def __init__(self, holds: AsyncHolds) -> None: - self._holds = holds +class AsyncHoldWithRawResponse: + def __init__(self, hold: AsyncHold) -> None: + self._hold = hold self.enforce = async_to_raw_response_wrapper( - holds.enforce, + hold.enforce, ) self.get = async_to_raw_response_wrapper( - holds.get, + hold.get, ) self.remove = async_to_raw_response_wrapper( - holds.remove, + hold.remove, ) -class HoldsWithStreamingResponse: - def __init__(self, holds: Holds) -> None: - self._holds = holds +class HoldWithStreamingResponse: + def __init__(self, hold: Hold) -> None: + self._hold = hold self.enforce = to_streamed_response_wrapper( - holds.enforce, + hold.enforce, ) self.get = to_streamed_response_wrapper( - holds.get, + hold.get, ) self.remove = to_streamed_response_wrapper( - holds.remove, + hold.remove, ) -class AsyncHoldsWithStreamingResponse: - def __init__(self, holds: AsyncHolds) -> None: - self._holds = holds +class AsyncHoldWithStreamingResponse: + def __init__(self, hold: AsyncHold) -> None: + self._hold = hold self.enforce = async_to_streamed_response_wrapper( - holds.enforce, + hold.enforce, ) self.get = async_to_streamed_response_wrapper( - holds.get, + hold.get, ) self.remove = async_to_streamed_response_wrapper( - holds.remove, + hold.remove, ) diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index 155a5e7dc07..1c60253daca 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -7,13 +7,13 @@ import httpx -from .holds import ( - Holds, - AsyncHolds, - HoldsWithRawResponse, - AsyncHoldsWithRawResponse, - HoldsWithStreamingResponse, - AsyncHoldsWithStreamingResponse, +from .hold import ( + Hold, + AsyncHold, + HoldWithRawResponse, + AsyncHoldWithRawResponse, + HoldWithStreamingResponse, + AsyncHoldWithStreamingResponse, ) from ...types import ( ZoneGetResponse, @@ -45,8 +45,8 @@ class Zones(SyncAPIResource): @cached_property - def holds(self) -> Holds: - return Holds(self._client) + def hold(self) -> Hold: + return Hold(self._client) @cached_property def with_raw_response(self) -> ZonesWithRawResponse: @@ -329,8 +329,8 @@ def get( class AsyncZones(AsyncAPIResource): @cached_property - def holds(self) -> AsyncHolds: - return AsyncHolds(self._client) + def hold(self) -> AsyncHold: + return AsyncHold(self._client) @cached_property def with_raw_response(self) -> AsyncZonesWithRawResponse: @@ -632,8 +632,8 @@ def __init__(self, zones: Zones) -> None: ) @cached_property - def holds(self) -> HoldsWithRawResponse: - return HoldsWithRawResponse(self._zones.holds) + def hold(self) -> HoldWithRawResponse: + return HoldWithRawResponse(self._zones.hold) class AsyncZonesWithRawResponse: @@ -657,8 +657,8 @@ def __init__(self, zones: AsyncZones) -> None: ) @cached_property - def holds(self) -> AsyncHoldsWithRawResponse: - return AsyncHoldsWithRawResponse(self._zones.holds) + def hold(self) -> AsyncHoldWithRawResponse: + return AsyncHoldWithRawResponse(self._zones.hold) class ZonesWithStreamingResponse: @@ -682,8 +682,8 @@ def __init__(self, zones: Zones) -> None: ) @cached_property - def holds(self) -> HoldsWithStreamingResponse: - return HoldsWithStreamingResponse(self._zones.holds) + def hold(self) -> HoldWithStreamingResponse: + return HoldWithStreamingResponse(self._zones.hold) class AsyncZonesWithStreamingResponse: @@ -707,5 +707,5 @@ def __init__(self, zones: AsyncZones) -> None: ) @cached_property - def holds(self) -> AsyncHoldsWithStreamingResponse: - return AsyncHoldsWithStreamingResponse(self._zones.holds) + def hold(self) -> AsyncHoldWithStreamingResponse: + return AsyncHoldWithStreamingResponse(self._zones.hold) diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index 91be750e538..e70e72676db 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -32,7 +32,7 @@ from .pagerule_list_params import PageruleListParams as PageruleListParams from .ruleset_get_response import RulesetGetResponse as RulesetGetResponse from .snippet_get_response import SnippetGetResponse as SnippetGetResponse -from .stream_create_params import StreamCreateParams as StreamCreateParams +from .stream_update_params import StreamUpdateParams as StreamUpdateParams from .tunnel_delete_params import TunnelDeleteParams as TunnelDeleteParams from .zone_create_response import ZoneCreateResponse as ZoneCreateResponse from .zone_delete_response import ZoneDeleteResponse as ZoneDeleteResponse @@ -58,7 +58,7 @@ from .pagerule_list_response import PageruleListResponse as PageruleListResponse from .pagerule_update_params import PageruleUpdateParams as PageruleUpdateParams from .rate_limit_list_params import RateLimitListParams as RateLimitListParams -from .stream_create_response import StreamCreateResponse as StreamCreateResponse +from .stream_update_response import StreamUpdateResponse as StreamUpdateResponse from .tunnel_delete_response import TunnelDeleteResponse as TunnelDeleteResponse from .access_tag_get_response import AccessTagGetResponse as AccessTagGetResponse from .account_update_response import AccountUpdateResponse as AccountUpdateResponse @@ -92,13 +92,10 @@ from .pagerule_update_response import PageruleUpdateResponse as PageruleUpdateResponse from .rate_limit_list_response import RateLimitListResponse as RateLimitListResponse from .rate_limit_update_params import RateLimitUpdateParams as RateLimitUpdateParams -from .certificate_create_params import CertificateCreateParams as CertificateCreateParams -from .certificate_list_response import CertificateListResponse as CertificateListResponse from .dns_firewall_get_response import DNSFirewallGetResponse as DNSFirewallGetResponse from .font_setting_get_response import FontSettingGetResponse as FontSettingGetResponse from .healthcheck_update_params import HealthcheckUpdateParams as HealthcheckUpdateParams from .page_shield_list_response import PageShieldListResponse as PageShieldListResponse -from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .url_scanner_scan_response import URLScannerScanResponse as URLScannerScanResponse from .waiting_room_get_response import WaitingRoomGetResponse as WaitingRoomGetResponse from .access_tag_create_response import AccessTagCreateResponse as AccessTagCreateResponse @@ -120,7 +117,6 @@ from .membership_delete_response import MembershipDeleteResponse as MembershipDeleteResponse from .membership_update_response import MembershipUpdateResponse as MembershipUpdateResponse from .rate_limit_update_response import RateLimitUpdateResponse as RateLimitUpdateResponse -from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .user_user_edit_user_params import UserUserEditUserParams as UserUserEditUserParams from .waiting_room_create_params import WaitingRoomCreateParams as WaitingRoomCreateParams @@ -131,7 +127,6 @@ from .account_member_get_response import AccountMemberGetResponse as AccountMemberGetResponse from .available_plan_get_response import AvailablePlanGetResponse as AvailablePlanGetResponse from .bot_management_get_response import BotManagementGetResponse as BotManagementGetResponse -from .certificate_create_response import CertificateCreateResponse as CertificateCreateResponse from .certificate_delete_response import CertificateDeleteResponse as CertificateDeleteResponse from .healthcheck_delete_response import HealthcheckDeleteResponse as HealthcheckDeleteResponse from .healthcheck_update_response import HealthcheckUpdateResponse as HealthcheckUpdateResponse @@ -155,7 +150,6 @@ from .purge_cach_zone_purge_params import PurgeCachZonePurgeParams as PurgeCachZonePurgeParams from .speed_api_tests_get_response import SpeedAPITestsGetResponse as SpeedAPITestsGetResponse from .speed_api_trends_list_params import SpeedAPITrendsListParams as SpeedAPITrendsListParams -from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse from .subscription_delete_response import SubscriptionDeleteResponse as SubscriptionDeleteResponse from .subscription_update_response import SubscriptionUpdateResponse as SubscriptionUpdateResponse from .user_user_edit_user_response import UserUserEditUserResponse as UserUserEditUserResponse @@ -183,8 +177,8 @@ from .account_member_update_response import AccountMemberUpdateResponse as AccountMemberUpdateResponse from .bot_management_update_response import BotManagementUpdateResponse as BotManagementUpdateResponse from .custom_certificate_list_params import CustomCertificateListParams as CustomCertificateListParams -from .mtls_certificate_create_params import MtlsCertificateCreateParams as MtlsCertificateCreateParams from .mtls_certificate_list_response import MtlsCertificateListResponse as MtlsCertificateListResponse +from .mtls_certificate_update_params import MtlsCertificateUpdateParams as MtlsCertificateUpdateParams from .purge_cach_zone_purge_response import PurgeCachZonePurgeResponse as PurgeCachZonePurgeResponse from .speed_api_trends_list_response import SpeedAPITrendsListResponse as SpeedAPITrendsListResponse from .warp_connector_create_response import WarpConnectorCreateResponse as WarpConnectorCreateResponse @@ -203,8 +197,8 @@ from .custom_certificate_list_response import CustomCertificateListResponse as CustomCertificateListResponse from .custom_certificate_update_params import CustomCertificateUpdateParams as CustomCertificateUpdateParams from .keyless_certificate_get_response import KeylessCertificateGetResponse as KeylessCertificateGetResponse -from .mtls_certificate_create_response import MtlsCertificateCreateResponse as MtlsCertificateCreateResponse from .mtls_certificate_delete_response import MtlsCertificateDeleteResponse as MtlsCertificateDeleteResponse +from .mtls_certificate_update_response import MtlsCertificateUpdateResponse as MtlsCertificateUpdateResponse from .speed_api_schedule_delete_params import SpeedAPIScheduleDeleteParams as SpeedAPIScheduleDeleteParams from .keyless_certificate_create_params import KeylessCertificateCreateParams as KeylessCertificateCreateParams from .keyless_certificate_list_response import KeylessCertificateListResponse as KeylessCertificateListResponse @@ -274,9 +268,18 @@ from .origin_post_quantum_encryption_update_response import ( OriginPostQuantumEncryptionUpdateResponse as OriginPostQuantumEncryptionUpdateResponse, ) +from .certificate_origin_ca_create_certificate_params import ( + CertificateOriginCaCreateCertificateParams as CertificateOriginCaCreateCertificateParams, +) from .tunnel_argo_tunnel_create_an_argo_tunnel_params import ( TunnelArgoTunnelCreateAnArgoTunnelParams as TunnelArgoTunnelCreateAnArgoTunnelParams, ) +from .certificate_origin_ca_list_certificates_response import ( + CertificateOriginCaListCertificatesResponse as CertificateOriginCaListCertificatesResponse, +) +from .certificate_origin_ca_create_certificate_response import ( + CertificateOriginCaCreateCertificateResponse as CertificateOriginCaCreateCertificateResponse, +) from .tunnel_argo_tunnel_create_an_argo_tunnel_response import ( TunnelArgoTunnelCreateAnArgoTunnelResponse as TunnelArgoTunnelCreateAnArgoTunnelResponse, ) @@ -328,6 +331,9 @@ from .subscription_account_subscriptions_list_subscriptions_response import ( SubscriptionAccountSubscriptionsListSubscriptionsResponse as SubscriptionAccountSubscriptionsListSubscriptionsResponse, ) +from .subscription_zone_subscription_create_zone_subscription_params import ( + SubscriptionZoneSubscriptionCreateZoneSubscriptionParams as SubscriptionZoneSubscriptionCreateZoneSubscriptionParams, +) from .subscription_zone_subscription_update_zone_subscription_params import ( SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams as SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams, ) @@ -340,9 +346,15 @@ from .pcap_magic_pcap_collection_list_packet_capture_requests_response import ( PcapMagicPcapCollectionListPacketCaptureRequestsResponse as PcapMagicPcapCollectionListPacketCaptureRequestsResponse, ) +from .subscription_zone_subscription_create_zone_subscription_response import ( + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse as SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, +) from .subscription_zone_subscription_update_zone_subscription_response import ( SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse as SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse, ) +from .subscription_zone_subscription_zone_subscription_details_response import ( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse as SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, +) from .available_rate_plan_zone_rate_plan_list_available_rate_plans_response import ( AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse as AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse, ) diff --git a/src/cloudflare/types/access/users/__init__.py b/src/cloudflare/types/access/users/__init__.py index 61554f7b31c..c91d6fdfd9b 100644 --- a/src/cloudflare/types/access/users/__init__.py +++ b/src/cloudflare/types/access/users/__init__.py @@ -2,7 +2,9 @@ from __future__ import annotations -from .failed_login_get_response import FailedLoginGetResponse as FailedLoginGetResponse from .active_session_get_response import ActiveSessionGetResponse as ActiveSessionGetResponse from .active_session_list_response import ActiveSessionListResponse as ActiveSessionListResponse from .last_seen_identity_get_response import LastSeenIdentityGetResponse as LastSeenIdentityGetResponse +from .failed_login_zero_trust_users_get_failed_logins_response import ( + FailedLoginZeroTrustUsersGetFailedLoginsResponse as FailedLoginZeroTrustUsersGetFailedLoginsResponse, +) diff --git a/src/cloudflare/types/access/users/failed_login_get_response.py b/src/cloudflare/types/access/users/failed_login_get_response.py deleted file mode 100644 index 509cf4f9a19..00000000000 --- a/src/cloudflare/types/access/users/failed_login_get_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional - -from ...._models import BaseModel - -__all__ = ["FailedLoginGetResponse", "FailedLoginGetResponseItem"] - - -class FailedLoginGetResponseItem(BaseModel): - expiration: Optional[int] = None - - metadata: Optional[object] = None - - -FailedLoginGetResponse = List[FailedLoginGetResponseItem] diff --git a/src/cloudflare/types/access/users/failed_login_zero_trust_users_get_failed_logins_response.py b/src/cloudflare/types/access/users/failed_login_zero_trust_users_get_failed_logins_response.py new file mode 100644 index 00000000000..46c759437b3 --- /dev/null +++ b/src/cloudflare/types/access/users/failed_login_zero_trust_users_get_failed_logins_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["FailedLoginZeroTrustUsersGetFailedLoginsResponse", "FailedLoginZeroTrustUsersGetFailedLoginsResponseItem"] + + +class FailedLoginZeroTrustUsersGetFailedLoginsResponseItem(BaseModel): + expiration: Optional[int] = None + + metadata: Optional[object] = None + + +FailedLoginZeroTrustUsersGetFailedLoginsResponse = List[FailedLoginZeroTrustUsersGetFailedLoginsResponseItem] diff --git a/src/cloudflare/types/acms/__init__.py b/src/cloudflare/types/acms/__init__.py index 2e5241b0c63..ccb40d031f0 100644 --- a/src/cloudflare/types/acms/__init__.py +++ b/src/cloudflare/types/acms/__init__.py @@ -3,5 +3,5 @@ from __future__ import annotations from .total_tls_get_response import TotalTLSGetResponse as TotalTLSGetResponse -from .total_tls_create_params import TotalTLSCreateParams as TotalTLSCreateParams -from .total_tls_create_response import TotalTLSCreateResponse as TotalTLSCreateResponse +from .total_tls_update_params import TotalTLSUpdateParams as TotalTLSUpdateParams +from .total_tls_update_response import TotalTLSUpdateResponse as TotalTLSUpdateResponse diff --git a/src/cloudflare/types/acms/total_tls_create_params.py b/src/cloudflare/types/acms/total_tls_update_params.py similarity index 84% rename from src/cloudflare/types/acms/total_tls_create_params.py rename to src/cloudflare/types/acms/total_tls_update_params.py index e73c37d3414..779b85fc7d1 100644 --- a/src/cloudflare/types/acms/total_tls_create_params.py +++ b/src/cloudflare/types/acms/total_tls_update_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["TotalTLSCreateParams"] +__all__ = ["TotalTLSUpdateParams"] -class TotalTLSCreateParams(TypedDict, total=False): +class TotalTLSUpdateParams(TypedDict, total=False): enabled: Required[bool] """ If enabled, Total TLS will order a hostname specific TLS certificate for any diff --git a/src/cloudflare/types/acms/total_tls_create_response.py b/src/cloudflare/types/acms/total_tls_update_response.py similarity index 89% rename from src/cloudflare/types/acms/total_tls_create_response.py rename to src/cloudflare/types/acms/total_tls_update_response.py index 42999d11049..77efe919432 100644 --- a/src/cloudflare/types/acms/total_tls_create_response.py +++ b/src/cloudflare/types/acms/total_tls_update_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["TotalTLSCreateResponse"] +__all__ = ["TotalTLSUpdateResponse"] -class TotalTLSCreateResponse(BaseModel): +class TotalTLSUpdateResponse(BaseModel): certificate_authority: Optional[Literal["google", "lets_encrypt"]] = None """The Certificate Authority that Total TLS certificates will be issued through.""" diff --git a/src/cloudflare/types/certificate_create_response.py b/src/cloudflare/types/certificate_create_response.py deleted file mode 100644 index ce522263c01..00000000000 --- a/src/cloudflare/types/certificate_create_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Union - -__all__ = ["CertificateCreateResponse"] - -CertificateCreateResponse = Union[object, str] diff --git a/src/cloudflare/types/certificate_create_params.py b/src/cloudflare/types/certificate_origin_ca_create_certificate_params.py similarity index 85% rename from src/cloudflare/types/certificate_create_params.py rename to src/cloudflare/types/certificate_origin_ca_create_certificate_params.py index e409fcc6ba9..d47d5258e36 100644 --- a/src/cloudflare/types/certificate_create_params.py +++ b/src/cloudflare/types/certificate_origin_ca_create_certificate_params.py @@ -5,10 +5,10 @@ from typing import Iterable from typing_extensions import Literal, TypedDict -__all__ = ["CertificateCreateParams"] +__all__ = ["CertificateOriginCaCreateCertificateParams"] -class CertificateCreateParams(TypedDict, total=False): +class CertificateOriginCaCreateCertificateParams(TypedDict, total=False): csr: str """The Certificate Signing Request (CSR). Must be newline-encoded.""" diff --git a/src/cloudflare/types/certificate_origin_ca_create_certificate_response.py b/src/cloudflare/types/certificate_origin_ca_create_certificate_response.py new file mode 100644 index 00000000000..ef63084e018 --- /dev/null +++ b/src/cloudflare/types/certificate_origin_ca_create_certificate_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Union + +__all__ = ["CertificateOriginCaCreateCertificateResponse"] + +CertificateOriginCaCreateCertificateResponse = Union[object, str] diff --git a/src/cloudflare/types/certificate_list_response.py b/src/cloudflare/types/certificate_origin_ca_list_certificates_response.py similarity index 78% rename from src/cloudflare/types/certificate_list_response.py rename to src/cloudflare/types/certificate_origin_ca_list_certificates_response.py index f8c7be28032..a0ff0253538 100644 --- a/src/cloudflare/types/certificate_list_response.py +++ b/src/cloudflare/types/certificate_origin_ca_list_certificates_response.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["CertificateListResponse", "CertificateListResponseItem"] +__all__ = ["CertificateOriginCaListCertificatesResponse", "CertificateOriginCaListCertificatesResponseItem"] -class CertificateListResponseItem(BaseModel): +class CertificateOriginCaListCertificatesResponseItem(BaseModel): csr: str """The Certificate Signing Request (CSR). Must be newline-encoded.""" @@ -38,4 +38,4 @@ class CertificateListResponseItem(BaseModel): """When the certificate will expire.""" -CertificateListResponse = List[CertificateListResponseItem] +CertificateOriginCaListCertificatesResponse = List[CertificateOriginCaListCertificatesResponseItem] diff --git a/src/cloudflare/types/custom_ns/__init__.py b/src/cloudflare/types/custom_ns/__init__.py index a35db695742..d759686dfd7 100644 --- a/src/cloudflare/types/custom_ns/__init__.py +++ b/src/cloudflare/types/custom_ns/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .verify_create_response import VerifyCreateResponse as VerifyCreateResponse +from .verify_update_response import VerifyUpdateResponse as VerifyUpdateResponse from .availability_get_response import AvailabilityGetResponse as AvailabilityGetResponse diff --git a/src/cloudflare/types/custom_ns/verify_create_response.py b/src/cloudflare/types/custom_ns/verify_update_response.py similarity index 69% rename from src/cloudflare/types/custom_ns/verify_create_response.py rename to src/cloudflare/types/custom_ns/verify_update_response.py index 351b958bbf6..4fa38003ae4 100644 --- a/src/cloudflare/types/custom_ns/verify_create_response.py +++ b/src/cloudflare/types/custom_ns/verify_update_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["VerifyCreateResponse", "VerifyCreateResponseItem", "VerifyCreateResponseItemDNSRecord"] +__all__ = ["VerifyUpdateResponse", "VerifyUpdateResponseItem", "VerifyUpdateResponseItemDNSRecord"] -class VerifyCreateResponseItemDNSRecord(BaseModel): +class VerifyUpdateResponseItemDNSRecord(BaseModel): type: Optional[Literal["A", "AAAA"]] = None """DNS record type.""" @@ -16,8 +16,8 @@ class VerifyCreateResponseItemDNSRecord(BaseModel): """DNS record contents (an IPv4 or IPv6 address).""" -class VerifyCreateResponseItem(BaseModel): - dns_records: List[VerifyCreateResponseItemDNSRecord] +class VerifyUpdateResponseItem(BaseModel): + dns_records: List[VerifyUpdateResponseItemDNSRecord] """A and AAAA records associated with the nameserver.""" ns_name: str @@ -33,4 +33,4 @@ class VerifyCreateResponseItem(BaseModel): """The number of the set that this name server belongs to.""" -VerifyCreateResponse = List[VerifyCreateResponseItem] +VerifyUpdateResponse = List[VerifyUpdateResponseItem] diff --git a/src/cloudflare/types/logpush/__init__.py b/src/cloudflare/types/logpush/__init__.py index 53213a01061..4e7d46595ce 100644 --- a/src/cloudflare/types/logpush/__init__.py +++ b/src/cloudflare/types/logpush/__init__.py @@ -7,11 +7,11 @@ from .job_create_params import JobCreateParams as JobCreateParams from .job_list_response import JobListResponse as JobListResponse from .job_update_params import JobUpdateParams as JobUpdateParams -from .edge_create_params import EdgeCreateParams as EdgeCreateParams +from .edge_update_params import EdgeUpdateParams as EdgeUpdateParams from .job_create_response import JobCreateResponse as JobCreateResponse from .job_delete_response import JobDeleteResponse as JobDeleteResponse from .job_update_response import JobUpdateResponse as JobUpdateResponse -from .edge_create_response import EdgeCreateResponse as EdgeCreateResponse +from .edge_update_response import EdgeUpdateResponse as EdgeUpdateResponse from .ownership_post_accounts_account_identifier_logpush_ownership_params import ( OwnershipPostAccountsAccountIdentifierLogpushOwnershipParams as OwnershipPostAccountsAccountIdentifierLogpushOwnershipParams, ) diff --git a/src/cloudflare/types/logpush/edge_create_params.py b/src/cloudflare/types/logpush/edge_update_params.py similarity index 84% rename from src/cloudflare/types/logpush/edge_create_params.py rename to src/cloudflare/types/logpush/edge_update_params.py index 4b71a585acb..105cfa53587 100644 --- a/src/cloudflare/types/logpush/edge_create_params.py +++ b/src/cloudflare/types/logpush/edge_update_params.py @@ -4,10 +4,10 @@ from typing_extensions import TypedDict -__all__ = ["EdgeCreateParams"] +__all__ = ["EdgeUpdateParams"] -class EdgeCreateParams(TypedDict, total=False): +class EdgeUpdateParams(TypedDict, total=False): fields: str """Comma-separated list of fields.""" diff --git a/src/cloudflare/types/logpush/edge_create_response.py b/src/cloudflare/types/logpush/edge_update_response.py similarity index 90% rename from src/cloudflare/types/logpush/edge_create_response.py rename to src/cloudflare/types/logpush/edge_update_response.py index b459f0994aa..cb57619e8eb 100644 --- a/src/cloudflare/types/logpush/edge_create_response.py +++ b/src/cloudflare/types/logpush/edge_update_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["EdgeCreateResponse"] +__all__ = ["EdgeUpdateResponse"] -class EdgeCreateResponse(BaseModel): +class EdgeUpdateResponse(BaseModel): destination_conf: Optional[str] = None """Unique WebSocket address that will receive messages from Cloudflare’s edge.""" diff --git a/src/cloudflare/types/mtls_certificate_create_params.py b/src/cloudflare/types/mtls_certificate_update_params.py similarity index 82% rename from src/cloudflare/types/mtls_certificate_create_params.py rename to src/cloudflare/types/mtls_certificate_update_params.py index e747765b0e6..00700ca9b7d 100644 --- a/src/cloudflare/types/mtls_certificate_create_params.py +++ b/src/cloudflare/types/mtls_certificate_update_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["MtlsCertificateCreateParams"] +__all__ = ["MtlsCertificateUpdateParams"] -class MtlsCertificateCreateParams(TypedDict, total=False): +class MtlsCertificateUpdateParams(TypedDict, total=False): ca: Required[bool] """Indicates whether the certificate is a CA or leaf certificate.""" diff --git a/src/cloudflare/types/mtls_certificate_create_response.py b/src/cloudflare/types/mtls_certificate_update_response.py similarity index 91% rename from src/cloudflare/types/mtls_certificate_create_response.py rename to src/cloudflare/types/mtls_certificate_update_response.py index 1963e1fa8b6..02aa2577ecc 100644 --- a/src/cloudflare/types/mtls_certificate_create_response.py +++ b/src/cloudflare/types/mtls_certificate_update_response.py @@ -5,10 +5,10 @@ from .._models import BaseModel -__all__ = ["MtlsCertificateCreateResponse"] +__all__ = ["MtlsCertificateUpdateResponse"] -class MtlsCertificateCreateResponse(BaseModel): +class MtlsCertificateUpdateResponse(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/ssls/__init__.py b/src/cloudflare/types/ssls/__init__.py index 7536eb7c2a3..c6b0ffd22ce 100644 --- a/src/cloudflare/types/ssls/__init__.py +++ b/src/cloudflare/types/ssls/__init__.py @@ -2,19 +2,27 @@ from __future__ import annotations -from .analyze_create_params import AnalyzeCreateParams as AnalyzeCreateParams -from .analyze_create_response import AnalyzeCreateResponse as AnalyzeCreateResponse from .verification_update_params import VerificationUpdateParams as VerificationUpdateParams -from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams from .recommendation_list_response import RecommendationListResponse as RecommendationListResponse from .verification_update_response import VerificationUpdateResponse as VerificationUpdateResponse from .certificate_pack_get_response import CertificatePackGetResponse as CertificatePackGetResponse -from .certificate_pack_list_response import CertificatePackListResponse as CertificatePackListResponse from .certificate_pack_delete_response import CertificatePackDeleteResponse as CertificatePackDeleteResponse from .certificate_pack_update_response import CertificatePackUpdateResponse as CertificatePackUpdateResponse +from .analyze_analyze_certificate_analyze_certificate_params import ( + AnalyzeAnalyzeCertificateAnalyzeCertificateParams as AnalyzeAnalyzeCertificateAnalyzeCertificateParams, +) +from .analyze_analyze_certificate_analyze_certificate_response import ( + AnalyzeAnalyzeCertificateAnalyzeCertificateResponse as AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, +) from .verification_ssl_verification_ssl_verification_details_params import ( VerificationSSLVerificationSSLVerificationDetailsParams as VerificationSSLVerificationSSLVerificationDetailsParams, ) from .verification_ssl_verification_ssl_verification_details_response import ( VerificationSSLVerificationSSLVerificationDetailsResponse as VerificationSSLVerificationSSLVerificationDetailsResponse, ) +from .certificate_pack_certificate_packs_list_certificate_packs_params import ( + CertificatePackCertificatePacksListCertificatePacksParams as CertificatePackCertificatePacksListCertificatePacksParams, +) +from .certificate_pack_certificate_packs_list_certificate_packs_response import ( + CertificatePackCertificatePacksListCertificatePacksResponse as CertificatePackCertificatePacksListCertificatePacksResponse, +) diff --git a/src/cloudflare/types/ssls/analyze_create_params.py b/src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_params.py similarity index 80% rename from src/cloudflare/types/ssls/analyze_create_params.py rename to src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_params.py index 9445dfba147..8b0cdf5a48e 100644 --- a/src/cloudflare/types/ssls/analyze_create_params.py +++ b/src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, TypedDict -__all__ = ["AnalyzeCreateParams"] +__all__ = ["AnalyzeAnalyzeCertificateAnalyzeCertificateParams"] -class AnalyzeCreateParams(TypedDict, total=False): +class AnalyzeAnalyzeCertificateAnalyzeCertificateParams(TypedDict, total=False): bundle_method: Literal["ubiquitous", "optimal", "force"] """ A ubiquitous bundle has the highest probability of being verified everywhere, diff --git a/src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_response.py b/src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_response.py new file mode 100644 index 00000000000..fd2598c8bef --- /dev/null +++ b/src/cloudflare/types/ssls/analyze_analyze_certificate_analyze_certificate_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Union + +__all__ = ["AnalyzeAnalyzeCertificateAnalyzeCertificateResponse"] + +AnalyzeAnalyzeCertificateAnalyzeCertificateResponse = Union[object, str] diff --git a/src/cloudflare/types/ssls/analyze_create_response.py b/src/cloudflare/types/ssls/analyze_create_response.py deleted file mode 100644 index 9eee59f1651..00000000000 --- a/src/cloudflare/types/ssls/analyze_create_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Union - -__all__ = ["AnalyzeCreateResponse"] - -AnalyzeCreateResponse = Union[object, str] diff --git a/src/cloudflare/types/ssls/certificate_pack_list_params.py b/src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_params.py similarity index 60% rename from src/cloudflare/types/ssls/certificate_pack_list_params.py rename to src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_params.py index 90ee161ff0c..6d81b6d3578 100644 --- a/src/cloudflare/types/ssls/certificate_pack_list_params.py +++ b/src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_params.py @@ -4,9 +4,9 @@ from typing_extensions import Literal, TypedDict -__all__ = ["CertificatePackListParams"] +__all__ = ["CertificatePackCertificatePacksListCertificatePacksParams"] -class CertificatePackListParams(TypedDict, total=False): +class CertificatePackCertificatePacksListCertificatePacksParams(TypedDict, total=False): status: Literal["all"] """Include Certificate Packs of all statuses, not just active ones.""" diff --git a/src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_response.py b/src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_response.py new file mode 100644 index 00000000000..6afab81ab79 --- /dev/null +++ b/src/cloudflare/types/ssls/certificate_pack_certificate_packs_list_certificate_packs_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import List + +__all__ = ["CertificatePackCertificatePacksListCertificatePacksResponse"] + +CertificatePackCertificatePacksListCertificatePacksResponse = List[object] diff --git a/src/cloudflare/types/ssls/certificate_pack_list_response.py b/src/cloudflare/types/ssls/certificate_pack_list_response.py deleted file mode 100644 index 1e7be0ba626..00000000000 --- a/src/cloudflare/types/ssls/certificate_pack_list_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List - -__all__ = ["CertificatePackListResponse"] - -CertificatePackListResponse = List[object] diff --git a/src/cloudflare/types/ssls/certificate_packs/__init__.py b/src/cloudflare/types/ssls/certificate_packs/__init__.py index a5cb69889c8..2aedba010e9 100644 --- a/src/cloudflare/types/ssls/certificate_packs/__init__.py +++ b/src/cloudflare/types/ssls/certificate_packs/__init__.py @@ -2,6 +2,12 @@ from __future__ import annotations -from .quota_get_response import QuotaGetResponse as QuotaGetResponse -from .order_create_params import OrderCreateParams as OrderCreateParams -from .order_create_response import OrderCreateResponse as OrderCreateResponse +from .quota_certificate_packs_get_certificate_pack_quotas_response import ( + QuotaCertificatePacksGetCertificatePackQuotasResponse as QuotaCertificatePacksGetCertificatePackQuotasResponse, +) +from .order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params import ( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams as OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams, +) +from .order_certificate_packs_order_advanced_certificate_manager_certificate_pack_response import ( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse as OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, +) diff --git a/src/cloudflare/types/ssls/certificate_packs/order_create_params.py b/src/cloudflare/types/ssls/certificate_packs/order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params.py similarity index 86% rename from src/cloudflare/types/ssls/certificate_packs/order_create_params.py rename to src/cloudflare/types/ssls/certificate_packs/order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params.py index 89c27f13291..84177283de8 100644 --- a/src/cloudflare/types/ssls/certificate_packs/order_create_params.py +++ b/src/cloudflare/types/ssls/certificate_packs/order_certificate_packs_order_advanced_certificate_manager_certificate_pack_params.py @@ -5,10 +5,10 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -__all__ = ["OrderCreateParams"] +__all__ = ["OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams"] -class OrderCreateParams(TypedDict, total=False): +class OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams(TypedDict, total=False): certificate_authority: Required[Literal["google", "lets_encrypt"]] """Certificate Authority selected for the order. diff --git a/src/cloudflare/types/ssls/certificate_packs/order_create_response.py b/src/cloudflare/types/ssls/certificate_packs/order_certificate_packs_order_advanced_certificate_manager_certificate_pack_response.py similarity index 91% rename from src/cloudflare/types/ssls/certificate_packs/order_create_response.py rename to src/cloudflare/types/ssls/certificate_packs/order_certificate_packs_order_advanced_certificate_manager_certificate_pack_response.py index f575173d848..365f1d60ed7 100644 --- a/src/cloudflare/types/ssls/certificate_packs/order_create_response.py +++ b/src/cloudflare/types/ssls/certificate_packs/order_certificate_packs_order_advanced_certificate_manager_certificate_pack_response.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["OrderCreateResponse"] +__all__ = ["OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse"] -class OrderCreateResponse(BaseModel): +class OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/ssls/certificate_packs/quota_get_response.py b/src/cloudflare/types/ssls/certificate_packs/quota_certificate_packs_get_certificate_pack_quotas_response.py similarity index 67% rename from src/cloudflare/types/ssls/certificate_packs/quota_get_response.py rename to src/cloudflare/types/ssls/certificate_packs/quota_certificate_packs_get_certificate_pack_quotas_response.py index 86dc248e3c3..d2cc786f6d2 100644 --- a/src/cloudflare/types/ssls/certificate_packs/quota_get_response.py +++ b/src/cloudflare/types/ssls/certificate_packs/quota_certificate_packs_get_certificate_pack_quotas_response.py @@ -4,7 +4,7 @@ from ...._models import BaseModel -__all__ = ["QuotaGetResponse", "Advanced"] +__all__ = ["QuotaCertificatePacksGetCertificatePackQuotasResponse", "Advanced"] class Advanced(BaseModel): @@ -15,5 +15,5 @@ class Advanced(BaseModel): """Quantity Used.""" -class QuotaGetResponse(BaseModel): +class QuotaCertificatePacksGetCertificatePackQuotasResponse(BaseModel): advanced: Optional[Advanced] = None diff --git a/src/cloudflare/types/stream_create_params.py b/src/cloudflare/types/stream_update_params.py similarity index 96% rename from src/cloudflare/types/stream_create_params.py rename to src/cloudflare/types/stream_update_params.py index 3c815dc1f95..670fdba7545 100644 --- a/src/cloudflare/types/stream_create_params.py +++ b/src/cloudflare/types/stream_update_params.py @@ -8,10 +8,10 @@ from .._utils import PropertyInfo -__all__ = ["StreamCreateParams"] +__all__ = ["StreamUpdateParams"] -class StreamCreateParams(TypedDict, total=False): +class StreamUpdateParams(TypedDict, total=False): account_id: Required[str] """The account identifier tag.""" diff --git a/src/cloudflare/types/stream_create_response.py b/src/cloudflare/types/stream_update_response.py similarity index 98% rename from src/cloudflare/types/stream_create_response.py rename to src/cloudflare/types/stream_update_response.py index 7c07767ebb5..0c089f6fd67 100644 --- a/src/cloudflare/types/stream_create_response.py +++ b/src/cloudflare/types/stream_update_response.py @@ -8,7 +8,7 @@ from .._models import BaseModel -__all__ = ["StreamCreateResponse", "Input", "Playback", "Status", "Watermark"] +__all__ = ["StreamUpdateResponse", "Input", "Playback", "Status", "Watermark"] class Input(BaseModel): @@ -115,7 +115,7 @@ class Watermark(BaseModel): """The width of the image in pixels.""" -class StreamCreateResponse(BaseModel): +class StreamUpdateResponse(BaseModel): allowed_origins: Optional[List[str]] = FieldInfo(alias="allowedOrigins", default=None) """Lists the origins allowed to display the video. diff --git a/src/cloudflare/types/subscription_create_response.py b/src/cloudflare/types/subscription_create_response.py deleted file mode 100644 index 7b702f6189f..00000000000 --- a/src/cloudflare/types/subscription_create_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Union, Optional - -__all__ = ["SubscriptionCreateResponse"] - -SubscriptionCreateResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/subscription_get_response.py b/src/cloudflare/types/subscription_get_response.py deleted file mode 100644 index 0cb7db3bf35..00000000000 --- a/src/cloudflare/types/subscription_get_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Union, Optional - -__all__ = ["SubscriptionGetResponse"] - -SubscriptionGetResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/subscription_create_params.py b/src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_params.py similarity index 88% rename from src/cloudflare/types/subscription_create_params.py rename to src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_params.py index 6845b6799c0..3aef5bbec81 100644 --- a/src/cloudflare/types/subscription_create_params.py +++ b/src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_params.py @@ -5,10 +5,10 @@ from typing import List, Iterable from typing_extensions import Literal, TypedDict -__all__ = ["SubscriptionCreateParams", "App", "ComponentValue", "RatePlan", "Zone"] +__all__ = ["SubscriptionZoneSubscriptionCreateZoneSubscriptionParams", "App", "ComponentValue", "RatePlan", "Zone"] -class SubscriptionCreateParams(TypedDict, total=False): +class SubscriptionZoneSubscriptionCreateZoneSubscriptionParams(TypedDict, total=False): app: App component_values: Iterable[ComponentValue] diff --git a/src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_response.py b/src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_response.py new file mode 100644 index 00000000000..b40512828b3 --- /dev/null +++ b/src/cloudflare/types/subscription_zone_subscription_create_zone_subscription_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Union, Optional + +__all__ = ["SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse"] + +SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/subscription_zone_subscription_zone_subscription_details_response.py b/src/cloudflare/types/subscription_zone_subscription_zone_subscription_details_response.py new file mode 100644 index 00000000000..49086e61bba --- /dev/null +++ b/src/cloudflare/types/subscription_zone_subscription_zone_subscription_details_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Union, Optional + +__all__ = ["SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse"] + +SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/teamnets/routes/__init__.py b/src/cloudflare/types/teamnets/routes/__init__.py index b41001f3e6f..ed1eab73308 100644 --- a/src/cloudflare/types/teamnets/routes/__init__.py +++ b/src/cloudflare/types/teamnets/routes/__init__.py @@ -4,7 +4,7 @@ from .ip_get_params import IPGetParams as IPGetParams from .ip_get_response import IPGetResponse as IPGetResponse -from .network_create_params import NetworkCreateParams as NetworkCreateParams from .network_delete_params import NetworkDeleteParams as NetworkDeleteParams -from .network_create_response import NetworkCreateResponse as NetworkCreateResponse +from .network_update_params import NetworkUpdateParams as NetworkUpdateParams from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse +from .network_update_response import NetworkUpdateResponse as NetworkUpdateResponse diff --git a/src/cloudflare/types/teamnets/routes/network_create_params.py b/src/cloudflare/types/teamnets/routes/network_update_params.py similarity index 85% rename from src/cloudflare/types/teamnets/routes/network_create_params.py rename to src/cloudflare/types/teamnets/routes/network_update_params.py index 4064928345f..4a54ed9cf1b 100644 --- a/src/cloudflare/types/teamnets/routes/network_create_params.py +++ b/src/cloudflare/types/teamnets/routes/network_update_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["NetworkCreateParams"] +__all__ = ["NetworkUpdateParams"] -class NetworkCreateParams(TypedDict, total=False): +class NetworkUpdateParams(TypedDict, total=False): account_id: Required[str] """Cloudflare account ID""" diff --git a/src/cloudflare/types/teamnets/routes/network_create_response.py b/src/cloudflare/types/teamnets/routes/network_update_response.py similarity index 92% rename from src/cloudflare/types/teamnets/routes/network_create_response.py rename to src/cloudflare/types/teamnets/routes/network_update_response.py index b7a16ded849..dc035d1d262 100644 --- a/src/cloudflare/types/teamnets/routes/network_create_response.py +++ b/src/cloudflare/types/teamnets/routes/network_update_response.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["NetworkCreateResponse"] +__all__ = ["NetworkUpdateResponse"] -class NetworkCreateResponse(BaseModel): +class NetworkUpdateResponse(BaseModel): id: Optional[str] = None """UUID of the route.""" diff --git a/tests/api_resources/access/users/test_failed_logins.py b/tests/api_resources/access/users/test_failed_logins.py index ee381ab030d..7c5b14a6df0 100644 --- a/tests/api_resources/access/users/test_failed_logins.py +++ b/tests/api_resources/access/users/test_failed_logins.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.access.users import FailedLoginGetResponse +from cloudflare.types.access.users import FailedLoginZeroTrustUsersGetFailedLoginsResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,17 +19,17 @@ class TestFailedLogins: @pytest.mark.skip() @parametrize - def test_method_get(self, client: Cloudflare) -> None: - failed_login = client.access.users.failed_logins.get( + def test_method_zero_trust_users_get_failed_logins(self, client: Cloudflare) -> None: + failed_login = client.access.users.failed_logins.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FailedLoginGetResponse], failed_login, path=["response"]) + assert_matches_type(Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse], failed_login, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.access.users.failed_logins.with_raw_response.get( + def test_raw_response_zero_trust_users_get_failed_logins(self, client: Cloudflare) -> None: + response = client.access.users.failed_logins.with_raw_response.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -37,12 +37,12 @@ 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" failed_login = response.parse() - assert_matches_type(Optional[FailedLoginGetResponse], failed_login, path=["response"]) + assert_matches_type(Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse], failed_login, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.access.users.failed_logins.with_streaming_response.get( + def test_streaming_response_zero_trust_users_get_failed_logins(self, client: Cloudflare) -> None: + with client.access.users.failed_logins.with_streaming_response.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -50,21 +50,23 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" failed_login = response.parse() - assert_matches_type(Optional[FailedLoginGetResponse], failed_login, path=["response"]) + assert_matches_type( + Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse], failed_login, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + def test_path_params_zero_trust_users_get_failed_logins(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.access.users.failed_logins.with_raw_response.get( + client.access.users.failed_logins.with_raw_response.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.access.users.failed_logins.with_raw_response.get( + client.access.users.failed_logins.with_raw_response.zero_trust_users_get_failed_logins( "", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -75,17 +77,17 @@ class TestAsyncFailedLogins: @pytest.mark.skip() @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - failed_login = await async_client.access.users.failed_logins.get( + async def test_method_zero_trust_users_get_failed_logins(self, async_client: AsyncCloudflare) -> None: + failed_login = await async_client.access.users.failed_logins.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FailedLoginGetResponse], failed_login, path=["response"]) + assert_matches_type(Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse], failed_login, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.access.users.failed_logins.with_raw_response.get( + async def test_raw_response_zero_trust_users_get_failed_logins(self, async_client: AsyncCloudflare) -> None: + response = await async_client.access.users.failed_logins.with_raw_response.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -93,12 +95,12 @@ 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" failed_login = await response.parse() - assert_matches_type(Optional[FailedLoginGetResponse], failed_login, path=["response"]) + assert_matches_type(Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse], failed_login, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.access.users.failed_logins.with_streaming_response.get( + async def test_streaming_response_zero_trust_users_get_failed_logins(self, async_client: AsyncCloudflare) -> None: + async with async_client.access.users.failed_logins.with_streaming_response.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -106,21 +108,23 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" failed_login = await response.parse() - assert_matches_type(Optional[FailedLoginGetResponse], failed_login, path=["response"]) + assert_matches_type( + Optional[FailedLoginZeroTrustUsersGetFailedLoginsResponse], failed_login, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_zero_trust_users_get_failed_logins(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.access.users.failed_logins.with_raw_response.get( + await async_client.access.users.failed_logins.with_raw_response.zero_trust_users_get_failed_logins( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.access.users.failed_logins.with_raw_response.get( + await async_client.access.users.failed_logins.with_raw_response.zero_trust_users_get_failed_logins( "", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/acms/test_total_tls.py b/tests/api_resources/acms/test_total_tls.py index 79bf931d3a3..4ea1208e949 100644 --- a/tests/api_resources/acms/test_total_tls.py +++ b/tests/api_resources/acms/test_total_tls.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.acms import TotalTLSGetResponse, TotalTLSCreateResponse +from cloudflare.types.acms import TotalTLSGetResponse, TotalTLSUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,27 +19,27 @@ class TestTotalTLS: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - total_tls = client.acms.total_tls.create( + def test_method_update(self, client: Cloudflare) -> None: + total_tls = client.acms.total_tls.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - total_tls = client.acms.total_tls.create( + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + total_tls = client.acms.total_tls.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, certificate_authority="google", ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.acms.total_tls.with_raw_response.create( + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.acms.total_tls.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) @@ -47,12 +47,12 @@ 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" total_tls = response.parse() - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.acms.total_tls.with_streaming_response.create( + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.acms.total_tls.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) as response: @@ -60,15 +60,15 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = response.parse() - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.acms.total_tls.with_raw_response.create( + client.acms.total_tls.with_raw_response.update( "", enabled=True, ) @@ -121,27 +121,27 @@ class TestAsyncTotalTLS: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - total_tls = await async_client.acms.total_tls.create( + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + total_tls = await async_client.acms.total_tls.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - total_tls = await async_client.acms.total_tls.create( + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + total_tls = await async_client.acms.total_tls.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, certificate_authority="google", ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.acms.total_tls.with_raw_response.create( + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.acms.total_tls.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) @@ -149,12 +149,12 @@ 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" total_tls = await response.parse() - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.acms.total_tls.with_streaming_response.create( + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.acms.total_tls.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) as response: @@ -162,15 +162,15 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = await response.parse() - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(TotalTLSUpdateResponse, total_tls, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.acms.total_tls.with_raw_response.create( + await async_client.acms.total_tls.with_raw_response.update( "", enabled=True, ) diff --git a/tests/api_resources/custom_ns/test_verifies.py b/tests/api_resources/custom_ns/test_verifies.py index 22084b5c0c2..460697ff8ac 100644 --- a/tests/api_resources/custom_ns/test_verifies.py +++ b/tests/api_resources/custom_ns/test_verifies.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.custom_ns import VerifyCreateResponse +from cloudflare.types.custom_ns import VerifyUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestVerifies: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - verify = client.custom_ns.verifies.create( + def test_method_update(self, client: Cloudflare) -> None: + verify = client.custom_ns.verifies.update( "372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[VerifyCreateResponse], verify, path=["response"]) + assert_matches_type(Optional[VerifyUpdateResponse], verify, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.custom_ns.verifies.with_raw_response.create( + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.custom_ns.verifies.with_raw_response.update( "372e67954025e0ba6aaa6d586b9e0b59", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" verify = response.parse() - assert_matches_type(Optional[VerifyCreateResponse], verify, path=["response"]) + assert_matches_type(Optional[VerifyUpdateResponse], verify, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.custom_ns.verifies.with_streaming_response.create( + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.custom_ns.verifies.with_streaming_response.update( "372e67954025e0ba6aaa6d586b9e0b59", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" verify = response.parse() - assert_matches_type(Optional[VerifyCreateResponse], verify, path=["response"]) + assert_matches_type(Optional[VerifyUpdateResponse], verify, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.custom_ns.verifies.with_raw_response.create( + client.custom_ns.verifies.with_raw_response.update( "", ) @@ -65,42 +65,42 @@ class TestAsyncVerifies: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - verify = await async_client.custom_ns.verifies.create( + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + verify = await async_client.custom_ns.verifies.update( "372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[VerifyCreateResponse], verify, path=["response"]) + assert_matches_type(Optional[VerifyUpdateResponse], verify, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.custom_ns.verifies.with_raw_response.create( + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.custom_ns.verifies.with_raw_response.update( "372e67954025e0ba6aaa6d586b9e0b59", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" verify = await response.parse() - assert_matches_type(Optional[VerifyCreateResponse], verify, path=["response"]) + assert_matches_type(Optional[VerifyUpdateResponse], verify, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.custom_ns.verifies.with_streaming_response.create( + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.custom_ns.verifies.with_streaming_response.update( "372e67954025e0ba6aaa6d586b9e0b59", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" verify = await response.parse() - assert_matches_type(Optional[VerifyCreateResponse], verify, path=["response"]) + assert_matches_type(Optional[VerifyUpdateResponse], verify, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.custom_ns.verifies.with_raw_response.create( + await async_client.custom_ns.verifies.with_raw_response.update( "", ) diff --git a/tests/api_resources/logpush/test_edges.py b/tests/api_resources/logpush/test_edges.py index 57480bdb0c1..743f2cf7ec5 100644 --- a/tests/api_resources/logpush/test_edges.py +++ b/tests/api_resources/logpush/test_edges.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logpush import EdgeGetResponse, EdgeCreateResponse +from cloudflare.types.logpush import EdgeGetResponse, EdgeUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,54 +19,54 @@ class TestEdges: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - edge = client.logpush.edges.create( + def test_method_update(self, client: Cloudflare) -> None: + edge = client.logpush.edges.update( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - edge = client.logpush.edges.create( + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + edge = client.logpush.edges.update( "023e105f4ecef8ad9ca31a8372d0c353", fields="ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID", filter='{"where":{"and":[{"key":"ClientCountry","operator":"neq","value":"ca"}]}}', sample=1, ) - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.logpush.edges.with_raw_response.create( + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.logpush.edges.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = response.parse() - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.logpush.edges.with_streaming_response.create( + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.logpush.edges.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = response.parse() - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.logpush.edges.with_raw_response.create( + client.logpush.edges.with_raw_response.update( "", ) @@ -118,54 +118,54 @@ class TestAsyncEdges: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - edge = await async_client.logpush.edges.create( + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + edge = await async_client.logpush.edges.update( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - edge = await async_client.logpush.edges.create( + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + edge = await async_client.logpush.edges.update( "023e105f4ecef8ad9ca31a8372d0c353", fields="ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID", filter='{"where":{"and":[{"key":"ClientCountry","operator":"neq","value":"ca"}]}}', sample=1, ) - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logpush.edges.with_raw_response.create( + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.logpush.edges.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = await response.parse() - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.logpush.edges.with_streaming_response.create( + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.logpush.edges.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = await response.parse() - assert_matches_type(Optional[EdgeCreateResponse], edge, path=["response"]) + assert_matches_type(Optional[EdgeUpdateResponse], edge, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.logpush.edges.with_raw_response.create( + await async_client.logpush.edges.with_raw_response.update( "", ) diff --git a/tests/api_resources/ssls/certificate_packs/test_orders.py b/tests/api_resources/ssls/certificate_packs/test_orders.py index 455d2c33a73..1175734baa4 100644 --- a/tests/api_resources/ssls/certificate_packs/test_orders.py +++ b/tests/api_resources/ssls/certificate_packs/test_orders.py @@ -9,7 +9,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ssls.certificate_packs import OrderCreateResponse +from cloudflare.types.ssls.certificate_packs import ( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,35 +21,49 @@ class TestOrders: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - order = client.ssls.certificate_packs.orders.create( - "023e105f4ecef8ad9ca31a8372d0c353", - certificate_authority="lets_encrypt", - hosts=["example.com", "*.example.com", "www.example.com"], - type="advanced", - validation_method="txt", - validity_days=14, + def test_method_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, client: Cloudflare + ) -> None: + order = ( + client.ssls.certificate_packs.orders.certificate_packs_order_advanced_certificate_manager_certificate_pack( + "023e105f4ecef8ad9ca31a8372d0c353", + certificate_authority="lets_encrypt", + hosts=["example.com", "*.example.com", "www.example.com"], + type="advanced", + validation_method="txt", + validity_days=14, + ) + ) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] ) - assert_matches_type(OrderCreateResponse, order, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - order = client.ssls.certificate_packs.orders.create( - "023e105f4ecef8ad9ca31a8372d0c353", - certificate_authority="lets_encrypt", - hosts=["example.com", "*.example.com", "www.example.com"], - type="advanced", - validation_method="txt", - validity_days=14, - cloudflare_branding=False, + def test_method_certificate_packs_order_advanced_certificate_manager_certificate_pack_with_all_params( + self, client: Cloudflare + ) -> None: + order = ( + client.ssls.certificate_packs.orders.certificate_packs_order_advanced_certificate_manager_certificate_pack( + "023e105f4ecef8ad9ca31a8372d0c353", + certificate_authority="lets_encrypt", + hosts=["example.com", "*.example.com", "www.example.com"], + type="advanced", + validation_method="txt", + validity_days=14, + cloudflare_branding=False, + ) + ) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] ) - assert_matches_type(OrderCreateResponse, order, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.ssls.certificate_packs.orders.with_raw_response.create( + def test_raw_response_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, client: Cloudflare + ) -> None: + response = client.ssls.certificate_packs.orders.with_raw_response.certificate_packs_order_advanced_certificate_manager_certificate_pack( "023e105f4ecef8ad9ca31a8372d0c353", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -59,12 +75,16 @@ 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" order = response.parse() - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] + ) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.ssls.certificate_packs.orders.with_streaming_response.create( + def test_streaming_response_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, client: Cloudflare + ) -> None: + with client.ssls.certificate_packs.orders.with_streaming_response.certificate_packs_order_advanced_certificate_manager_certificate_pack( "023e105f4ecef8ad9ca31a8372d0c353", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -76,15 +96,19 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" order = response.parse() - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, client: Cloudflare + ) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.ssls.certificate_packs.orders.with_raw_response.create( + client.ssls.certificate_packs.orders.with_raw_response.certificate_packs_order_advanced_certificate_manager_certificate_pack( "", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -99,8 +123,10 @@ class TestAsyncOrders: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - order = await async_client.ssls.certificate_packs.orders.create( + async def test_method_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, async_client: AsyncCloudflare + ) -> None: + order = await async_client.ssls.certificate_packs.orders.certificate_packs_order_advanced_certificate_manager_certificate_pack( "023e105f4ecef8ad9ca31a8372d0c353", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -108,12 +134,16 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: validation_method="txt", validity_days=14, ) - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] + ) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - order = await async_client.ssls.certificate_packs.orders.create( + async def test_method_certificate_packs_order_advanced_certificate_manager_certificate_pack_with_all_params( + self, async_client: AsyncCloudflare + ) -> None: + order = await async_client.ssls.certificate_packs.orders.certificate_packs_order_advanced_certificate_manager_certificate_pack( "023e105f4ecef8ad9ca31a8372d0c353", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -122,12 +152,16 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare validity_days=14, cloudflare_branding=False, ) - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] + ) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssls.certificate_packs.orders.with_raw_response.create( + async def test_raw_response_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, async_client: AsyncCloudflare + ) -> None: + response = await async_client.ssls.certificate_packs.orders.with_raw_response.certificate_packs_order_advanced_certificate_manager_certificate_pack( "023e105f4ecef8ad9ca31a8372d0c353", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -139,12 +173,16 @@ 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" order = await response.parse() - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] + ) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssls.certificate_packs.orders.with_streaming_response.create( + async def test_streaming_response_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, async_client: AsyncCloudflare + ) -> None: + async with async_client.ssls.certificate_packs.orders.with_streaming_response.certificate_packs_order_advanced_certificate_manager_certificate_pack( "023e105f4ecef8ad9ca31a8372d0c353", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], @@ -156,15 +194,19 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" order = await response.parse() - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type( + OrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, order, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_certificate_packs_order_advanced_certificate_manager_certificate_pack( + self, async_client: AsyncCloudflare + ) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssls.certificate_packs.orders.with_raw_response.create( + await async_client.ssls.certificate_packs.orders.with_raw_response.certificate_packs_order_advanced_certificate_manager_certificate_pack( "", certificate_authority="lets_encrypt", hosts=["example.com", "*.example.com", "www.example.com"], diff --git a/tests/api_resources/ssls/certificate_packs/test_quotas.py b/tests/api_resources/ssls/certificate_packs/test_quotas.py index cca106e770f..80bfdf3ae97 100644 --- a/tests/api_resources/ssls/certificate_packs/test_quotas.py +++ b/tests/api_resources/ssls/certificate_packs/test_quotas.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ssls.certificate_packs import QuotaGetResponse +from cloudflare.types.ssls.certificate_packs import QuotaCertificatePacksGetCertificatePackQuotasResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestQuotas: @pytest.mark.skip() @parametrize - def test_method_get(self, client: Cloudflare) -> None: - quota = client.ssls.certificate_packs.quotas.get( + def test_method_certificate_packs_get_certificate_pack_quotas(self, client: Cloudflare) -> None: + quota = client.ssls.certificate_packs.quotas.certificate_packs_get_certificate_pack_quotas( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(QuotaCertificatePacksGetCertificatePackQuotasResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.ssls.certificate_packs.quotas.with_raw_response.get( + def test_raw_response_certificate_packs_get_certificate_pack_quotas(self, client: Cloudflare) -> None: + response = client.ssls.certificate_packs.quotas.with_raw_response.certificate_packs_get_certificate_pack_quotas( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(QuotaCertificatePacksGetCertificatePackQuotasResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.ssls.certificate_packs.quotas.with_streaming_response.get( + def test_streaming_response_certificate_packs_get_certificate_pack_quotas(self, client: Cloudflare) -> None: + with client.ssls.certificate_packs.quotas.with_streaming_response.certificate_packs_get_certificate_pack_quotas( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(QuotaCertificatePacksGetCertificatePackQuotasResponse, quota, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + def test_path_params_certificate_packs_get_certificate_pack_quotas(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.ssls.certificate_packs.quotas.with_raw_response.get( + client.ssls.certificate_packs.quotas.with_raw_response.certificate_packs_get_certificate_pack_quotas( "", ) @@ -65,42 +65,48 @@ class TestAsyncQuotas: @pytest.mark.skip() @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - quota = await async_client.ssls.certificate_packs.quotas.get( + async def test_method_certificate_packs_get_certificate_pack_quotas(self, async_client: AsyncCloudflare) -> None: + quota = await async_client.ssls.certificate_packs.quotas.certificate_packs_get_certificate_pack_quotas( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(QuotaCertificatePacksGetCertificatePackQuotasResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssls.certificate_packs.quotas.with_raw_response.get( + async def test_raw_response_certificate_packs_get_certificate_pack_quotas( + self, async_client: AsyncCloudflare + ) -> None: + response = await async_client.ssls.certificate_packs.quotas.with_raw_response.certificate_packs_get_certificate_pack_quotas( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = await response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(QuotaCertificatePacksGetCertificatePackQuotasResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssls.certificate_packs.quotas.with_streaming_response.get( + async def test_streaming_response_certificate_packs_get_certificate_pack_quotas( + self, async_client: AsyncCloudflare + ) -> None: + async with async_client.ssls.certificate_packs.quotas.with_streaming_response.certificate_packs_get_certificate_pack_quotas( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = await response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(QuotaCertificatePacksGetCertificatePackQuotasResponse, quota, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_certificate_packs_get_certificate_pack_quotas( + self, async_client: AsyncCloudflare + ) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssls.certificate_packs.quotas.with_raw_response.get( + await async_client.ssls.certificate_packs.quotas.with_raw_response.certificate_packs_get_certificate_pack_quotas( "", ) diff --git a/tests/api_resources/ssls/test_analyzes.py b/tests/api_resources/ssls/test_analyzes.py index 0fcaee86ba9..99e86fbd74b 100644 --- a/tests/api_resources/ssls/test_analyzes.py +++ b/tests/api_resources/ssls/test_analyzes.py @@ -9,7 +9,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ssls import AnalyzeCreateResponse +from cloudflare.types.ssls import ( + AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,53 +21,53 @@ class TestAnalyzes: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - analyze = client.ssls.analyzes.create( + def test_method_analyze_certificate_analyze_certificate(self, client: Cloudflare) -> None: + analyze = client.ssls.analyzes.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - analyze = client.ssls.analyzes.create( + def test_method_analyze_certificate_analyze_certificate_with_all_params(self, client: Cloudflare) -> None: + analyze = client.ssls.analyzes.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", bundle_method="ubiquitous", certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", ) - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.ssls.analyzes.with_raw_response.create( + def test_raw_response_analyze_certificate_analyze_certificate(self, client: Cloudflare) -> None: + response = client.ssls.analyzes.with_raw_response.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.ssls.analyzes.with_streaming_response.create( + def test_streaming_response_analyze_certificate_analyze_certificate(self, client: Cloudflare) -> None: + with client.ssls.analyzes.with_streaming_response.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_analyze_certificate_analyze_certificate(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.ssls.analyzes.with_raw_response.create( + client.ssls.analyzes.with_raw_response.analyze_certificate_analyze_certificate( "", ) @@ -75,52 +77,56 @@ class TestAsyncAnalyzes: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - analyze = await async_client.ssls.analyzes.create( + async def test_method_analyze_certificate_analyze_certificate(self, async_client: AsyncCloudflare) -> None: + analyze = await async_client.ssls.analyzes.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - analyze = await async_client.ssls.analyzes.create( + async def test_method_analyze_certificate_analyze_certificate_with_all_params( + self, async_client: AsyncCloudflare + ) -> None: + analyze = await async_client.ssls.analyzes.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", bundle_method="ubiquitous", certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", ) - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssls.analyzes.with_raw_response.create( + async def test_raw_response_analyze_certificate_analyze_certificate(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssls.analyzes.with_raw_response.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = await response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssls.analyzes.with_streaming_response.create( + async def test_streaming_response_analyze_certificate_analyze_certificate( + self, async_client: AsyncCloudflare + ) -> None: + async with async_client.ssls.analyzes.with_streaming_response.analyze_certificate_analyze_certificate( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = await response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(AnalyzeAnalyzeCertificateAnalyzeCertificateResponse, analyze, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_analyze_certificate_analyze_certificate(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssls.analyzes.with_raw_response.create( + await async_client.ssls.analyzes.with_raw_response.analyze_certificate_analyze_certificate( "", ) diff --git a/tests/api_resources/ssls/test_certificate_packs.py b/tests/api_resources/ssls/test_certificate_packs.py index 5b77426f86f..a459910d5e6 100644 --- a/tests/api_resources/ssls/test_certificate_packs.py +++ b/tests/api_resources/ssls/test_certificate_packs.py @@ -11,9 +11,9 @@ from tests.utils import assert_matches_type from cloudflare.types.ssls import ( CertificatePackGetResponse, - CertificatePackListResponse, CertificatePackDeleteResponse, CertificatePackUpdateResponse, + CertificatePackCertificatePacksListCertificatePacksResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -76,105 +76,115 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - certificate_pack = client.ssls.certificate_packs.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - certificate_pack = client.ssls.certificate_packs.list( + def test_method_delete(self, client: Cloudflare) -> None: + certificate_pack = client.ssls.certificate_packs.delete( "023e105f4ecef8ad9ca31a8372d0c353", - status="all", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ssls.certificate_packs.with_raw_response.list( + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.ssls.certificate_packs.with_raw_response.delete( "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ssls.certificate_packs.with_streaming_response.list( + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.ssls.certificate_packs.with_streaming_response.delete( "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.ssls.certificate_packs.with_raw_response.list( + client.ssls.certificate_packs.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): + client.ssls.certificate_packs.with_raw_response.delete( "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - certificate_pack = client.ssls.certificate_packs.delete( + def test_method_certificate_packs_list_certificate_packs(self, client: Cloudflare) -> None: + certificate_pack = client.ssls.certificate_packs.certificate_packs_list_certificate_packs( "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], certificate_pack, path=["response"] + ) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.ssls.certificate_packs.with_raw_response.delete( + def test_method_certificate_packs_list_certificate_packs_with_all_params(self, client: Cloudflare) -> None: + certificate_pack = client.ssls.certificate_packs.certificate_packs_list_certificate_packs( + "023e105f4ecef8ad9ca31a8372d0c353", + status="all", + ) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], certificate_pack, path=["response"] + ) + + @pytest.mark.skip() + @parametrize + def test_raw_response_certificate_packs_list_certificate_packs(self, client: Cloudflare) -> None: + response = client.ssls.certificate_packs.with_raw_response.certificate_packs_list_certificate_packs( "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], certificate_pack, path=["response"] + ) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.ssls.certificate_packs.with_streaming_response.delete( + def test_streaming_response_certificate_packs_list_certificate_packs(self, client: Cloudflare) -> None: + with client.ssls.certificate_packs.with_streaming_response.certificate_packs_list_certificate_packs( "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], + certificate_pack, + path=["response"], + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_certificate_packs_list_certificate_packs(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.ssls.certificate_packs.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): - client.ssls.certificate_packs.with_raw_response.delete( + client.ssls.certificate_packs.with_raw_response.certificate_packs_list_certificate_packs( "", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @@ -287,105 +297,119 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - certificate_pack = await async_client.ssls.certificate_packs.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - certificate_pack = await async_client.ssls.certificate_packs.list( + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + certificate_pack = await async_client.ssls.certificate_packs.delete( "023e105f4ecef8ad9ca31a8372d0c353", - status="all", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssls.certificate_packs.with_raw_response.list( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssls.certificate_packs.with_raw_response.delete( "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssls.certificate_packs.with_streaming_response.list( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.ssls.certificate_packs.with_streaming_response.delete( "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(Optional[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssls.certificate_packs.with_raw_response.list( + await async_client.ssls.certificate_packs.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): + await async_client.ssls.certificate_packs.with_raw_response.delete( "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - certificate_pack = await async_client.ssls.certificate_packs.delete( + async def test_method_certificate_packs_list_certificate_packs(self, async_client: AsyncCloudflare) -> None: + certificate_pack = await async_client.ssls.certificate_packs.certificate_packs_list_certificate_packs( "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], certificate_pack, path=["response"] + ) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssls.certificate_packs.with_raw_response.delete( + async def test_method_certificate_packs_list_certificate_packs_with_all_params( + self, async_client: AsyncCloudflare + ) -> None: + certificate_pack = await async_client.ssls.certificate_packs.certificate_packs_list_certificate_packs( + "023e105f4ecef8ad9ca31a8372d0c353", + status="all", + ) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], certificate_pack, path=["response"] + ) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_certificate_packs_list_certificate_packs(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssls.certificate_packs.with_raw_response.certificate_packs_list_certificate_packs( "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], certificate_pack, path=["response"] + ) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssls.certificate_packs.with_streaming_response.delete( + async def test_streaming_response_certificate_packs_list_certificate_packs( + self, async_client: AsyncCloudflare + ) -> None: + async with async_client.ssls.certificate_packs.with_streaming_response.certificate_packs_list_certificate_packs( "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type( + Optional[CertificatePackCertificatePacksListCertificatePacksResponse], + certificate_pack, + path=["response"], + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_certificate_packs_list_certificate_packs(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssls.certificate_packs.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): - await async_client.ssls.certificate_packs.with_raw_response.delete( + await async_client.ssls.certificate_packs.with_raw_response.certificate_packs_list_certificate_packs( "", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() diff --git a/tests/api_resources/teamnets/routes/test_networks.py b/tests/api_resources/teamnets/routes/test_networks.py index 67cedf26bf1..f7168bfb7b7 100644 --- a/tests/api_resources/teamnets/routes/test_networks.py +++ b/tests/api_resources/teamnets/routes/test_networks.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.teamnets.routes import ( - NetworkCreateResponse, NetworkDeleteResponse, + NetworkUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,28 +22,28 @@ class TestNetworks: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - network = client.teamnets.routes.networks.create( + def test_method_update(self, client: Cloudflare) -> None: + network = client.teamnets.routes.networks.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - network = client.teamnets.routes.networks.create( + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + network = client.teamnets.routes.networks.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", comment="Example comment for this route.", virtual_network_id={}, ) - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.teamnets.routes.networks.with_raw_response.create( + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.teamnets.routes.networks.with_raw_response.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) @@ -51,12 +51,12 @@ 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" network = response.parse() - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.teamnets.routes.networks.with_streaming_response.create( + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.teamnets.routes.networks.with_streaming_response.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -64,21 +64,21 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.teamnets.routes.networks.with_raw_response.create( + client.teamnets.routes.networks.with_raw_response.update( "172.16.0.0%2F16", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - client.teamnets.routes.networks.with_raw_response.create( + client.teamnets.routes.networks.with_raw_response.update( "", account_id="699d98642c564d2e855e9661899b7252", ) @@ -151,28 +151,28 @@ class TestAsyncNetworks: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - network = await async_client.teamnets.routes.networks.create( + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + network = await async_client.teamnets.routes.networks.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - network = await async_client.teamnets.routes.networks.create( + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + network = await async_client.teamnets.routes.networks.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", comment="Example comment for this route.", virtual_network_id={}, ) - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.teamnets.routes.networks.with_raw_response.create( + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.teamnets.routes.networks.with_raw_response.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) @@ -180,12 +180,12 @@ 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" network = await response.parse() - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.teamnets.routes.networks.with_streaming_response.create( + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.teamnets.routes.networks.with_streaming_response.update( "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -193,21 +193,21 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(NetworkCreateResponse, network, path=["response"]) + assert_matches_type(NetworkUpdateResponse, network, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.teamnets.routes.networks.with_raw_response.create( + await async_client.teamnets.routes.networks.with_raw_response.update( "172.16.0.0%2F16", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_network_encoded` but received ''"): - await async_client.teamnets.routes.networks.with_raw_response.create( + await async_client.teamnets.routes.networks.with_raw_response.update( "", account_id="699d98642c564d2e855e9661899b7252", ) diff --git a/tests/api_resources/test_certificates.py b/tests/api_resources/test_certificates.py index b8f12f303ee..346bff5385d 100644 --- a/tests/api_resources/test_certificates.py +++ b/tests/api_resources/test_certificates.py @@ -11,9 +11,9 @@ from tests.utils import assert_matches_type from cloudflare.types import ( CertificateGetResponse, - CertificateListResponse, - CertificateCreateResponse, CertificateDeleteResponse, + CertificateOriginCaListCertificatesResponse, + CertificateOriginCaCreateCertificateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,73 +22,6 @@ class TestCertificates: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - certificate = client.certificates.create() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - certificate = client.certificates.create( - csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], - request_type="origin-rsa", - requested_validity=5475, - ) - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.certificates.with_raw_response.create() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - certificate = response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.certificates.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - certificate = response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - certificate = client.certificates.list() - assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.certificates.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - certificate = response.parse() - assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.certificates.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - certificate = response.parse() - assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Cloudflare) -> None: @@ -173,77 +106,77 @@ def test_path_params_get(self, client: Cloudflare) -> None: "", ) - -class TestAsyncCertificates: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - certificate = await async_client.certificates.create() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + def test_method_origin_ca_create_certificate(self, client: Cloudflare) -> None: + certificate = client.certificates.origin_ca_create_certificate() + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - certificate = await async_client.certificates.create( + def test_method_origin_ca_create_certificate_with_all_params(self, client: Cloudflare) -> None: + certificate = client.certificates.origin_ca_create_certificate( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", hostnames=["example.com", "*.example.com"], request_type="origin-rsa", requested_validity=5475, ) - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.certificates.with_raw_response.create() + def test_raw_response_origin_ca_create_certificate(self, client: Cloudflare) -> None: + response = client.certificates.with_raw_response.origin_ca_create_certificate() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - certificate = await response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + certificate = response.parse() + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.certificates.with_streaming_response.create() as response: + def test_streaming_response_origin_ca_create_certificate(self, client: Cloudflare) -> None: + with client.certificates.with_streaming_response.origin_ca_create_certificate() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - certificate = await response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + certificate = response.parse() + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - certificate = await async_client.certificates.list() - assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"]) + def test_method_origin_ca_list_certificates(self, client: Cloudflare) -> None: + certificate = client.certificates.origin_ca_list_certificates() + assert_matches_type(Optional[CertificateOriginCaListCertificatesResponse], certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.certificates.with_raw_response.list() + def test_raw_response_origin_ca_list_certificates(self, client: Cloudflare) -> None: + response = client.certificates.with_raw_response.origin_ca_list_certificates() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - certificate = await response.parse() - assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"]) + certificate = response.parse() + assert_matches_type(Optional[CertificateOriginCaListCertificatesResponse], certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.certificates.with_streaming_response.list() as response: + def test_streaming_response_origin_ca_list_certificates(self, client: Cloudflare) -> None: + with client.certificates.with_streaming_response.origin_ca_list_certificates() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - certificate = await response.parse() - assert_matches_type(Optional[CertificateListResponse], certificate, path=["response"]) + certificate = response.parse() + assert_matches_type(Optional[CertificateOriginCaListCertificatesResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True + +class TestAsyncCertificates: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @@ -327,3 +260,70 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: await async_client.certificates.with_raw_response.get( "", ) + + @pytest.mark.skip() + @parametrize + async def test_method_origin_ca_create_certificate(self, async_client: AsyncCloudflare) -> None: + certificate = await async_client.certificates.origin_ca_create_certificate() + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_origin_ca_create_certificate_with_all_params(self, async_client: AsyncCloudflare) -> None: + certificate = await async_client.certificates.origin_ca_create_certificate( + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", + hostnames=["example.com", "*.example.com"], + request_type="origin-rsa", + requested_validity=5475, + ) + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_origin_ca_create_certificate(self, async_client: AsyncCloudflare) -> None: + response = await async_client.certificates.with_raw_response.origin_ca_create_certificate() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + certificate = await response.parse() + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_origin_ca_create_certificate(self, async_client: AsyncCloudflare) -> None: + async with async_client.certificates.with_streaming_response.origin_ca_create_certificate() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + certificate = await response.parse() + assert_matches_type(CertificateOriginCaCreateCertificateResponse, certificate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_origin_ca_list_certificates(self, async_client: AsyncCloudflare) -> None: + certificate = await async_client.certificates.origin_ca_list_certificates() + assert_matches_type(Optional[CertificateOriginCaListCertificatesResponse], certificate, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_origin_ca_list_certificates(self, async_client: AsyncCloudflare) -> None: + response = await async_client.certificates.with_raw_response.origin_ca_list_certificates() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + certificate = await response.parse() + assert_matches_type(Optional[CertificateOriginCaListCertificatesResponse], certificate, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_origin_ca_list_certificates(self, async_client: AsyncCloudflare) -> None: + async with async_client.certificates.with_streaming_response.origin_ca_list_certificates() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + certificate = await response.parse() + assert_matches_type(Optional[CertificateOriginCaListCertificatesResponse], certificate, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_mtls_certificates.py b/tests/api_resources/test_mtls_certificates.py index 4cf2f60a244..2be87e3ad6a 100644 --- a/tests/api_resources/test_mtls_certificates.py +++ b/tests/api_resources/test_mtls_certificates.py @@ -12,8 +12,8 @@ from cloudflare.types import ( MtlsCertificateGetResponse, MtlsCertificateListResponse, - MtlsCertificateCreateResponse, MtlsCertificateDeleteResponse, + MtlsCertificateUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,30 +24,30 @@ class TestMtlsCertificates: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - mtls_certificate = client.mtls_certificates.create( + def test_method_update(self, client: Cloudflare) -> None: + mtls_certificate = client.mtls_certificates.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - mtls_certificate = client.mtls_certificates.create( + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + mtls_certificate = client.mtls_certificates.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", name="example_ca_cert", private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDTidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LDfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0d7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+FXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwDHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lqibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9lhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAsJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrLXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlxzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VNV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62xXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/vvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", ) - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.mtls_certificates.with_raw_response.create( + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.mtls_certificates.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", @@ -56,12 +56,12 @@ 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" mtls_certificate = response.parse() - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.mtls_certificates.with_streaming_response.create( + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.mtls_certificates.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", @@ -70,15 +70,15 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.mtls_certificates.with_raw_response.create( + client.mtls_certificates.with_raw_response.update( "", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", @@ -236,30 +236,30 @@ class TestAsyncMtlsCertificates: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - mtls_certificate = await async_client.mtls_certificates.create( + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + mtls_certificate = await async_client.mtls_certificates.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - mtls_certificate = await async_client.mtls_certificates.create( + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + mtls_certificate = await async_client.mtls_certificates.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", name="example_ca_cert", private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDTidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LDfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0d7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+FXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwDHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lqibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9lhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAsJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrLXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlxzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VNV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62xXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/vvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", ) - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.mtls_certificates.with_raw_response.create( + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.mtls_certificates.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", @@ -268,12 +268,12 @@ 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" mtls_certificate = await response.parse() - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.mtls_certificates.with_streaming_response.create( + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.mtls_certificates.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", @@ -282,15 +282,15 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MtlsCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(MtlsCertificateUpdateResponse, mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.mtls_certificates.with_raw_response.create( + await async_client.mtls_certificates.with_raw_response.update( "", ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", diff --git a/tests/api_resources/test_stream.py b/tests/api_resources/test_stream.py index ad2339bbc83..53301de57b6 100644 --- a/tests/api_resources/test_stream.py +++ b/tests/api_resources/test_stream.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.types import ( StreamGetResponse, - StreamCreateResponse, + StreamUpdateResponse, StreamStreamVideosListVideosResponse, ) from cloudflare._utils import parse_datetime @@ -24,17 +24,17 @@ class TestStream: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - stream = client.stream.create( + def test_method_update(self, client: Cloudflare) -> None: + stream = client.stream.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - stream = client.stream.create( + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + stream = client.stream.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", allowed_origins=["example.com"], @@ -46,12 +46,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: thumbnail_timestamp_pct=0.529241, upload_expiry=parse_datetime("2014-01-02T02:20:00Z"), ) - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.stream.with_raw_response.create( + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.stream.with_raw_response.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -59,12 +59,12 @@ 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" stream = response.parse() - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.stream.with_streaming_response.create( + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.stream.with_streaming_response.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -72,21 +72,21 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = response.parse() - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.with_raw_response.create( + client.stream.with_raw_response.update( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.with_raw_response.create( + client.stream.with_raw_response.update( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -301,17 +301,17 @@ class TestAsyncStream: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - stream = await async_client.stream.create( + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + stream = await async_client.stream.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - stream = await async_client.stream.create( + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + stream = await async_client.stream.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", allowed_origins=["example.com"], @@ -323,12 +323,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare thumbnail_timestamp_pct=0.529241, upload_expiry=parse_datetime("2014-01-02T02:20:00Z"), ) - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.with_raw_response.create( + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.with_raw_response.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -336,12 +336,12 @@ 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" stream = await response.parse() - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.with_streaming_response.create( + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.with_streaming_response.update( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -349,21 +349,21 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = await response.parse() - assert_matches_type(StreamCreateResponse, stream, path=["response"]) + assert_matches_type(StreamUpdateResponse, stream, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.with_raw_response.create( + await async_client.stream.with_raw_response.update( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.with_raw_response.create( + await async_client.stream.with_raw_response.update( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 9c4151d45f9..e657c9e756e 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -10,13 +10,13 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - SubscriptionGetResponse, - SubscriptionCreateResponse, SubscriptionDeleteResponse, SubscriptionUpdateResponse, SubscriptionAccountSubscriptionsListSubscriptionsResponse, SubscriptionAccountSubscriptionsCreateSubscriptionResponse, + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse, + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,88 +25,6 @@ class TestSubscriptions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - subscription = client.subscriptions.create( - "506e3185e9c882d175a2d0cb0093d9f2", - ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - subscription = client.subscriptions.create( - "506e3185e9c882d175a2d0cb0093d9f2", - app={"install_id": "string"}, - component_values=[ - { - "default": 5, - "name": "page_rules", - "price": 5, - "value": 20, - }, - { - "default": 5, - "name": "page_rules", - "price": 5, - "value": 20, - }, - { - "default": 5, - "name": "page_rules", - "price": 5, - "value": 20, - }, - ], - frequency="monthly", - rate_plan={ - "currency": "USD", - "externally_managed": False, - "id": "free", - "is_contract": False, - "public_name": "Business Plan", - "scope": "zone", - "sets": ["string", "string", "string"], - }, - zone={}, - ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.subscriptions.with_raw_response.create( - "506e3185e9c882d175a2d0cb0093d9f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.subscriptions.with_streaming_response.create( - "506e3185e9c882d175a2d0cb0093d9f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.subscriptions.with_raw_response.create( - "", - ) - @pytest.mark.skip() @parametrize def test_method_update(self, client: Cloudflare) -> None: @@ -390,43 +308,85 @@ def test_path_params_account_subscriptions_list_subscriptions(self, client: Clou @pytest.mark.skip() @parametrize - def test_method_get(self, client: Cloudflare) -> None: - subscription = client.subscriptions.get( + def test_method_zone_subscription_create_zone_subscription(self, client: Cloudflare) -> None: + subscription = client.subscriptions.zone_subscription_create_zone_subscription( "506e3185e9c882d175a2d0cb0093d9f2", ) - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) + assert_matches_type(SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.subscriptions.with_raw_response.get( + def test_method_zone_subscription_create_zone_subscription_with_all_params(self, client: Cloudflare) -> None: + subscription = client.subscriptions.zone_subscription_create_zone_subscription( + "506e3185e9c882d175a2d0cb0093d9f2", + app={"install_id": "string"}, + component_values=[ + { + "default": 5, + "name": "page_rules", + "price": 5, + "value": 20, + }, + { + "default": 5, + "name": "page_rules", + "price": 5, + "value": 20, + }, + { + "default": 5, + "name": "page_rules", + "price": 5, + "value": 20, + }, + ], + frequency="monthly", + rate_plan={ + "currency": "USD", + "externally_managed": False, + "id": "free", + "is_contract": False, + "public_name": "Business Plan", + "scope": "zone", + "sets": ["string", "string", "string"], + }, + zone={}, + ) + assert_matches_type(SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_zone_subscription_create_zone_subscription(self, client: Cloudflare) -> None: + response = client.subscriptions.with_raw_response.zone_subscription_create_zone_subscription( "506e3185e9c882d175a2d0cb0093d9f2", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) + assert_matches_type(SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.subscriptions.with_streaming_response.get( + def test_streaming_response_zone_subscription_create_zone_subscription(self, client: Cloudflare) -> None: + with client.subscriptions.with_streaming_response.zone_subscription_create_zone_subscription( "506e3185e9c882d175a2d0cb0093d9f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) + assert_matches_type( + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + def test_path_params_zone_subscription_create_zone_subscription(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.subscriptions.with_raw_response.get( + client.subscriptions.with_raw_response.zone_subscription_create_zone_subscription( "", ) @@ -514,92 +474,58 @@ def test_path_params_zone_subscription_update_zone_subscription(self, client: Cl "", ) - -class TestAsyncSubscriptions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.subscriptions.create( + def test_method_zone_subscription_zone_subscription_details(self, client: Cloudflare) -> None: + subscription = client.subscriptions.zone_subscription_zone_subscription_details( "506e3185e9c882d175a2d0cb0093d9f2", ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.subscriptions.create( - "506e3185e9c882d175a2d0cb0093d9f2", - app={"install_id": "string"}, - component_values=[ - { - "default": 5, - "name": "page_rules", - "price": 5, - "value": 20, - }, - { - "default": 5, - "name": "page_rules", - "price": 5, - "value": 20, - }, - { - "default": 5, - "name": "page_rules", - "price": 5, - "value": 20, - }, - ], - frequency="monthly", - rate_plan={ - "currency": "USD", - "externally_managed": False, - "id": "free", - "is_contract": False, - "public_name": "Business Plan", - "scope": "zone", - "sets": ["string", "string", "string"], - }, - zone={}, + assert_matches_type( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription, path=["response"] ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.subscriptions.with_raw_response.create( + def test_raw_response_zone_subscription_zone_subscription_details(self, client: Cloudflare) -> None: + response = client.subscriptions.with_raw_response.zone_subscription_zone_subscription_details( "506e3185e9c882d175a2d0cb0093d9f2", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + subscription = response.parse() + assert_matches_type( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription, path=["response"] + ) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.subscriptions.with_streaming_response.create( + def test_streaming_response_zone_subscription_zone_subscription_details(self, client: Cloudflare) -> None: + with client.subscriptions.with_streaming_response.zone_subscription_zone_subscription_details( "506e3185e9c882d175a2d0cb0093d9f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + subscription = response.parse() + assert_matches_type( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + def test_path_params_zone_subscription_zone_subscription_details(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.subscriptions.with_raw_response.create( + client.subscriptions.with_raw_response.zone_subscription_zone_subscription_details( "", ) + +class TestAsyncSubscriptions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: @@ -889,43 +815,89 @@ async def test_path_params_account_subscriptions_list_subscriptions(self, async_ @pytest.mark.skip() @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.subscriptions.get( + async def test_method_zone_subscription_create_zone_subscription(self, async_client: AsyncCloudflare) -> None: + subscription = await async_client.subscriptions.zone_subscription_create_zone_subscription( "506e3185e9c882d175a2d0cb0093d9f2", ) - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) + assert_matches_type(SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_zone_subscription_create_zone_subscription_with_all_params( + self, async_client: AsyncCloudflare + ) -> None: + subscription = await async_client.subscriptions.zone_subscription_create_zone_subscription( + "506e3185e9c882d175a2d0cb0093d9f2", + app={"install_id": "string"}, + component_values=[ + { + "default": 5, + "name": "page_rules", + "price": 5, + "value": 20, + }, + { + "default": 5, + "name": "page_rules", + "price": 5, + "value": 20, + }, + { + "default": 5, + "name": "page_rules", + "price": 5, + "value": 20, + }, + ], + frequency="monthly", + rate_plan={ + "currency": "USD", + "externally_managed": False, + "id": "free", + "is_contract": False, + "public_name": "Business Plan", + "scope": "zone", + "sets": ["string", "string", "string"], + }, + zone={}, + ) + assert_matches_type(SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.subscriptions.with_raw_response.get( + async def test_raw_response_zone_subscription_create_zone_subscription(self, async_client: AsyncCloudflare) -> None: + response = await async_client.subscriptions.with_raw_response.zone_subscription_create_zone_subscription( "506e3185e9c882d175a2d0cb0093d9f2", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) + assert_matches_type(SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.subscriptions.with_streaming_response.get( + async def test_streaming_response_zone_subscription_create_zone_subscription( + self, async_client: AsyncCloudflare + ) -> None: + async with async_client.subscriptions.with_streaming_response.zone_subscription_create_zone_subscription( "506e3185e9c882d175a2d0cb0093d9f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionGetResponse, subscription, path=["response"]) + assert_matches_type( + SubscriptionZoneSubscriptionCreateZoneSubscriptionResponse, subscription, path=["response"] + ) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_zone_subscription_create_zone_subscription(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.subscriptions.with_raw_response.get( + await async_client.subscriptions.with_raw_response.zone_subscription_create_zone_subscription( "", ) @@ -1016,3 +988,55 @@ async def test_path_params_zone_subscription_update_zone_subscription(self, asyn await async_client.subscriptions.with_raw_response.zone_subscription_update_zone_subscription( "", ) + + @pytest.mark.skip() + @parametrize + async def test_method_zone_subscription_zone_subscription_details(self, async_client: AsyncCloudflare) -> None: + subscription = await async_client.subscriptions.zone_subscription_zone_subscription_details( + "506e3185e9c882d175a2d0cb0093d9f2", + ) + assert_matches_type( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription, path=["response"] + ) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_zone_subscription_zone_subscription_details( + self, async_client: AsyncCloudflare + ) -> None: + response = await async_client.subscriptions.with_raw_response.zone_subscription_zone_subscription_details( + "506e3185e9c882d175a2d0cb0093d9f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subscription = await response.parse() + assert_matches_type( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription, path=["response"] + ) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_zone_subscription_zone_subscription_details( + self, async_client: AsyncCloudflare + ) -> None: + async with async_client.subscriptions.with_streaming_response.zone_subscription_zone_subscription_details( + "506e3185e9c882d175a2d0cb0093d9f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subscription = await response.parse() + assert_matches_type( + SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, subscription, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_zone_subscription_zone_subscription_details(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): + await async_client.subscriptions.with_raw_response.zone_subscription_zone_subscription_details( + "", + ) diff --git a/tests/api_resources/zones/test_holds.py b/tests/api_resources/zones/test_hold.py similarity index 85% rename from tests/api_resources/zones/test_holds.py rename to tests/api_resources/zones/test_hold.py index 1553a87b2f1..7c1a5ba1143 100644 --- a/tests/api_resources/zones/test_holds.py +++ b/tests/api_resources/zones/test_hold.py @@ -18,13 +18,13 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestHolds: +class TestHold: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize def test_method_enforce(self, client: Cloudflare) -> None: - hold = client.zones.holds.enforce( + hold = client.zones.hold.enforce( "023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(HoldEnforceResponse, hold, path=["response"]) @@ -32,7 +32,7 @@ def test_method_enforce(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_method_enforce_with_all_params(self, client: Cloudflare) -> None: - hold = client.zones.holds.enforce( + hold = client.zones.hold.enforce( "023e105f4ecef8ad9ca31a8372d0c353", include_subdomains=True, ) @@ -41,7 +41,7 @@ def test_method_enforce_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_enforce(self, client: Cloudflare) -> None: - response = client.zones.holds.with_raw_response.enforce( + response = client.zones.hold.with_raw_response.enforce( "023e105f4ecef8ad9ca31a8372d0c353", ) @@ -53,7 +53,7 @@ def test_raw_response_enforce(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_enforce(self, client: Cloudflare) -> None: - with client.zones.holds.with_streaming_response.enforce( + with client.zones.hold.with_streaming_response.enforce( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -68,14 +68,14 @@ def test_streaming_response_enforce(self, client: Cloudflare) -> None: @parametrize def test_path_params_enforce(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zones.holds.with_raw_response.enforce( + client.zones.hold.with_raw_response.enforce( "", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Cloudflare) -> None: - hold = client.zones.holds.get( + hold = client.zones.hold.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(HoldGetResponse, hold, path=["response"]) @@ -83,7 +83,7 @@ def test_method_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zones.holds.with_raw_response.get( + response = client.zones.hold.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) @@ -95,7 +95,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zones.holds.with_streaming_response.get( + with client.zones.hold.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -110,14 +110,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zones.holds.with_raw_response.get( + client.zones.hold.with_raw_response.get( "", ) @pytest.mark.skip() @parametrize def test_method_remove(self, client: Cloudflare) -> None: - hold = client.zones.holds.remove( + hold = client.zones.hold.remove( "023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[HoldRemoveResponse], hold, path=["response"]) @@ -125,7 +125,7 @@ def test_method_remove(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_method_remove_with_all_params(self, client: Cloudflare) -> None: - hold = client.zones.holds.remove( + hold = client.zones.hold.remove( "023e105f4ecef8ad9ca31a8372d0c353", hold_after="string", ) @@ -134,7 +134,7 @@ def test_method_remove_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_remove(self, client: Cloudflare) -> None: - response = client.zones.holds.with_raw_response.remove( + response = client.zones.hold.with_raw_response.remove( "023e105f4ecef8ad9ca31a8372d0c353", ) @@ -146,7 +146,7 @@ def test_raw_response_remove(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_remove(self, client: Cloudflare) -> None: - with client.zones.holds.with_streaming_response.remove( + with client.zones.hold.with_streaming_response.remove( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -161,18 +161,18 @@ def test_streaming_response_remove(self, client: Cloudflare) -> None: @parametrize def test_path_params_remove(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zones.holds.with_raw_response.remove( + client.zones.hold.with_raw_response.remove( "", ) -class TestAsyncHolds: +class TestAsyncHold: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize async def test_method_enforce(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.enforce( + hold = await async_client.zones.hold.enforce( "023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(HoldEnforceResponse, hold, path=["response"]) @@ -180,7 +180,7 @@ async def test_method_enforce(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_method_enforce_with_all_params(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.enforce( + hold = await async_client.zones.hold.enforce( "023e105f4ecef8ad9ca31a8372d0c353", include_subdomains=True, ) @@ -189,7 +189,7 @@ async def test_method_enforce_with_all_params(self, async_client: AsyncCloudflar @pytest.mark.skip() @parametrize async def test_raw_response_enforce(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.holds.with_raw_response.enforce( + response = await async_client.zones.hold.with_raw_response.enforce( "023e105f4ecef8ad9ca31a8372d0c353", ) @@ -201,7 +201,7 @@ async def test_raw_response_enforce(self, async_client: AsyncCloudflare) -> None @pytest.mark.skip() @parametrize async def test_streaming_response_enforce(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.holds.with_streaming_response.enforce( + async with async_client.zones.hold.with_streaming_response.enforce( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -216,14 +216,14 @@ async def test_streaming_response_enforce(self, async_client: AsyncCloudflare) - @parametrize async def test_path_params_enforce(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.holds.with_raw_response.enforce( + await async_client.zones.hold.with_raw_response.enforce( "", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.get( + hold = await async_client.zones.hold.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(HoldGetResponse, hold, path=["response"]) @@ -231,7 +231,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.holds.with_raw_response.get( + response = await async_client.zones.hold.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) @@ -243,7 +243,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.holds.with_streaming_response.get( + async with async_client.zones.hold.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -258,14 +258,14 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.holds.with_raw_response.get( + await async_client.zones.hold.with_raw_response.get( "", ) @pytest.mark.skip() @parametrize async def test_method_remove(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.remove( + hold = await async_client.zones.hold.remove( "023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[HoldRemoveResponse], hold, path=["response"]) @@ -273,7 +273,7 @@ async def test_method_remove(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_method_remove_with_all_params(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.remove( + hold = await async_client.zones.hold.remove( "023e105f4ecef8ad9ca31a8372d0c353", hold_after="string", ) @@ -282,7 +282,7 @@ async def test_method_remove_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize async def test_raw_response_remove(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.holds.with_raw_response.remove( + response = await async_client.zones.hold.with_raw_response.remove( "023e105f4ecef8ad9ca31a8372d0c353", ) @@ -294,7 +294,7 @@ async def test_raw_response_remove(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_remove(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.holds.with_streaming_response.remove( + async with async_client.zones.hold.with_streaming_response.remove( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -309,6 +309,6 @@ async def test_streaming_response_remove(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_remove(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.holds.with_raw_response.remove( + await async_client.zones.hold.with_raw_response.remove( "", )