diff --git a/.stats.yml b/.stats.yml index 9fa1711d732..12919edfc03 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1267 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-efb5805d496f252c658aad63c93537ff3b2ff4c164999f326a7061d0b22866a4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0afa9378dad17dedd91687a59735a917fefb1adadc097a7902ccaae3ebdda360.yml diff --git a/api.md b/api.md index f2698a5ade0..708c1aa46f9 100644 --- a/api.md +++ b/api.md @@ -81,10 +81,10 @@ from cloudflare.types.origin_ca_certificates import ( Methods: -- client.origin_ca_certificates.create(\*\*params) -> OriginCACertificateCreateResponse +- client.origin_ca_certificates.create(\*\*params) -> Optional - client.origin_ca_certificates.list(\*\*params) -> SyncSinglePage[OriginCACertificate] -- client.origin_ca_certificates.delete(certificate_id) -> OriginCACertificateDeleteResponse -- client.origin_ca_certificates.get(certificate_id) -> OriginCACertificateGetResponse +- client.origin_ca_certificates.delete(certificate_id) -> Optional +- client.origin_ca_certificates.get(certificate_id) -> Optional # IPs @@ -1270,7 +1270,7 @@ from cloudflare.types.ssl import AnalyzeCreateResponse Methods: -- client.ssl.analyze.create(\*, zone_id, \*\*params) -> AnalyzeCreateResponse +- client.ssl.analyze.create(\*, zone_id, \*\*params) -> Optional ## CertificatePacks @@ -1289,9 +1289,9 @@ from cloudflare.types.ssl import ( Methods: - client.ssl.certificate_packs.list(\*, zone_id, \*\*params) -> SyncSinglePage[object] -- client.ssl.certificate_packs.delete(certificate_pack_id, \*, zone_id) -> CertificatePackDeleteResponse -- client.ssl.certificate_packs.edit(certificate_pack_id, \*, zone_id, \*\*params) -> CertificatePackEditResponse -- client.ssl.certificate_packs.get(certificate_pack_id, \*, zone_id) -> CertificatePackGetResponse +- client.ssl.certificate_packs.delete(certificate_pack_id, \*, zone_id) -> Optional +- client.ssl.certificate_packs.edit(certificate_pack_id, \*, zone_id, \*\*params) -> Optional +- client.ssl.certificate_packs.get(certificate_pack_id, \*, zone_id) -> Optional ### Order @@ -1303,7 +1303,7 @@ from cloudflare.types.ssl.certificate_packs import OrderCreateResponse Methods: -- client.ssl.certificate_packs.order.create(\*, zone_id, \*\*params) -> OrderCreateResponse +- client.ssl.certificate_packs.order.create(\*, zone_id, \*\*params) -> Optional ### Quota @@ -1315,7 +1315,7 @@ from cloudflare.types.ssl.certificate_packs import QuotaGetResponse Methods: -- client.ssl.certificate_packs.quota.get(\*, zone_id) -> QuotaGetResponse +- client.ssl.certificate_packs.quota.get(\*, zone_id) -> Optional ## Recommendations @@ -1341,8 +1341,8 @@ from cloudflare.types.ssl.universal import UniversalSSLSettings Methods: -- client.ssl.universal.settings.edit(\*, zone_id, \*\*params) -> UniversalSSLSettings -- client.ssl.universal.settings.get(\*, zone_id) -> UniversalSSLSettings +- client.ssl.universal.settings.edit(\*, zone_id, \*\*params) -> Optional +- client.ssl.universal.settings.get(\*, zone_id) -> Optional ## Verification @@ -1354,7 +1354,7 @@ from cloudflare.types.ssl import Verification, VerificationEditResponse, Verific Methods: -- client.ssl.verification.edit(certificate_pack_id, \*, zone_id, \*\*params) -> VerificationEditResponse +- client.ssl.verification.edit(certificate_pack_id, \*, zone_id, \*\*params) -> Optional - client.ssl.verification.get(\*, zone_id, \*\*params) -> Optional # Subscriptions @@ -1390,8 +1390,8 @@ from cloudflare.types.acm import TotalTLSCreateResponse, TotalTLSGetResponse Methods: -- client.acm.total_tls.create(\*, zone_id, \*\*params) -> TotalTLSCreateResponse -- client.acm.total_tls.get(\*, zone_id) -> TotalTLSGetResponse +- client.acm.total_tls.create(\*, zone_id, \*\*params) -> Optional +- client.acm.total_tls.get(\*, zone_id) -> Optional # Argo @@ -1463,8 +1463,8 @@ from cloudflare.types.certificate_authorities import ( Methods: -- client.certificate_authorities.hostname_associations.update(\*, zone_id, \*\*params) -> HostnameAssociationUpdateResponse -- client.certificate_authorities.hostname_associations.get(\*, zone_id, \*\*params) -> HostnameAssociationGetResponse +- client.certificate_authorities.hostname_associations.update(\*, zone_id, \*\*params) -> Optional +- client.certificate_authorities.hostname_associations.get(\*, zone_id, \*\*params) -> Optional # ClientCertificates @@ -1476,11 +1476,11 @@ from cloudflare.types.client_certificates import ClientCertificate Methods: -- client.client_certificates.create(\*, zone_id, \*\*params) -> ClientCertificate +- client.client_certificates.create(\*, zone_id, \*\*params) -> Optional - client.client_certificates.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[ClientCertificate] -- client.client_certificates.delete(client_certificate_id, \*, zone_id) -> ClientCertificate -- client.client_certificates.edit(client_certificate_id, \*, zone_id) -> ClientCertificate -- client.client_certificates.get(client_certificate_id, \*, zone_id) -> ClientCertificate +- client.client_certificates.delete(client_certificate_id, \*, zone_id) -> Optional +- client.client_certificates.edit(client_certificate_id, \*, zone_id) -> Optional +- client.client_certificates.get(client_certificate_id, \*, zone_id) -> Optional # CustomCertificates @@ -1499,11 +1499,11 @@ from cloudflare.types.custom_certificates import ( Methods: -- client.custom_certificates.create(\*, zone_id, \*\*params) -> CustomCertificateCreateResponse +- client.custom_certificates.create(\*, zone_id, \*\*params) -> Optional - client.custom_certificates.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomCertificate] -- client.custom_certificates.delete(custom_certificate_id, \*, zone_id) -> CustomCertificateDeleteResponse -- client.custom_certificates.edit(custom_certificate_id, \*, zone_id, \*\*params) -> CustomCertificateEditResponse -- client.custom_certificates.get(custom_certificate_id, \*, zone_id) -> CustomCertificateGetResponse +- client.custom_certificates.delete(custom_certificate_id, \*, zone_id) -> Optional +- client.custom_certificates.edit(custom_certificate_id, \*, zone_id, \*\*params) -> Optional +- client.custom_certificates.get(custom_certificate_id, \*, zone_id) -> Optional ## Prioritize @@ -1537,11 +1537,11 @@ from cloudflare.types.custom_hostnames import ( Methods: -- client.custom_hostnames.create(\*, zone_id, \*\*params) -> CustomHostnameCreateResponse +- client.custom_hostnames.create(\*, zone_id, \*\*params) -> Optional - client.custom_hostnames.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomHostnameListResponse] - client.custom_hostnames.delete(custom_hostname_id, \*, zone_id) -> CustomHostnameDeleteResponse -- client.custom_hostnames.edit(custom_hostname_id, \*, zone_id, \*\*params) -> CustomHostnameEditResponse -- client.custom_hostnames.get(custom_hostname_id, \*, zone_id) -> CustomHostnameGetResponse +- client.custom_hostnames.edit(custom_hostname_id, \*, zone_id, \*\*params) -> Optional +- client.custom_hostnames.get(custom_hostname_id, \*, zone_id) -> Optional ## FallbackOrigin @@ -1557,9 +1557,9 @@ from cloudflare.types.custom_hostnames import ( Methods: -- client.custom_hostnames.fallback_origin.update(\*, zone_id, \*\*params) -> FallbackOriginUpdateResponse -- client.custom_hostnames.fallback_origin.delete(\*, zone_id) -> FallbackOriginDeleteResponse -- client.custom_hostnames.fallback_origin.get(\*, zone_id) -> FallbackOriginGetResponse +- client.custom_hostnames.fallback_origin.update(\*, zone_id, \*\*params) -> Optional +- client.custom_hostnames.fallback_origin.delete(\*, zone_id) -> Optional +- client.custom_hostnames.fallback_origin.get(\*, zone_id) -> Optional # CustomNameservers @@ -2028,11 +2028,11 @@ from cloudflare.types.keyless_certificates import ( Methods: -- client.keyless_certificates.create(\*, zone_id, \*\*params) -> KeylessCertificate +- client.keyless_certificates.create(\*, zone_id, \*\*params) -> Optional - client.keyless_certificates.list(\*, zone_id) -> SyncSinglePage[KeylessCertificate] -- client.keyless_certificates.delete(keyless_certificate_id, \*, zone_id) -> KeylessCertificateDeleteResponse -- client.keyless_certificates.edit(keyless_certificate_id, \*, zone_id, \*\*params) -> KeylessCertificate -- client.keyless_certificates.get(keyless_certificate_id, \*, zone_id) -> KeylessCertificate +- client.keyless_certificates.delete(keyless_certificate_id, \*, zone_id) -> Optional +- client.keyless_certificates.edit(keyless_certificate_id, \*, zone_id, \*\*params) -> Optional +- client.keyless_certificates.get(keyless_certificate_id, \*, zone_id) -> Optional # Logpush @@ -2203,10 +2203,10 @@ from cloudflare.types.origin_tls_client_auth import ( Methods: -- client.origin_tls_client_auth.create(\*, zone_id, \*\*params) -> OriginTLSClientAuthCreateResponse +- client.origin_tls_client_auth.create(\*, zone_id, \*\*params) -> Optional - client.origin_tls_client_auth.list(\*, zone_id) -> SyncSinglePage[ZoneAuthenticatedOriginPull] -- client.origin_tls_client_auth.delete(certificate_id, \*, zone_id) -> OriginTLSClientAuthDeleteResponse -- client.origin_tls_client_auth.get(certificate_id, \*, zone_id) -> OriginTLSClientAuthGetResponse +- client.origin_tls_client_auth.delete(certificate_id, \*, zone_id) -> Optional +- client.origin_tls_client_auth.get(certificate_id, \*, zone_id) -> Optional ## Hostnames @@ -2219,7 +2219,7 @@ from cloudflare.types.origin_tls_client_auth import AuthenticatedOriginPull, Hos Methods: - client.origin_tls_client_auth.hostnames.update(\*, zone_id, \*\*params) -> Optional -- client.origin_tls_client_auth.hostnames.get(hostname, \*, zone_id) -> AuthenticatedOriginPull +- client.origin_tls_client_auth.hostnames.get(hostname, \*, zone_id) -> Optional ### Certificates @@ -2236,10 +2236,10 @@ from cloudflare.types.origin_tls_client_auth.hostnames import ( Methods: -- client.origin_tls_client_auth.hostnames.certificates.create(\*, zone_id, \*\*params) -> CertificateCreateResponse +- client.origin_tls_client_auth.hostnames.certificates.create(\*, zone_id, \*\*params) -> Optional - client.origin_tls_client_auth.hostnames.certificates.list(\*, zone_id) -> SyncSinglePage[AuthenticatedOriginPull] -- client.origin_tls_client_auth.hostnames.certificates.delete(certificate_id, \*, zone_id) -> CertificateDeleteResponse -- client.origin_tls_client_auth.hostnames.certificates.get(certificate_id, \*, zone_id) -> CertificateGetResponse +- client.origin_tls_client_auth.hostnames.certificates.delete(certificate_id, \*, zone_id) -> Optional +- client.origin_tls_client_auth.hostnames.certificates.get(certificate_id, \*, zone_id) -> Optional ## Settings @@ -2251,8 +2251,8 @@ from cloudflare.types.origin_tls_client_auth import SettingUpdateResponse, Setti Methods: -- client.origin_tls_client_auth.settings.update(\*, zone_id, \*\*params) -> SettingUpdateResponse -- client.origin_tls_client_auth.settings.get(\*, zone_id) -> SettingGetResponse +- client.origin_tls_client_auth.settings.update(\*, zone_id, \*\*params) -> Optional +- client.origin_tls_client_auth.settings.get(\*, zone_id) -> Optional # Pagerules @@ -3957,10 +3957,10 @@ from cloudflare.types.mtls_certificates import MTLSCertificate, MTLSCertificateC Methods: -- client.mtls_certificates.create(\*, account_id, \*\*params) -> MTLSCertificateCreateResponse +- client.mtls_certificates.create(\*, account_id, \*\*params) -> Optional - client.mtls_certificates.list(\*, account_id) -> SyncSinglePage[MTLSCertificate] -- client.mtls_certificates.delete(mtls_certificate_id, \*, account_id) -> MTLSCertificate -- client.mtls_certificates.get(mtls_certificate_id, \*, account_id) -> MTLSCertificate +- client.mtls_certificates.delete(mtls_certificate_id, \*, account_id) -> Optional +- client.mtls_certificates.get(mtls_certificate_id, \*, account_id) -> Optional ## Associations @@ -7245,7 +7245,7 @@ from cloudflare.types.dcv_delegation import DCVDelegationUUID Methods: -- client.dcv_delegation.uuid.get(\*, zone_id) -> DCVDelegationUUID +- client.dcv_delegation.uuid.get(\*, zone_id) -> Optional # Hostnames @@ -7266,8 +7266,8 @@ from cloudflare.types.hostnames.settings import ( Methods: -- client.hostnames.settings.tls.update(hostname, \*, zone_id, setting_id, \*\*params) -> Setting -- client.hostnames.settings.tls.delete(hostname, \*, zone_id, setting_id) -> TLSDeleteResponse +- client.hostnames.settings.tls.update(hostname, \*, zone_id, setting_id, \*\*params) -> Optional +- client.hostnames.settings.tls.delete(hostname, \*, zone_id, setting_id) -> Optional - client.hostnames.settings.tls.get(setting_id, \*, zone_id) -> Optional # Snippets diff --git a/src/cloudflare/resources/acm/total_tls.py b/src/cloudflare/resources/acm/total_tls.py index 4795b7d6275..6c8acf16000 100644 --- a/src/cloudflare/resources/acm/total_tls.py +++ b/src/cloudflare/resources/acm/total_tls.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -52,7 +52,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TotalTLSCreateResponse: + ) -> Optional[TotalTLSCreateResponse]: """ Set Total TLS Settings or disable the feature for a Zone. @@ -88,9 +88,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TotalTLSCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TotalTLSCreateResponse]]._unwrapper, ), - cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]), + cast_to=cast(Type[Optional[TotalTLSCreateResponse]], ResultWrapper[TotalTLSCreateResponse]), ) def get( @@ -103,7 +103,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TotalTLSGetResponse: + ) -> Optional[TotalTLSGetResponse]: """ Get Total TLS Settings for a Zone. @@ -127,9 +127,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TotalTLSGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TotalTLSGetResponse]]._unwrapper, ), - cast_to=cast(Type[TotalTLSGetResponse], ResultWrapper[TotalTLSGetResponse]), + cast_to=cast(Type[Optional[TotalTLSGetResponse]], ResultWrapper[TotalTLSGetResponse]), ) @@ -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, - ) -> TotalTLSCreateResponse: + ) -> Optional[TotalTLSCreateResponse]: """ Set Total TLS Settings or disable the feature for a Zone. @@ -190,9 +190,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TotalTLSCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TotalTLSCreateResponse]]._unwrapper, ), - cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]), + cast_to=cast(Type[Optional[TotalTLSCreateResponse]], ResultWrapper[TotalTLSCreateResponse]), ) async def get( @@ -205,7 +205,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TotalTLSGetResponse: + ) -> Optional[TotalTLSGetResponse]: """ Get Total TLS Settings for a Zone. @@ -229,9 +229,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TotalTLSGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TotalTLSGetResponse]]._unwrapper, ), - cast_to=cast(Type[TotalTLSGetResponse], ResultWrapper[TotalTLSGetResponse]), + cast_to=cast(Type[Optional[TotalTLSGetResponse]], ResultWrapper[TotalTLSGetResponse]), ) diff --git a/src/cloudflare/resources/certificate_authorities/hostname_associations.py b/src/cloudflare/resources/certificate_authorities/hostname_associations.py index 688bbaf4aaf..4867abd374d 100644 --- a/src/cloudflare/resources/certificate_authorities/hostname_associations.py +++ b/src/cloudflare/resources/certificate_authorities/hostname_associations.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Optional, cast import httpx @@ -52,7 +52,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostnameAssociationUpdateResponse: + ) -> Optional[HostnameAssociationUpdateResponse]: """ Replace Hostname Associations @@ -87,9 +87,11 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[HostnameAssociationUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[HostnameAssociationUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[HostnameAssociationUpdateResponse]], ResultWrapper[HostnameAssociationUpdateResponse] ), - cast_to=cast(Type[HostnameAssociationUpdateResponse], ResultWrapper[HostnameAssociationUpdateResponse]), ) def get( @@ -103,7 +105,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostnameAssociationGetResponse: + ) -> Optional[HostnameAssociationGetResponse]: """ List Hostname Associations @@ -135,9 +137,9 @@ def get( {"mtls_certificate_id": mtls_certificate_id}, hostname_association_get_params.HostnameAssociationGetParams, ), - post_parser=ResultWrapper[HostnameAssociationGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[HostnameAssociationGetResponse]]._unwrapper, ), - cast_to=cast(Type[HostnameAssociationGetResponse], ResultWrapper[HostnameAssociationGetResponse]), + cast_to=cast(Type[Optional[HostnameAssociationGetResponse]], ResultWrapper[HostnameAssociationGetResponse]), ) @@ -162,7 +164,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostnameAssociationUpdateResponse: + ) -> Optional[HostnameAssociationUpdateResponse]: """ Replace Hostname Associations @@ -197,9 +199,11 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[HostnameAssociationUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[HostnameAssociationUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[HostnameAssociationUpdateResponse]], ResultWrapper[HostnameAssociationUpdateResponse] ), - cast_to=cast(Type[HostnameAssociationUpdateResponse], ResultWrapper[HostnameAssociationUpdateResponse]), ) async def get( @@ -213,7 +217,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostnameAssociationGetResponse: + ) -> Optional[HostnameAssociationGetResponse]: """ List Hostname Associations @@ -245,9 +249,9 @@ async def get( {"mtls_certificate_id": mtls_certificate_id}, hostname_association_get_params.HostnameAssociationGetParams, ), - post_parser=ResultWrapper[HostnameAssociationGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[HostnameAssociationGetResponse]]._unwrapper, ), - cast_to=cast(Type[HostnameAssociationGetResponse], ResultWrapper[HostnameAssociationGetResponse]), + cast_to=cast(Type[Optional[HostnameAssociationGetResponse]], ResultWrapper[HostnameAssociationGetResponse]), ) diff --git a/src/cloudflare/resources/client_certificates.py b/src/cloudflare/resources/client_certificates.py index c9f70aa1ace..f8a069fc5a7 100644 --- a/src/cloudflare/resources/client_certificates.py +++ b/src/cloudflare/resources/client_certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -53,7 +53,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ Create a new API Shield mTLS Client Certificate @@ -88,9 +88,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) def list( @@ -170,7 +170,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status. @@ -201,9 +201,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) def edit( @@ -217,7 +217,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint. @@ -248,9 +248,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) def get( @@ -264,7 +264,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ Get Details for a single mTLS API Shield Client Certificate @@ -294,9 +294,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) @@ -321,7 +321,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ Create a new API Shield mTLS Client Certificate @@ -356,9 +356,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) def list( @@ -438,7 +438,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status. @@ -469,9 +469,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) async def edit( @@ -485,7 +485,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint. @@ -516,9 +516,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) async def get( @@ -532,7 +532,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ClientCertificate: + ) -> Optional[ClientCertificate]: """ Get Details for a single mTLS API Shield Client Certificate @@ -562,9 +562,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ClientCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, ), - cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]), + cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), ) diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index 5ef45dded84..a3deb798257 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, cast +from typing import Any, Type, Optional, cast from typing_extensions import Literal import httpx @@ -80,7 +80,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateCreateResponse: + ) -> Optional[CustomCertificateCreateResponse]: """ Upload a new SSL certificate for a zone. @@ -128,7 +128,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( - CustomCertificateCreateResponse, + Optional[CustomCertificateCreateResponse], self._post( f"/zones/{zone_id}/custom_certificates", body=maybe_transform( @@ -147,7 +147,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CustomCertificateCreateResponse] @@ -229,7 +229,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateDeleteResponse: + ) -> Optional[CustomCertificateDeleteResponse]: """ Remove a SSL certificate from a zone. @@ -259,9 +259,11 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[CustomCertificateDeleteResponse]], ResultWrapper[CustomCertificateDeleteResponse] ), - cast_to=cast(Type[CustomCertificateDeleteResponse], ResultWrapper[CustomCertificateDeleteResponse]), ) def edit( @@ -280,7 +282,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateEditResponse: + ) -> Optional[CustomCertificateEditResponse]: """Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing @@ -334,7 +336,7 @@ def edit( f"Expected a non-empty value for `custom_certificate_id` but received {custom_certificate_id!r}" ) return cast( - CustomCertificateEditResponse, + Optional[CustomCertificateEditResponse], self._patch( f"/zones/{zone_id}/custom_certificates/{custom_certificate_id}", body=maybe_transform( @@ -352,7 +354,7 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateEditResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CustomCertificateEditResponse] @@ -371,7 +373,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateGetResponse: + ) -> Optional[CustomCertificateGetResponse]: """ SSL Configuration Details @@ -395,7 +397,7 @@ def get( f"Expected a non-empty value for `custom_certificate_id` but received {custom_certificate_id!r}" ) return cast( - CustomCertificateGetResponse, + Optional[CustomCertificateGetResponse], self._get( f"/zones/{zone_id}/custom_certificates/{custom_certificate_id}", options=make_request_options( @@ -403,7 +405,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CustomCertificateGetResponse] @@ -441,7 +443,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateCreateResponse: + ) -> Optional[CustomCertificateCreateResponse]: """ Upload a new SSL certificate for a zone. @@ -489,7 +491,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( - CustomCertificateCreateResponse, + Optional[CustomCertificateCreateResponse], await self._post( f"/zones/{zone_id}/custom_certificates", body=await async_maybe_transform( @@ -508,7 +510,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CustomCertificateCreateResponse] @@ -590,7 +592,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateDeleteResponse: + ) -> Optional[CustomCertificateDeleteResponse]: """ Remove a SSL certificate from a zone. @@ -620,9 +622,11 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[CustomCertificateDeleteResponse]], ResultWrapper[CustomCertificateDeleteResponse] ), - cast_to=cast(Type[CustomCertificateDeleteResponse], ResultWrapper[CustomCertificateDeleteResponse]), ) async def edit( @@ -641,7 +645,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateEditResponse: + ) -> Optional[CustomCertificateEditResponse]: """Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing @@ -695,7 +699,7 @@ async def edit( f"Expected a non-empty value for `custom_certificate_id` but received {custom_certificate_id!r}" ) return cast( - CustomCertificateEditResponse, + Optional[CustomCertificateEditResponse], await self._patch( f"/zones/{zone_id}/custom_certificates/{custom_certificate_id}", body=await async_maybe_transform( @@ -713,7 +717,7 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateEditResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CustomCertificateEditResponse] @@ -732,7 +736,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomCertificateGetResponse: + ) -> Optional[CustomCertificateGetResponse]: """ SSL Configuration Details @@ -756,7 +760,7 @@ async def get( f"Expected a non-empty value for `custom_certificate_id` but received {custom_certificate_id!r}" ) return cast( - CustomCertificateGetResponse, + Optional[CustomCertificateGetResponse], await self._get( f"/zones/{zone_id}/custom_certificates/{custom_certificate_id}", options=make_request_options( @@ -764,7 +768,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomCertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomCertificateGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CustomCertificateGetResponse] diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 0b728cd337c..8ed92ce708f 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -74,7 +74,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameCreateResponse: + ) -> Optional[CustomHostnameCreateResponse]: """ Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' @@ -118,9 +118,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomHostnameCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomHostnameCreateResponse]]._unwrapper, ), - cast_to=cast(Type[CustomHostnameCreateResponse], ResultWrapper[CustomHostnameCreateResponse]), + cast_to=cast(Type[Optional[CustomHostnameCreateResponse]], ResultWrapper[CustomHostnameCreateResponse]), ) def list( @@ -253,7 +253,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameEditResponse: + ) -> Optional[CustomHostnameEditResponse]: """Modify SSL configuration for a custom hostname. When sent with SSL config that @@ -307,9 +307,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomHostnameEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomHostnameEditResponse]]._unwrapper, ), - cast_to=cast(Type[CustomHostnameEditResponse], ResultWrapper[CustomHostnameEditResponse]), + cast_to=cast(Type[Optional[CustomHostnameEditResponse]], ResultWrapper[CustomHostnameEditResponse]), ) def get( @@ -323,7 +323,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameGetResponse: + ) -> Optional[CustomHostnameGetResponse]: """ Custom Hostname Details @@ -351,9 +351,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomHostnameGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomHostnameGetResponse]]._unwrapper, ), - cast_to=cast(Type[CustomHostnameGetResponse], ResultWrapper[CustomHostnameGetResponse]), + cast_to=cast(Type[Optional[CustomHostnameGetResponse]], ResultWrapper[CustomHostnameGetResponse]), ) @@ -383,7 +383,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameCreateResponse: + ) -> Optional[CustomHostnameCreateResponse]: """ Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' @@ -427,9 +427,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomHostnameCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomHostnameCreateResponse]]._unwrapper, ), - cast_to=cast(Type[CustomHostnameCreateResponse], ResultWrapper[CustomHostnameCreateResponse]), + cast_to=cast(Type[Optional[CustomHostnameCreateResponse]], ResultWrapper[CustomHostnameCreateResponse]), ) def list( @@ -562,7 +562,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameEditResponse: + ) -> Optional[CustomHostnameEditResponse]: """Modify SSL configuration for a custom hostname. When sent with SSL config that @@ -616,9 +616,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomHostnameEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomHostnameEditResponse]]._unwrapper, ), - cast_to=cast(Type[CustomHostnameEditResponse], ResultWrapper[CustomHostnameEditResponse]), + cast_to=cast(Type[Optional[CustomHostnameEditResponse]], ResultWrapper[CustomHostnameEditResponse]), ) async def get( @@ -632,7 +632,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameGetResponse: + ) -> Optional[CustomHostnameGetResponse]: """ Custom Hostname Details @@ -660,9 +660,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CustomHostnameGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CustomHostnameGetResponse]]._unwrapper, ), - cast_to=cast(Type[CustomHostnameGetResponse], ResultWrapper[CustomHostnameGetResponse]), + cast_to=cast(Type[Optional[CustomHostnameGetResponse]], ResultWrapper[CustomHostnameGetResponse]), ) diff --git a/src/cloudflare/resources/custom_hostnames/fallback_origin.py b/src/cloudflare/resources/custom_hostnames/fallback_origin.py index b0b9cf333db..8ca189ddf97 100644 --- a/src/cloudflare/resources/custom_hostnames/fallback_origin.py +++ b/src/cloudflare/resources/custom_hostnames/fallback_origin.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any, Optional, cast import httpx @@ -51,7 +51,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FallbackOriginUpdateResponse: + ) -> Optional[FallbackOriginUpdateResponse]: """ Update Fallback Origin for Custom Hostnames @@ -71,7 +71,7 @@ def update( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - FallbackOriginUpdateResponse, + Optional[FallbackOriginUpdateResponse], self._put( f"/zones/{zone_id}/custom_hostnames/fallback_origin", body=maybe_transform({"origin": origin}, fallback_origin_update_params.FallbackOriginUpdateParams), @@ -80,7 +80,7 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FallbackOriginUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FallbackOriginUpdateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[FallbackOriginUpdateResponse] @@ -98,7 +98,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FallbackOriginDeleteResponse: + ) -> Optional[FallbackOriginDeleteResponse]: """ Delete Fallback Origin for Custom Hostnames @@ -116,7 +116,7 @@ def delete( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - FallbackOriginDeleteResponse, + Optional[FallbackOriginDeleteResponse], self._delete( f"/zones/{zone_id}/custom_hostnames/fallback_origin", options=make_request_options( @@ -124,7 +124,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FallbackOriginDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FallbackOriginDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[FallbackOriginDeleteResponse] @@ -142,7 +142,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FallbackOriginGetResponse: + ) -> Optional[FallbackOriginGetResponse]: """ Get Fallback Origin for Custom Hostnames @@ -160,7 +160,7 @@ def get( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - FallbackOriginGetResponse, + Optional[FallbackOriginGetResponse], self._get( f"/zones/{zone_id}/custom_hostnames/fallback_origin", options=make_request_options( @@ -168,7 +168,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FallbackOriginGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FallbackOriginGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[FallbackOriginGetResponse] @@ -197,7 +197,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FallbackOriginUpdateResponse: + ) -> Optional[FallbackOriginUpdateResponse]: """ Update Fallback Origin for Custom Hostnames @@ -217,7 +217,7 @@ async def update( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - FallbackOriginUpdateResponse, + Optional[FallbackOriginUpdateResponse], await self._put( f"/zones/{zone_id}/custom_hostnames/fallback_origin", body=await async_maybe_transform( @@ -228,7 +228,7 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FallbackOriginUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FallbackOriginUpdateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[FallbackOriginUpdateResponse] @@ -246,7 +246,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FallbackOriginDeleteResponse: + ) -> Optional[FallbackOriginDeleteResponse]: """ Delete Fallback Origin for Custom Hostnames @@ -264,7 +264,7 @@ async def delete( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - FallbackOriginDeleteResponse, + Optional[FallbackOriginDeleteResponse], await self._delete( f"/zones/{zone_id}/custom_hostnames/fallback_origin", options=make_request_options( @@ -272,7 +272,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FallbackOriginDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FallbackOriginDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[FallbackOriginDeleteResponse] @@ -290,7 +290,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FallbackOriginGetResponse: + ) -> Optional[FallbackOriginGetResponse]: """ Get Fallback Origin for Custom Hostnames @@ -308,7 +308,7 @@ async def get( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - FallbackOriginGetResponse, + Optional[FallbackOriginGetResponse], await self._get( f"/zones/{zone_id}/custom_hostnames/fallback_origin", options=make_request_options( @@ -316,7 +316,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FallbackOriginGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FallbackOriginGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[FallbackOriginGetResponse] diff --git a/src/cloudflare/resources/dcv_delegation/uuid.py b/src/cloudflare/resources/dcv_delegation/uuid.py index eef35e97584..c0c57c0ea2c 100644 --- a/src/cloudflare/resources/dcv_delegation/uuid.py +++ b/src/cloudflare/resources/dcv_delegation/uuid.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -43,7 +43,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DCVDelegationUUID: + ) -> Optional[DCVDelegationUUID]: """ Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation. @@ -68,9 +68,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[DCVDelegationUUID]._unwrapper, + post_parser=ResultWrapper[Optional[DCVDelegationUUID]]._unwrapper, ), - cast_to=cast(Type[DCVDelegationUUID], ResultWrapper[DCVDelegationUUID]), + cast_to=cast(Type[Optional[DCVDelegationUUID]], ResultWrapper[DCVDelegationUUID]), ) @@ -93,7 +93,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DCVDelegationUUID: + ) -> Optional[DCVDelegationUUID]: """ Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation. @@ -118,9 +118,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[DCVDelegationUUID]._unwrapper, + post_parser=ResultWrapper[Optional[DCVDelegationUUID]]._unwrapper, ), - cast_to=cast(Type[DCVDelegationUUID], ResultWrapper[DCVDelegationUUID]), + cast_to=cast(Type[Optional[DCVDelegationUUID]], ResultWrapper[DCVDelegationUUID]), ) diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index 0aa85650230..03e541fc6e2 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -55,7 +55,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Setting: + ) -> Optional[Setting]: """ Update the tls setting value for the hostname. @@ -90,9 +90,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Setting]._unwrapper, + post_parser=ResultWrapper[Optional[Setting]]._unwrapper, ), - cast_to=cast(Type[Setting], ResultWrapper[Setting]), + cast_to=cast(Type[Optional[Setting]], ResultWrapper[Setting]), ) def delete( @@ -107,7 +107,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSDeleteResponse: + ) -> Optional[TLSDeleteResponse]: """ Delete the tls setting value for the hostname. @@ -139,9 +139,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TLSDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TLSDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[TLSDeleteResponse], ResultWrapper[TLSDeleteResponse]), + cast_to=cast(Type[Optional[TLSDeleteResponse]], ResultWrapper[TLSDeleteResponse]), ) def get( @@ -211,7 +211,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Setting: + ) -> Optional[Setting]: """ Update the tls setting value for the hostname. @@ -246,9 +246,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Setting]._unwrapper, + post_parser=ResultWrapper[Optional[Setting]]._unwrapper, ), - cast_to=cast(Type[Setting], ResultWrapper[Setting]), + cast_to=cast(Type[Optional[Setting]], ResultWrapper[Setting]), ) async def delete( @@ -263,7 +263,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSDeleteResponse: + ) -> Optional[TLSDeleteResponse]: """ Delete the tls setting value for the hostname. @@ -295,9 +295,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TLSDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TLSDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[TLSDeleteResponse], ResultWrapper[TLSDeleteResponse]), + cast_to=cast(Type[Optional[TLSDeleteResponse]], ResultWrapper[TLSDeleteResponse]), ) async def get( diff --git a/src/cloudflare/resources/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates.py index 21eda129c59..2d68350af29 100644 --- a/src/cloudflare/resources/keyless_certificates.py +++ b/src/cloudflare/resources/keyless_certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -60,7 +60,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificate: + ) -> Optional[KeylessCertificate]: """ Create Keyless SSL Configuration @@ -111,9 +111,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, ), - cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]), + cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), ) def list( @@ -163,7 +163,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateDeleteResponse: + ) -> Optional[KeylessCertificateDeleteResponse]: """ Delete Keyless SSL Configuration @@ -193,9 +193,11 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificateDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[KeylessCertificateDeleteResponse]], ResultWrapper[KeylessCertificateDeleteResponse] ), - cast_to=cast(Type[KeylessCertificateDeleteResponse], ResultWrapper[KeylessCertificateDeleteResponse]), ) def edit( @@ -214,7 +216,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificate: + ) -> Optional[KeylessCertificate]: """This will update attributes of a Keyless SSL. Consists of one or more of the @@ -267,9 +269,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, ), - cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]), + cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), ) def get( @@ -283,7 +285,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificate: + ) -> Optional[KeylessCertificate]: """ Get details for one Keyless SSL configuration. @@ -313,9 +315,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, ), - cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]), + cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), ) @@ -344,7 +346,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificate: + ) -> Optional[KeylessCertificate]: """ Create Keyless SSL Configuration @@ -395,9 +397,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, ), - cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]), + cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), ) def list( @@ -447,7 +449,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateDeleteResponse: + ) -> Optional[KeylessCertificateDeleteResponse]: """ Delete Keyless SSL Configuration @@ -477,9 +479,11 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificateDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[KeylessCertificateDeleteResponse]], ResultWrapper[KeylessCertificateDeleteResponse] ), - cast_to=cast(Type[KeylessCertificateDeleteResponse], ResultWrapper[KeylessCertificateDeleteResponse]), ) async def edit( @@ -498,7 +502,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificate: + ) -> Optional[KeylessCertificate]: """This will update attributes of a Keyless SSL. Consists of one or more of the @@ -551,9 +555,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, ), - cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]), + cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), ) async def get( @@ -567,7 +571,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificate: + ) -> Optional[KeylessCertificate]: """ Get details for one Keyless SSL configuration. @@ -597,9 +601,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[KeylessCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, ), - cast_to=cast(Type[KeylessCertificate], ResultWrapper[KeylessCertificate]), + cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), ) diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index e5c478132fa..d6d4f1a60d8 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -67,7 +67,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificateCreateResponse: + ) -> Optional[MTLSCertificateCreateResponse]: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -108,9 +108,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[MTLSCertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[MTLSCertificateCreateResponse]]._unwrapper, ), - cast_to=cast(Type[MTLSCertificateCreateResponse], ResultWrapper[MTLSCertificateCreateResponse]), + cast_to=cast(Type[Optional[MTLSCertificateCreateResponse]], ResultWrapper[MTLSCertificateCreateResponse]), ) def list( @@ -160,7 +160,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificate: + ) -> Optional[MTLSCertificate]: """ Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services. @@ -191,9 +191,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[MTLSCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[MTLSCertificate]]._unwrapper, ), - cast_to=cast(Type[MTLSCertificate], ResultWrapper[MTLSCertificate]), + cast_to=cast(Type[Optional[MTLSCertificate]], ResultWrapper[MTLSCertificate]), ) def get( @@ -207,7 +207,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificate: + ) -> Optional[MTLSCertificate]: """ Fetches a single mTLS certificate. @@ -237,9 +237,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[MTLSCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[MTLSCertificate]]._unwrapper, ), - cast_to=cast(Type[MTLSCertificate], ResultWrapper[MTLSCertificate]), + cast_to=cast(Type[Optional[MTLSCertificate]], ResultWrapper[MTLSCertificate]), ) @@ -270,7 +270,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificateCreateResponse: + ) -> Optional[MTLSCertificateCreateResponse]: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -311,9 +311,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[MTLSCertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[MTLSCertificateCreateResponse]]._unwrapper, ), - cast_to=cast(Type[MTLSCertificateCreateResponse], ResultWrapper[MTLSCertificateCreateResponse]), + cast_to=cast(Type[Optional[MTLSCertificateCreateResponse]], ResultWrapper[MTLSCertificateCreateResponse]), ) def list( @@ -363,7 +363,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificate: + ) -> Optional[MTLSCertificate]: """ Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services. @@ -394,9 +394,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[MTLSCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[MTLSCertificate]]._unwrapper, ), - cast_to=cast(Type[MTLSCertificate], ResultWrapper[MTLSCertificate]), + cast_to=cast(Type[Optional[MTLSCertificate]], ResultWrapper[MTLSCertificate]), ) async def get( @@ -410,7 +410,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificate: + ) -> Optional[MTLSCertificate]: """ Fetches a single mTLS certificate. @@ -440,9 +440,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[MTLSCertificate]._unwrapper, + post_parser=ResultWrapper[Optional[MTLSCertificate]]._unwrapper, ), - cast_to=cast(Type[MTLSCertificate], ResultWrapper[MTLSCertificate]), + cast_to=cast(Type[Optional[MTLSCertificate]], ResultWrapper[MTLSCertificate]), ) diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py index 8434d75fbe1..116b93cb420 100644 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ b/src/cloudflare/resources/origin_ca_certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Iterable, cast +from typing import Any, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginCACertificateCreateResponse: + ) -> Optional[OriginCACertificateCreateResponse]: """Create an Origin CA certificate. Use your Origin CA Key as your User Service Key @@ -83,7 +83,7 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ return cast( - OriginCACertificateCreateResponse, + Optional[OriginCACertificateCreateResponse], self._post( "/certificates", body=maybe_transform( @@ -100,7 +100,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginCACertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginCACertificateCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginCACertificateCreateResponse] @@ -111,7 +111,7 @@ def create( def list( self, *, - identifier: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -126,7 +126,7 @@ def list( ([see above](#requests)). Args: - identifier: Identifier + zone_id: Identifier extra_headers: Send extra headers @@ -145,7 +145,7 @@ def list( extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"identifier": identifier}, origin_ca_certificate_list_params.OriginCACertificateListParams + {"zone_id": zone_id}, origin_ca_certificate_list_params.OriginCACertificateListParams ), ), model=OriginCACertificate, @@ -161,7 +161,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginCACertificateDeleteResponse: + ) -> Optional[OriginCACertificateDeleteResponse]: """Revoke an existing Origin CA certificate by its serial number. Use your Origin @@ -188,9 +188,11 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginCACertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginCACertificateDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCACertificateDeleteResponse]], ResultWrapper[OriginCACertificateDeleteResponse] ), - cast_to=cast(Type[OriginCACertificateDeleteResponse], ResultWrapper[OriginCACertificateDeleteResponse]), ) def get( @@ -203,7 +205,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginCACertificateGetResponse: + ) -> Optional[OriginCACertificateGetResponse]: """Get an existing Origin CA certificate by its serial number. Use your Origin CA @@ -224,7 +226,7 @@ def get( if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") return cast( - OriginCACertificateGetResponse, + Optional[OriginCACertificateGetResponse], self._get( f"/certificates/{certificate_id}", options=make_request_options( @@ -232,7 +234,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginCACertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginCACertificateGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginCACertificateGetResponse] @@ -263,7 +265,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginCACertificateCreateResponse: + ) -> Optional[OriginCACertificateCreateResponse]: """Create an Origin CA certificate. Use your Origin CA Key as your User Service Key @@ -289,7 +291,7 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ return cast( - OriginCACertificateCreateResponse, + Optional[OriginCACertificateCreateResponse], await self._post( "/certificates", body=await async_maybe_transform( @@ -306,7 +308,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginCACertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginCACertificateCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginCACertificateCreateResponse] @@ -317,7 +319,7 @@ async def create( def list( self, *, - identifier: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -332,7 +334,7 @@ def list( ([see above](#requests)). Args: - identifier: Identifier + zone_id: Identifier extra_headers: Send extra headers @@ -351,7 +353,7 @@ def list( extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"identifier": identifier}, origin_ca_certificate_list_params.OriginCACertificateListParams + {"zone_id": zone_id}, origin_ca_certificate_list_params.OriginCACertificateListParams ), ), model=OriginCACertificate, @@ -367,7 +369,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginCACertificateDeleteResponse: + ) -> Optional[OriginCACertificateDeleteResponse]: """Revoke an existing Origin CA certificate by its serial number. Use your Origin @@ -394,9 +396,11 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginCACertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginCACertificateDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCACertificateDeleteResponse]], ResultWrapper[OriginCACertificateDeleteResponse] ), - cast_to=cast(Type[OriginCACertificateDeleteResponse], ResultWrapper[OriginCACertificateDeleteResponse]), ) async def get( @@ -409,7 +413,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginCACertificateGetResponse: + ) -> Optional[OriginCACertificateGetResponse]: """Get an existing Origin CA certificate by its serial number. Use your Origin CA @@ -430,7 +434,7 @@ async def get( if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") return cast( - OriginCACertificateGetResponse, + Optional[OriginCACertificateGetResponse], await self._get( f"/certificates/{certificate_id}", options=make_request_options( @@ -438,7 +442,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginCACertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginCACertificateGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginCACertificateGetResponse] diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py index 21d47211cf1..9375047412c 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -55,7 +55,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateCreateResponse: + ) -> Optional[CertificateCreateResponse]: """Upload a certificate to be used for client authentication on a hostname. 10 @@ -92,9 +92,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateCreateResponse]]._unwrapper, ), - cast_to=cast(Type[CertificateCreateResponse], ResultWrapper[CertificateCreateResponse]), + cast_to=cast(Type[Optional[CertificateCreateResponse]], ResultWrapper[CertificateCreateResponse]), ) def list( @@ -144,7 +144,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateDeleteResponse: + ) -> Optional[CertificateDeleteResponse]: """ Delete Hostname Client Certificate @@ -172,9 +172,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[CertificateDeleteResponse], ResultWrapper[CertificateDeleteResponse]), + cast_to=cast(Type[Optional[CertificateDeleteResponse]], ResultWrapper[CertificateDeleteResponse]), ) def get( @@ -188,7 +188,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateGetResponse: + ) -> Optional[CertificateGetResponse]: """ Get the certificate by ID to be used for client authentication on a hostname. @@ -216,9 +216,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, ), - cast_to=cast(Type[CertificateGetResponse], ResultWrapper[CertificateGetResponse]), + cast_to=cast(Type[Optional[CertificateGetResponse]], ResultWrapper[CertificateGetResponse]), ) @@ -243,7 +243,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateCreateResponse: + ) -> Optional[CertificateCreateResponse]: """Upload a certificate to be used for client authentication on a hostname. 10 @@ -280,9 +280,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateCreateResponse]]._unwrapper, ), - cast_to=cast(Type[CertificateCreateResponse], ResultWrapper[CertificateCreateResponse]), + cast_to=cast(Type[Optional[CertificateCreateResponse]], ResultWrapper[CertificateCreateResponse]), ) def list( @@ -332,7 +332,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateDeleteResponse: + ) -> Optional[CertificateDeleteResponse]: """ Delete Hostname Client Certificate @@ -360,9 +360,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[CertificateDeleteResponse], ResultWrapper[CertificateDeleteResponse]), + cast_to=cast(Type[Optional[CertificateDeleteResponse]], ResultWrapper[CertificateDeleteResponse]), ) async def get( @@ -376,7 +376,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateGetResponse: + ) -> Optional[CertificateGetResponse]: """ Get the certificate by ID to be used for client authentication on a hostname. @@ -404,9 +404,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, ), - cast_to=cast(Type[CertificateGetResponse], ResultWrapper[CertificateGetResponse]), + cast_to=cast(Type[Optional[CertificateGetResponse]], ResultWrapper[CertificateGetResponse]), ) diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py index d5654039bca..438508acb12 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py @@ -107,7 +107,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AuthenticatedOriginPull: + ) -> Optional[AuthenticatedOriginPull]: """ Get the Hostname Status for Client Authentication @@ -136,9 +136,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[AuthenticatedOriginPull]._unwrapper, + post_parser=ResultWrapper[Optional[AuthenticatedOriginPull]]._unwrapper, ), - cast_to=cast(Type[AuthenticatedOriginPull], ResultWrapper[AuthenticatedOriginPull]), + cast_to=cast(Type[Optional[AuthenticatedOriginPull]], ResultWrapper[AuthenticatedOriginPull]), ) @@ -211,7 +211,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AuthenticatedOriginPull: + ) -> Optional[AuthenticatedOriginPull]: """ Get the Hostname Status for Client Authentication @@ -240,9 +240,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[AuthenticatedOriginPull]._unwrapper, + post_parser=ResultWrapper[Optional[AuthenticatedOriginPull]]._unwrapper, ), - cast_to=cast(Type[AuthenticatedOriginPull], ResultWrapper[AuthenticatedOriginPull]), + cast_to=cast(Type[Optional[AuthenticatedOriginPull]], ResultWrapper[AuthenticatedOriginPull]), ) diff --git a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py index eddf2a9e2e8..f1899c77cdf 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py +++ b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any, Optional, cast import httpx @@ -80,7 +80,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientAuthCreateResponse: + ) -> Optional[OriginTLSClientAuthCreateResponse]: """ Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is @@ -106,7 +106,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( - OriginTLSClientAuthCreateResponse, + Optional[OriginTLSClientAuthCreateResponse], self._post( f"/zones/{zone_id}/origin_tls_client_auth", body=maybe_transform( @@ -121,7 +121,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginTLSClientAuthCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginTLSClientAuthCreateResponse] @@ -176,7 +176,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientAuthDeleteResponse: + ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ Delete Certificate @@ -198,7 +198,7 @@ def delete( if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") return cast( - OriginTLSClientAuthDeleteResponse, + Optional[OriginTLSClientAuthDeleteResponse], self._delete( f"/zones/{zone_id}/origin_tls_client_auth/{certificate_id}", options=make_request_options( @@ -206,7 +206,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginTLSClientAuthDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginTLSClientAuthDeleteResponse] @@ -225,7 +225,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientAuthGetResponse: + ) -> Optional[OriginTLSClientAuthGetResponse]: """ Get Certificate Details @@ -247,7 +247,7 @@ def get( if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") return cast( - OriginTLSClientAuthGetResponse, + Optional[OriginTLSClientAuthGetResponse], self._get( f"/zones/{zone_id}/origin_tls_client_auth/{certificate_id}", options=make_request_options( @@ -255,7 +255,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginTLSClientAuthGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginTLSClientAuthGetResponse] @@ -293,7 +293,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientAuthCreateResponse: + ) -> Optional[OriginTLSClientAuthCreateResponse]: """ Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is @@ -319,7 +319,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( - OriginTLSClientAuthCreateResponse, + Optional[OriginTLSClientAuthCreateResponse], await self._post( f"/zones/{zone_id}/origin_tls_client_auth", body=await async_maybe_transform( @@ -334,7 +334,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginTLSClientAuthCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginTLSClientAuthCreateResponse] @@ -389,7 +389,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientAuthDeleteResponse: + ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ Delete Certificate @@ -411,7 +411,7 @@ async def delete( if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") return cast( - OriginTLSClientAuthDeleteResponse, + Optional[OriginTLSClientAuthDeleteResponse], await self._delete( f"/zones/{zone_id}/origin_tls_client_auth/{certificate_id}", options=make_request_options( @@ -419,7 +419,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginTLSClientAuthDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginTLSClientAuthDeleteResponse] @@ -438,7 +438,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientAuthGetResponse: + ) -> Optional[OriginTLSClientAuthGetResponse]: """ Get Certificate Details @@ -460,7 +460,7 @@ async def get( if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") return cast( - OriginTLSClientAuthGetResponse, + Optional[OriginTLSClientAuthGetResponse], await self._get( f"/zones/{zone_id}/origin_tls_client_auth/{certificate_id}", options=make_request_options( @@ -468,7 +468,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OriginTLSClientAuthGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[OriginTLSClientAuthGetResponse] diff --git a/src/cloudflare/resources/origin_tls_client_auth/settings.py b/src/cloudflare/resources/origin_tls_client_auth/settings.py index ac8304e1edd..67fc7cdba8e 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/settings.py +++ b/src/cloudflare/resources/origin_tls_client_auth/settings.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -50,7 +50,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingUpdateResponse: + ) -> Optional[SettingUpdateResponse]: """Enable or disable zone-level authenticated origin pulls. 'enabled' should be set @@ -80,9 +80,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SettingUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SettingUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[SettingUpdateResponse], ResultWrapper[SettingUpdateResponse]), + cast_to=cast(Type[Optional[SettingUpdateResponse]], ResultWrapper[SettingUpdateResponse]), ) def get( @@ -95,7 +95,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingGetResponse: + ) -> Optional[SettingGetResponse]: """Get whether zone-level authenticated origin pulls is enabled or not. It is false @@ -121,9 +121,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SettingGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SettingGetResponse]]._unwrapper, ), - cast_to=cast(Type[SettingGetResponse], ResultWrapper[SettingGetResponse]), + cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]), ) @@ -147,7 +147,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingUpdateResponse: + ) -> Optional[SettingUpdateResponse]: """Enable or disable zone-level authenticated origin pulls. 'enabled' should be set @@ -177,9 +177,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SettingUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SettingUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[SettingUpdateResponse], ResultWrapper[SettingUpdateResponse]), + cast_to=cast(Type[Optional[SettingUpdateResponse]], ResultWrapper[SettingUpdateResponse]), ) async def get( @@ -192,7 +192,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingGetResponse: + ) -> Optional[SettingGetResponse]: """Get whether zone-level authenticated origin pulls is enabled or not. It is false @@ -218,9 +218,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SettingGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SettingGetResponse]]._unwrapper, ), - cast_to=cast(Type[SettingGetResponse], ResultWrapper[SettingGetResponse]), + cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]), ) diff --git a/src/cloudflare/resources/ssl/analyze.py b/src/cloudflare/resources/ssl/analyze.py index 12396528143..7736fb778a3 100644 --- a/src/cloudflare/resources/ssl/analyze.py +++ b/src/cloudflare/resources/ssl/analyze.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any, Optional, cast import httpx @@ -52,7 +52,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AnalyzeCreateResponse: + ) -> Optional[AnalyzeCreateResponse]: """ Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate. @@ -78,7 +78,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, + Optional[AnalyzeCreateResponse], self._post( f"/zones/{zone_id}/ssl/analyze", body=maybe_transform( @@ -93,7 +93,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[AnalyzeCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[AnalyzeCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[AnalyzeCreateResponse] @@ -123,7 +123,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AnalyzeCreateResponse: + ) -> Optional[AnalyzeCreateResponse]: """ Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate. @@ -149,7 +149,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, + Optional[AnalyzeCreateResponse], await self._post( f"/zones/{zone_id}/ssl/analyze", body=await async_maybe_transform( @@ -164,7 +164,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[AnalyzeCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[AnalyzeCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[AnalyzeCreateResponse] diff --git a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py index c9a737527e9..b1d841e10ca 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py +++ b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, cast +from typing import Any, Type, Optional, cast from typing_extensions import Literal import httpx @@ -121,7 +121,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackDeleteResponse: + ) -> Optional[CertificatePackDeleteResponse]: """ For a given zone, delete an advanced certificate pack. @@ -151,9 +151,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificatePackDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificatePackDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[CertificatePackDeleteResponse], ResultWrapper[CertificatePackDeleteResponse]), + cast_to=cast(Type[Optional[CertificatePackDeleteResponse]], ResultWrapper[CertificatePackDeleteResponse]), ) def edit( @@ -168,7 +168,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackEditResponse: + ) -> Optional[CertificatePackEditResponse]: """For a given zone, restart validation for an advanced certificate pack. This is @@ -202,9 +202,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificatePackEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificatePackEditResponse]]._unwrapper, ), - cast_to=cast(Type[CertificatePackEditResponse], ResultWrapper[CertificatePackEditResponse]), + cast_to=cast(Type[Optional[CertificatePackEditResponse]], ResultWrapper[CertificatePackEditResponse]), ) def get( @@ -218,7 +218,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackGetResponse: + ) -> Optional[CertificatePackGetResponse]: """ For a given zone, get a certificate pack. @@ -242,7 +242,7 @@ def get( f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" ) return cast( - CertificatePackGetResponse, + Optional[CertificatePackGetResponse], self._get( f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}", options=make_request_options( @@ -250,7 +250,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificatePackGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificatePackGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificatePackGetResponse] @@ -330,7 +330,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackDeleteResponse: + ) -> Optional[CertificatePackDeleteResponse]: """ For a given zone, delete an advanced certificate pack. @@ -360,9 +360,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificatePackDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificatePackDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[CertificatePackDeleteResponse], ResultWrapper[CertificatePackDeleteResponse]), + cast_to=cast(Type[Optional[CertificatePackDeleteResponse]], ResultWrapper[CertificatePackDeleteResponse]), ) async def edit( @@ -377,7 +377,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackEditResponse: + ) -> Optional[CertificatePackEditResponse]: """For a given zone, restart validation for an advanced certificate pack. This is @@ -411,9 +411,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificatePackEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificatePackEditResponse]]._unwrapper, ), - cast_to=cast(Type[CertificatePackEditResponse], ResultWrapper[CertificatePackEditResponse]), + cast_to=cast(Type[Optional[CertificatePackEditResponse]], ResultWrapper[CertificatePackEditResponse]), ) async def get( @@ -427,7 +427,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificatePackGetResponse: + ) -> Optional[CertificatePackGetResponse]: """ For a given zone, get a certificate pack. @@ -451,7 +451,7 @@ async def get( f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" ) return cast( - CertificatePackGetResponse, + Optional[CertificatePackGetResponse], await self._get( f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}", options=make_request_options( @@ -459,7 +459,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificatePackGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificatePackGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificatePackGetResponse] diff --git a/src/cloudflare/resources/ssl/certificate_packs/order.py b/src/cloudflare/resources/ssl/certificate_packs/order.py index 05885aa8747..2f1e7e4e871 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/order.py +++ b/src/cloudflare/resources/ssl/certificate_packs/order.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Optional, cast from typing_extensions import Literal import httpx @@ -56,7 +56,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrderCreateResponse: + ) -> Optional[OrderCreateResponse]: """ For a given zone, order an advanced certificate pack. @@ -107,9 +107,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OrderCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OrderCreateResponse]]._unwrapper, ), - cast_to=cast(Type[OrderCreateResponse], ResultWrapper[OrderCreateResponse]), + cast_to=cast(Type[Optional[OrderCreateResponse]], ResultWrapper[OrderCreateResponse]), ) @@ -138,7 +138,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OrderCreateResponse: + ) -> Optional[OrderCreateResponse]: """ For a given zone, order an advanced certificate pack. @@ -189,9 +189,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[OrderCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[OrderCreateResponse]]._unwrapper, ), - cast_to=cast(Type[OrderCreateResponse], ResultWrapper[OrderCreateResponse]), + cast_to=cast(Type[Optional[OrderCreateResponse]], ResultWrapper[OrderCreateResponse]), ) diff --git a/src/cloudflare/resources/ssl/certificate_packs/quota.py b/src/cloudflare/resources/ssl/certificate_packs/quota.py index 33bd534e992..c641a1906e8 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/quota.py +++ b/src/cloudflare/resources/ssl/certificate_packs/quota.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -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: + ) -> Optional[QuotaGetResponse]: """ For a given zone, list certificate pack quotas. @@ -67,9 +67,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[QuotaGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[QuotaGetResponse]]._unwrapper, ), - cast_to=cast(Type[QuotaGetResponse], ResultWrapper[QuotaGetResponse]), + cast_to=cast(Type[Optional[QuotaGetResponse]], ResultWrapper[QuotaGetResponse]), ) @@ -92,7 +92,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> QuotaGetResponse: + ) -> Optional[QuotaGetResponse]: """ For a given zone, list certificate pack quotas. @@ -116,9 +116,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[QuotaGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[QuotaGetResponse]]._unwrapper, ), - cast_to=cast(Type[QuotaGetResponse], ResultWrapper[QuotaGetResponse]), + cast_to=cast(Type[Optional[QuotaGetResponse]], ResultWrapper[QuotaGetResponse]), ) diff --git a/src/cloudflare/resources/ssl/universal/settings.py b/src/cloudflare/resources/ssl/universal/settings.py index fb5657634bd..b50248a086a 100644 --- a/src/cloudflare/resources/ssl/universal/settings.py +++ b/src/cloudflare/resources/ssl/universal/settings.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -49,7 +49,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UniversalSSLSettings: + ) -> Optional[UniversalSSLSettings]: """ Patch Universal SSL Settings for a Zone. @@ -100,9 +100,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[UniversalSSLSettings]._unwrapper, + post_parser=ResultWrapper[Optional[UniversalSSLSettings]]._unwrapper, ), - cast_to=cast(Type[UniversalSSLSettings], ResultWrapper[UniversalSSLSettings]), + cast_to=cast(Type[Optional[UniversalSSLSettings]], ResultWrapper[UniversalSSLSettings]), ) def get( @@ -115,7 +115,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UniversalSSLSettings: + ) -> Optional[UniversalSSLSettings]: """ Get Universal SSL Settings for a Zone. @@ -139,9 +139,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[UniversalSSLSettings]._unwrapper, + post_parser=ResultWrapper[Optional[UniversalSSLSettings]]._unwrapper, ), - cast_to=cast(Type[UniversalSSLSettings], ResultWrapper[UniversalSSLSettings]), + cast_to=cast(Type[Optional[UniversalSSLSettings]], ResultWrapper[UniversalSSLSettings]), ) @@ -165,7 +165,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UniversalSSLSettings: + ) -> Optional[UniversalSSLSettings]: """ Patch Universal SSL Settings for a Zone. @@ -216,9 +216,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[UniversalSSLSettings]._unwrapper, + post_parser=ResultWrapper[Optional[UniversalSSLSettings]]._unwrapper, ), - cast_to=cast(Type[UniversalSSLSettings], ResultWrapper[UniversalSSLSettings]), + cast_to=cast(Type[Optional[UniversalSSLSettings]], ResultWrapper[UniversalSSLSettings]), ) async def get( @@ -231,7 +231,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UniversalSSLSettings: + ) -> Optional[UniversalSSLSettings]: """ Get Universal SSL Settings for a Zone. @@ -255,9 +255,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[UniversalSSLSettings]._unwrapper, + post_parser=ResultWrapper[Optional[UniversalSSLSettings]]._unwrapper, ), - cast_to=cast(Type[UniversalSSLSettings], ResultWrapper[UniversalSSLSettings]), + cast_to=cast(Type[Optional[UniversalSSLSettings]], ResultWrapper[UniversalSSLSettings]), ) diff --git a/src/cloudflare/resources/ssl/verification.py b/src/cloudflare/resources/ssl/verification.py index d55186e3bb5..832d313ec8b 100644 --- a/src/cloudflare/resources/ssl/verification.py +++ b/src/cloudflare/resources/ssl/verification.py @@ -52,7 +52,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VerificationEditResponse: + ) -> Optional[VerificationEditResponse]: """Edit SSL validation method for a certificate pack. A PATCH request will request @@ -91,9 +91,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[VerificationEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[VerificationEditResponse]]._unwrapper, ), - cast_to=cast(Type[VerificationEditResponse], ResultWrapper[VerificationEditResponse]), + cast_to=cast(Type[Optional[VerificationEditResponse]], ResultWrapper[VerificationEditResponse]), ) def get( @@ -161,7 +161,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VerificationEditResponse: + ) -> Optional[VerificationEditResponse]: """Edit SSL validation method for a certificate pack. A PATCH request will request @@ -200,9 +200,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[VerificationEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[VerificationEditResponse]]._unwrapper, ), - cast_to=cast(Type[VerificationEditResponse], ResultWrapper[VerificationEditResponse]), + cast_to=cast(Type[Optional[VerificationEditResponse]], ResultWrapper[VerificationEditResponse]), ) async def get( diff --git a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_list_params.py b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_list_params.py index 7efecba1814..e4f64955822 100644 --- a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_list_params.py +++ b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_list_params.py @@ -8,5 +8,5 @@ class OriginCACertificateListParams(TypedDict, total=False): - identifier: str + zone_id: str """Identifier""" diff --git a/tests/api_resources/acm/test_total_tls.py b/tests/api_resources/acm/test_total_tls.py index 7660fe8b525..5ac61d4a656 100644 --- a/tests/api_resources/acm/test_total_tls.py +++ b/tests/api_resources/acm/test_total_tls.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -23,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -32,7 +32,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: enabled=True, certificate_authority="google", ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = response.parse() - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -56,7 +56,7 @@ 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(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -73,7 +73,7 @@ def test_method_get(self, client: Cloudflare) -> None: total_tls = client.acm.total_tls.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TotalTLSGetResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSGetResponse], total_tls, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -84,7 +84,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = response.parse() - assert_matches_type(TotalTLSGetResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSGetResponse], total_tls, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -95,7 +95,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = response.parse() - assert_matches_type(TotalTLSGetResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSGetResponse], total_tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -116,7 +116,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -125,7 +125,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare enabled=True, certificate_authority="google", ) - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -137,7 +137,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = await response.parse() - assert_matches_type(TotalTLSCreateResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -149,7 +149,7 @@ 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(Optional[TotalTLSCreateResponse], total_tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -166,7 +166,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: total_tls = await async_client.acm.total_tls.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TotalTLSGetResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSGetResponse], total_tls, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -177,7 +177,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = await response.parse() - assert_matches_type(TotalTLSGetResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSGetResponse], total_tls, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -188,7 +188,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" total_tls = await response.parse() - assert_matches_type(TotalTLSGetResponse, total_tls, path=["response"]) + assert_matches_type(Optional[TotalTLSGetResponse], total_tls, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/certificate_authorities/test_hostname_associations.py b/tests/api_resources/certificate_authorities/test_hostname_associations.py index eb5db8b0753..799d89cd874 100644 --- a/tests/api_resources/certificate_authorities/test_hostname_associations.py +++ b/tests/api_resources/certificate_authorities/test_hostname_associations.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -25,7 +25,7 @@ def test_method_update(self, client: Cloudflare) -> None: hostname_association = client.certificate_authorities.hostname_associations.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -34,7 +34,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: hostnames=["api.example.com", "api.example.com", "api.example.com"], mtls_certificate_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", ) - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -45,7 +45,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = response.parse() - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -56,7 +56,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = response.parse() - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +72,7 @@ def test_method_get(self, client: Cloudflare) -> None: hostname_association = client.certificate_authorities.hostname_associations.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: @@ -80,7 +80,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", mtls_certificate_id="b2134436-2555-4acf-be5b-26c48136575e", ) - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -91,7 +91,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = response.parse() - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -102,7 +102,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = response.parse() - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) assert cast(Any, response.is_closed) is True @@ -122,7 +122,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: hostname_association = await async_client.certificate_authorities.hostname_associations.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -131,7 +131,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare hostnames=["api.example.com", "api.example.com", "api.example.com"], mtls_certificate_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", ) - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -142,7 +142,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = await response.parse() - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -153,7 +153,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = await response.parse() - assert_matches_type(HostnameAssociationUpdateResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationUpdateResponse], hostname_association, path=["response"]) assert cast(Any, response.is_closed) is True @@ -169,7 +169,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: hostname_association = await async_client.certificate_authorities.hostname_associations.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -177,7 +177,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - zone_id="023e105f4ecef8ad9ca31a8372d0c353", mtls_certificate_id="b2134436-2555-4acf-be5b-26c48136575e", ) - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -188,7 +188,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = await response.parse() - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -199,7 +199,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = await response.parse() - assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) + assert_matches_type(Optional[HostnameAssociationGetResponse], hostname_association, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/custom_hostnames/test_fallback_origin.py b/tests/api_resources/custom_hostnames/test_fallback_origin.py index cc1bbef9172..06e7260f852 100644 --- a/tests/api_resources/custom_hostnames/test_fallback_origin.py +++ b/tests/api_resources/custom_hostnames/test_fallback_origin.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -27,7 +27,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", origin="fallback.example.com", ) - assert_matches_type(FallbackOriginUpdateResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginUpdateResponse], fallback_origin, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -39,7 +39,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = response.parse() - assert_matches_type(FallbackOriginUpdateResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginUpdateResponse], fallback_origin, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -51,7 +51,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = response.parse() - assert_matches_type(FallbackOriginUpdateResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginUpdateResponse], fallback_origin, path=["response"]) assert cast(Any, response.is_closed) is True @@ -68,7 +68,7 @@ def test_method_delete(self, client: Cloudflare) -> None: fallback_origin = client.custom_hostnames.fallback_origin.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FallbackOriginDeleteResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginDeleteResponse], fallback_origin, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -79,7 +79,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = response.parse() - assert_matches_type(FallbackOriginDeleteResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginDeleteResponse], fallback_origin, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -90,7 +90,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = response.parse() - assert_matches_type(FallbackOriginDeleteResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginDeleteResponse], fallback_origin, path=["response"]) assert cast(Any, response.is_closed) is True @@ -106,7 +106,7 @@ def test_method_get(self, client: Cloudflare) -> None: fallback_origin = client.custom_hostnames.fallback_origin.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FallbackOriginGetResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginGetResponse], fallback_origin, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -117,7 +117,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = response.parse() - assert_matches_type(FallbackOriginGetResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginGetResponse], fallback_origin, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +128,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = response.parse() - assert_matches_type(FallbackOriginGetResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginGetResponse], fallback_origin, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +149,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", origin="fallback.example.com", ) - assert_matches_type(FallbackOriginUpdateResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginUpdateResponse], fallback_origin, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -161,7 +161,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = await response.parse() - assert_matches_type(FallbackOriginUpdateResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginUpdateResponse], fallback_origin, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = await response.parse() - assert_matches_type(FallbackOriginUpdateResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginUpdateResponse], fallback_origin, path=["response"]) assert cast(Any, response.is_closed) is True @@ -190,7 +190,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: fallback_origin = await async_client.custom_hostnames.fallback_origin.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FallbackOriginDeleteResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginDeleteResponse], fallback_origin, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -201,7 +201,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = await response.parse() - assert_matches_type(FallbackOriginDeleteResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginDeleteResponse], fallback_origin, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -212,7 +212,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = await response.parse() - assert_matches_type(FallbackOriginDeleteResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginDeleteResponse], fallback_origin, path=["response"]) assert cast(Any, response.is_closed) is True @@ -228,7 +228,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: fallback_origin = await async_client.custom_hostnames.fallback_origin.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FallbackOriginGetResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginGetResponse], fallback_origin, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -239,7 +239,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = await response.parse() - assert_matches_type(FallbackOriginGetResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginGetResponse], fallback_origin, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -250,7 +250,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_origin = await response.parse() - assert_matches_type(FallbackOriginGetResponse, fallback_origin, path=["response"]) + assert_matches_type(Optional[FallbackOriginGetResponse], fallback_origin, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dcv_delegation/test_uuid.py b/tests/api_resources/dcv_delegation/test_uuid.py index ae09e9bb676..a1d65863aa7 100644 --- a/tests/api_resources/dcv_delegation/test_uuid.py +++ b/tests/api_resources/dcv_delegation/test_uuid.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -22,7 +22,7 @@ def test_method_get(self, client: Cloudflare) -> None: uuid = client.dcv_delegation.uuid.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) + assert_matches_type(Optional[DCVDelegationUUID], uuid, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" uuid = response.parse() - assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) + assert_matches_type(Optional[DCVDelegationUUID], uuid, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" uuid = response.parse() - assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) + assert_matches_type(Optional[DCVDelegationUUID], uuid, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: uuid = await async_client.dcv_delegation.uuid.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) + assert_matches_type(Optional[DCVDelegationUUID], uuid, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +75,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" uuid = await response.parse() - assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) + assert_matches_type(Optional[DCVDelegationUUID], uuid, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +86,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" uuid = await response.parse() - assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) + assert_matches_type(Optional[DCVDelegationUUID], uuid, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/hostnames/settings/test_tls.py b/tests/api_resources/hostnames/settings/test_tls.py index b320eb82130..7a3a570b024 100644 --- a/tests/api_resources/hostnames/settings/test_tls.py +++ b/tests/api_resources/hostnames/settings/test_tls.py @@ -29,7 +29,7 @@ def test_method_update(self, client: Cloudflare) -> None: setting_id="ciphers", value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], ) - assert_matches_type(Setting, tls, path=["response"]) + assert_matches_type(Optional[Setting], tls, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -43,7 +43,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = response.parse() - assert_matches_type(Setting, tls, path=["response"]) + assert_matches_type(Optional[Setting], tls, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -57,7 +57,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = response.parse() - assert_matches_type(Setting, tls, path=["response"]) + assert_matches_type(Optional[Setting], tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -86,7 +86,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", ) - assert_matches_type(TLSDeleteResponse, tls, path=["response"]) + assert_matches_type(Optional[TLSDeleteResponse], tls, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -99,7 +99,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = response.parse() - assert_matches_type(TLSDeleteResponse, tls, path=["response"]) + assert_matches_type(Optional[TLSDeleteResponse], tls, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -112,7 +112,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = response.parse() - assert_matches_type(TLSDeleteResponse, tls, path=["response"]) + assert_matches_type(Optional[TLSDeleteResponse], tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -186,7 +186,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: setting_id="ciphers", value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], ) - assert_matches_type(Setting, tls, path=["response"]) + assert_matches_type(Optional[Setting], tls, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -200,7 +200,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = await response.parse() - assert_matches_type(Setting, tls, path=["response"]) + assert_matches_type(Optional[Setting], tls, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -214,7 +214,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = await response.parse() - assert_matches_type(Setting, tls, path=["response"]) + assert_matches_type(Optional[Setting], tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -243,7 +243,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", ) - assert_matches_type(TLSDeleteResponse, tls, path=["response"]) + assert_matches_type(Optional[TLSDeleteResponse], tls, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -256,7 +256,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = await response.parse() - assert_matches_type(TLSDeleteResponse, tls, path=["response"]) + assert_matches_type(Optional[TLSDeleteResponse], tls, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -269,7 +269,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = await response.parse() - assert_matches_type(TLSDeleteResponse, tls, path=["response"]) + assert_matches_type(Optional[TLSDeleteResponse], tls, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py b/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py index 5e7de663ce0..4277e406662 100644 --- a/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py +++ b/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: 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\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgN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XMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateCreateResponse], certificate, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateCreateResponse], certificate, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -56,7 +56,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateCreateResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -125,7 +125,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -137,7 +137,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -161,7 +161,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -173,7 +173,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -185,7 +185,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -214,7 +214,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRY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81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateCreateResponse], certificate, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -227,7 +227,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateCreateResponse], certificate, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -240,7 +240,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateCreateResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateCreateResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -297,7 +297,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -309,7 +309,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -321,7 +321,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateDeleteResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -345,7 +345,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -357,7 +357,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -369,7 +369,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/origin_tls_client_auth/test_hostnames.py b/tests/api_resources/origin_tls_client_auth/test_hostnames.py index 2878f827e81..0bb7b13f294 100644 --- a/tests/api_resources/origin_tls_client_auth/test_hostnames.py +++ b/tests/api_resources/origin_tls_client_auth/test_hostnames.py @@ -68,7 +68,7 @@ def test_method_get(self, client: Cloudflare) -> None: "app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AuthenticatedOriginPull, hostname, path=["response"]) + assert_matches_type(Optional[AuthenticatedOriginPull], hostname, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -80,7 +80,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(AuthenticatedOriginPull, hostname, path=["response"]) + assert_matches_type(Optional[AuthenticatedOriginPull], hostname, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -92,7 +92,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(AuthenticatedOriginPull, hostname, path=["response"]) + assert_matches_type(Optional[AuthenticatedOriginPull], hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -162,7 +162,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AuthenticatedOriginPull, hostname, path=["response"]) + assert_matches_type(Optional[AuthenticatedOriginPull], hostname, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -174,7 +174,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(AuthenticatedOriginPull, hostname, path=["response"]) + assert_matches_type(Optional[AuthenticatedOriginPull], hostname, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -186,7 +186,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(AuthenticatedOriginPull, hostname, path=["response"]) + assert_matches_type(Optional[AuthenticatedOriginPull], hostname, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/origin_tls_client_auth/test_settings.py b/tests/api_resources/origin_tls_client_auth/test_settings.py index 36d285fe92f..fc30faf30eb 100644 --- a/tests/api_resources/origin_tls_client_auth/test_settings.py +++ b/tests/api_resources/origin_tls_client_auth/test_settings.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -23,7 +23,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ def test_method_get(self, client: Cloudflare) -> None: setting = client.origin_tls_client_auth.settings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingGetResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -75,7 +75,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingGetResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingGetResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +107,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -119,7 +119,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -131,7 +131,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: setting = await async_client.origin_tls_client_auth.settings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingGetResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingGetResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingGetResponse, setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ssl/certificate_packs/test_order.py b/tests/api_resources/ssl/certificate_packs/test_order.py index 6d8da28d48c..3fcccbf64b9 100644 --- a/tests/api_resources/ssl/certificate_packs/test_order.py +++ b/tests/api_resources/ssl/certificate_packs/test_order.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -27,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: validation_method="txt", validity_days=14, ) - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type(Optional[OrderCreateResponse], order, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: validity_days=14, cloudflare_branding=False, ) - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type(Optional[OrderCreateResponse], order, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -56,7 +56,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" order = response.parse() - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type(Optional[OrderCreateResponse], order, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -72,7 +72,7 @@ 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(Optional[OrderCreateResponse], order, path=["response"]) assert cast(Any, response.is_closed) is True @@ -102,7 +102,7 @@ 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(Optional[OrderCreateResponse], order, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -115,7 +115,7 @@ 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(Optional[OrderCreateResponse], order, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -131,7 +131,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" order = await response.parse() - assert_matches_type(OrderCreateResponse, order, path=["response"]) + assert_matches_type(Optional[OrderCreateResponse], order, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -147,7 +147,7 @@ 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(Optional[OrderCreateResponse], order, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ssl/certificate_packs/test_quota.py b/tests/api_resources/ssl/certificate_packs/test_quota.py index 9417d537564..0181a4d9e7d 100644 --- a/tests/api_resources/ssl/certificate_packs/test_quota.py +++ b/tests/api_resources/ssl/certificate_packs/test_quota.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -22,7 +22,7 @@ def test_method_get(self, client: Cloudflare) -> None: quota = client.ssl.certificate_packs.quota.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(Optional[QuotaGetResponse], quota, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(Optional[QuotaGetResponse], quota, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(Optional[QuotaGetResponse], quota, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: quota = await async_client.ssl.certificate_packs.quota.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(Optional[QuotaGetResponse], quota, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +75,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = await response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(Optional[QuotaGetResponse], quota, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +86,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = await response.parse() - assert_matches_type(QuotaGetResponse, quota, path=["response"]) + assert_matches_type(Optional[QuotaGetResponse], quota, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ssl/test_analyze.py b/tests/api_resources/ssl/test_analyze.py index f037c193eb4..5de06d1c3d5 100644 --- a/tests/api_resources/ssl/test_analyze.py +++ b/tests/api_resources/ssl/test_analyze.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -22,7 +22,7 @@ def test_method_create(self, client: Cloudflare) -> None: analyze = client.ssl.analyze.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(Optional[AnalyzeCreateResponse], analyze, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -31,7 +31,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: 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(Optional[AnalyzeCreateResponse], analyze, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -42,7 +42,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(Optional[AnalyzeCreateResponse], analyze, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -53,7 +53,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(Optional[AnalyzeCreateResponse], analyze, path=["response"]) assert cast(Any, response.is_closed) is True @@ -73,7 +73,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: analyze = await async_client.ssl.analyze.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(Optional[AnalyzeCreateResponse], analyze, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -82,7 +82,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare 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(Optional[AnalyzeCreateResponse], analyze, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +93,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = await response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(Optional[AnalyzeCreateResponse], analyze, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -104,7 +104,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" analyze = await response.parse() - assert_matches_type(AnalyzeCreateResponse, analyze, path=["response"]) + assert_matches_type(Optional[AnalyzeCreateResponse], analyze, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ssl/test_certificate_packs.py b/tests/api_resources/ssl/test_certificate_packs.py index 4d41a5b3de2..865b9acef62 100644 --- a/tests/api_resources/ssl/test_certificate_packs.py +++ b/tests/api_resources/ssl/test_certificate_packs.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -74,7 +74,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackDeleteResponse], certificate_pack, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackDeleteResponse], certificate_pack, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -98,7 +98,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: 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[CertificatePackDeleteResponse], certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +123,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(CertificatePackEditResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -136,7 +136,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackEditResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -149,7 +149,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackEditResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @@ -175,7 +175,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificatePackGetResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackGetResponse], certificate_pack, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -187,7 +187,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackGetResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackGetResponse], certificate_pack, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -199,7 +199,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(CertificatePackGetResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackGetResponse], certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,7 +273,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackDeleteResponse], certificate_pack, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -285,7 +285,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackDeleteResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackDeleteResponse], certificate_pack, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -297,7 +297,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> 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[CertificatePackDeleteResponse], certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @@ -322,7 +322,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(CertificatePackEditResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -335,7 +335,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackEditResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -348,7 +348,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackEditResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True @@ -374,7 +374,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CertificatePackGetResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackGetResponse], certificate_pack, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -386,7 +386,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackGetResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackGetResponse], certificate_pack, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -398,7 +398,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(CertificatePackGetResponse, certificate_pack, path=["response"]) + assert_matches_type(Optional[CertificatePackGetResponse], certificate_pack, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ssl/test_verification.py b/tests/api_resources/ssl/test_verification.py index 698b6e7ebab..2f83b897384 100644 --- a/tests/api_resources/ssl/test_verification.py +++ b/tests/api_resources/ssl/test_verification.py @@ -27,7 +27,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_method="txt", ) - assert_matches_type(VerificationEditResponse, verification, path=["response"]) + assert_matches_type(Optional[VerificationEditResponse], verification, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" verification = response.parse() - assert_matches_type(VerificationEditResponse, verification, path=["response"]) + assert_matches_type(Optional[VerificationEditResponse], verification, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -53,7 +53,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" verification = response.parse() - assert_matches_type(VerificationEditResponse, verification, path=["response"]) + assert_matches_type(Optional[VerificationEditResponse], verification, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +130,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_method="txt", ) - assert_matches_type(VerificationEditResponse, verification, path=["response"]) + assert_matches_type(Optional[VerificationEditResponse], verification, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -143,7 +143,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" verification = await response.parse() - assert_matches_type(VerificationEditResponse, verification, path=["response"]) + assert_matches_type(Optional[VerificationEditResponse], verification, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -156,7 +156,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" verification = await response.parse() - assert_matches_type(VerificationEditResponse, verification, path=["response"]) + assert_matches_type(Optional[VerificationEditResponse], verification, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ssl/universal/test_settings.py b/tests/api_resources/ssl/universal/test_settings.py index e31b8cfe0ee..a6040dd1411 100644 --- a/tests/api_resources/ssl/universal/test_settings.py +++ b/tests/api_resources/ssl/universal/test_settings.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -22,7 +22,7 @@ def test_method_edit(self, client: Cloudflare) -> None: setting = client.ssl.universal.settings.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -30,7 +30,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -41,7 +41,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -68,7 +68,7 @@ def test_method_get(self, client: Cloudflare) -> None: setting = client.ssl.universal.settings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -79,7 +79,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -90,7 +90,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: setting = await async_client.ssl.universal.settings.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -118,7 +118,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) zone_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, ) - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -129,7 +129,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -140,7 +140,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -156,7 +156,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: setting = await async_client.ssl.universal.settings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -167,7 +167,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -178,7 +178,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(UniversalSSLSettings, setting, path=["response"]) + assert_matches_type(Optional[UniversalSSLSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_client_certificates.py b/tests/api_resources/test_client_certificates.py index c38007c9f69..8f8328f80e7 100644 --- a/tests/api_resources/test_client_certificates.py +++ b/tests/api_resources/test_client_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -27,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----\n", validity_days=3650, ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -53,7 +53,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -122,7 +122,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -134,7 +134,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -146,7 +146,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -170,7 +170,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -182,7 +182,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -194,7 +194,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -218,7 +218,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -230,7 +230,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -242,7 +242,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -271,7 +271,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----\n", validity_days=3650, ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -284,7 +284,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -297,7 +297,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -390,7 +390,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -414,7 +414,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -426,7 +426,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -438,7 +438,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -462,7 +462,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -474,7 +474,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -486,7 +486,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" client_certificate = await response.parse() - assert_matches_type(ClientCertificate, client_certificate, path=["response"]) + assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_custom_certificates.py b/tests/api_resources/test_custom_certificates.py index 52955cd8a28..3612c9a1544 100644 --- a/tests/api_resources/test_custom_certificates.py +++ b/tests/api_resources/test_custom_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -31,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: 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\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBs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XUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: policy="(country: US) or (region: EU)", type="sni_custom", ) - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -70,7 +70,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -138,7 +138,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomCertificateDeleteResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateDeleteResponse], custom_certificate, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -150,7 +150,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateDeleteResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateDeleteResponse], custom_certificate, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -162,7 +162,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateDeleteResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateDeleteResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -186,7 +186,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -199,7 +199,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: policy="(country: US) or (region: EU)", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5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8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -211,7 +211,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -223,7 +223,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -247,7 +247,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomCertificateGetResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateGetResponse], custom_certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -259,7 +259,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateGetResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateGetResponse], custom_certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -271,7 +271,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = response.parse() - assert_matches_type(CustomCertificateGetResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateGetResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -300,7 +300,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: 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/LbE49rWf288N6sJA5BRb6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07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -313,7 +313,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare policy="(country: US) or (region: EU)", type="sni_custom", ) - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -326,7 +326,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -339,7 +339,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateCreateResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateCreateResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -407,7 +407,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomCertificateDeleteResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateDeleteResponse], custom_certificate, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -419,7 +419,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateDeleteResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateDeleteResponse], custom_certificate, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -431,7 +431,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateDeleteResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateDeleteResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -455,7 +455,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -468,7 +468,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) policy="(country: US) or (region: EU)", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/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MgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -480,7 +480,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -492,7 +492,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateEditResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateEditResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -516,7 +516,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomCertificateGetResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateGetResponse], custom_certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -528,7 +528,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateGetResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateGetResponse], custom_certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -540,7 +540,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_certificate = await response.parse() - assert_matches_type(CustomCertificateGetResponse, custom_certificate, path=["response"]) + assert_matches_type(Optional[CustomCertificateGetResponse], custom_certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_custom_hostnames.py b/tests/api_resources/test_custom_hostnames.py index 5374bc98d27..1ca4d8d7318 100644 --- a/tests/api_resources/test_custom_hostnames.py +++ b/tests/api_resources/test_custom_hostnames.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -31,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: hostname="app.example.com", ssl={}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -56,7 +56,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, custom_metadata={"key": "value"}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -69,7 +69,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -82,7 +82,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -203,7 +203,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -230,7 +230,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "wildcard": False, }, ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -242,7 +242,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -254,7 +254,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -278,7 +278,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameGetResponse], custom_hostname, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -290,7 +290,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameGetResponse], custom_hostname, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -302,7 +302,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameGetResponse], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -331,7 +331,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: hostname="app.example.com", ssl={}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -356,7 +356,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, custom_metadata={"key": "value"}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -369,7 +369,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -382,7 +382,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameCreateResponse], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -503,7 +503,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -530,7 +530,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "wildcard": False, }, ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -542,7 +542,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -554,7 +554,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameEditResponse], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -578,7 +578,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameGetResponse], custom_hostname, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -590,7 +590,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameGetResponse], custom_hostname, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -602,7 +602,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(Optional[CustomHostnameGetResponse], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_keyless_certificates.py b/tests/api_resources/test_keyless_certificates.py index 977d2eefb37..f1859888ebc 100644 --- a/tests/api_resources/test_keyless_certificates.py +++ b/tests/api_resources/test_keyless_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: host="example.com", port=24008, ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -73,7 +73,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -131,7 +131,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificateDeleteResponse, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificateDeleteResponse], keyless_certificate, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -143,7 +143,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateDeleteResponse, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificateDeleteResponse], keyless_certificate, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -155,7 +155,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateDeleteResponse, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificateDeleteResponse], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +181,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -197,7 +197,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -209,7 +209,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -221,7 +221,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -247,7 +247,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -259,7 +259,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -271,7 +271,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -303,7 +303,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: host="example.com", port=24008, ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -319,7 +319,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -333,7 +333,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -347,7 +347,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -405,7 +405,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificateDeleteResponse, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificateDeleteResponse], keyless_certificate, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -417,7 +417,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateDeleteResponse, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificateDeleteResponse], keyless_certificate, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -429,7 +429,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateDeleteResponse, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificateDeleteResponse], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -455,7 +455,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -471,7 +471,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -483,7 +483,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -495,7 +495,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -521,7 +521,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -533,7 +533,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -545,7 +545,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificate, keyless_certificate, path=["response"]) + assert_matches_type(Optional[KeylessCertificate], keyless_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 cbe7c84c170..70101b484c8 100644 --- a/tests/api_resources/test_mtls_certificates.py +++ b/tests/api_resources/test_mtls_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: 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(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="example_ca_cert", private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCv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z6WMYA=\n-----END PRIVATE KEY-----", ) - assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -65,7 +65,7 @@ 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(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -122,7 +122,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -134,7 +134,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -146,7 +146,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -170,7 +170,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -182,7 +182,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -194,7 +194,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -223,7 +223,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: 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(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -234,7 +234,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name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0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+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(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -247,7 +247,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -260,7 +260,7 @@ 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(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -317,7 +317,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -329,7 +329,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -341,7 +341,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -365,7 +365,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -377,7 +377,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -389,7 +389,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificate, mtls_certificate, path=["response"]) + assert_matches_type(Optional[MTLSCertificate], mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_origin_ca_certificates.py b/tests/api_resources/test_origin_ca_certificates.py index 864a00dc0ed..bd05350fd58 100644 --- a/tests/api_resources/test_origin_ca_certificates.py +++ b/tests/api_resources/test_origin_ca_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -26,7 +26,7 @@ class TestOriginCACertificates: @parametrize def test_method_create(self, client: Cloudflare) -> None: origin_ca_certificate = client.origin_ca_certificates.create() - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: request_type="origin-rsa", requested_validity=5475, ) - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = response.parse() - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -54,7 +54,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = response.parse() - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -66,7 +66,7 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: origin_ca_certificate = client.origin_ca_certificates.list( - identifier="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[OriginCACertificate], origin_ca_certificate, path=["response"]) @@ -95,7 +95,7 @@ def test_method_delete(self, client: Cloudflare) -> None: origin_ca_certificate = client.origin_ca_certificates.delete( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginCACertificateDeleteResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateDeleteResponse], origin_ca_certificate, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -106,7 +106,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = response.parse() - assert_matches_type(OriginCACertificateDeleteResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateDeleteResponse], origin_ca_certificate, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -117,7 +117,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = response.parse() - assert_matches_type(OriginCACertificateDeleteResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateDeleteResponse], origin_ca_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -133,7 +133,7 @@ def test_method_get(self, client: Cloudflare) -> None: origin_ca_certificate = client.origin_ca_certificates.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginCACertificateGetResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateGetResponse], origin_ca_certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -144,7 +144,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = response.parse() - assert_matches_type(OriginCACertificateGetResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateGetResponse], origin_ca_certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -155,7 +155,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = response.parse() - assert_matches_type(OriginCACertificateGetResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateGetResponse], origin_ca_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -173,7 +173,7 @@ class TestAsyncOriginCACertificates: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: origin_ca_certificate = await async_client.origin_ca_certificates.create() - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -183,7 +183,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare request_type="origin-rsa", requested_validity=5475, ) - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -192,7 +192,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = await response.parse() - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -201,7 +201,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = await response.parse() - assert_matches_type(OriginCACertificateCreateResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateCreateResponse], origin_ca_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -213,7 +213,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: origin_ca_certificate = await async_client.origin_ca_certificates.list( - identifier="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[OriginCACertificate], origin_ca_certificate, path=["response"]) @@ -242,7 +242,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: origin_ca_certificate = await async_client.origin_ca_certificates.delete( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginCACertificateDeleteResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateDeleteResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -253,7 +253,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = await response.parse() - assert_matches_type(OriginCACertificateDeleteResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateDeleteResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -264,7 +264,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = await response.parse() - assert_matches_type(OriginCACertificateDeleteResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateDeleteResponse], origin_ca_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -280,7 +280,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: origin_ca_certificate = await async_client.origin_ca_certificates.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginCACertificateGetResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateGetResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -291,7 +291,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = await response.parse() - assert_matches_type(OriginCACertificateGetResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateGetResponse], origin_ca_certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -302,7 +302,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_ca_certificate = await response.parse() - assert_matches_type(OriginCACertificateGetResponse, origin_ca_certificate, path=["response"]) + assert_matches_type(Optional[OriginCACertificateGetResponse], origin_ca_certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_origin_tls_client_auth.py b/tests/api_resources/test_origin_tls_client_auth.py index d3a091ec945..cd43e2ee233 100644 --- a/tests/api_resources/test_origin_tls_client_auth.py +++ b/tests/api_resources/test_origin_tls_client_auth.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: certificate="-----B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zRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(OriginTLSClientAuthCreateResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(OriginTLSClientAuthCreateResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -56,7 +56,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(OriginTLSClientAuthCreateResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientAuthDeleteResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -125,7 +125,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(OriginTLSClientAuthDeleteResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -137,7 +137,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(OriginTLSClientAuthDeleteResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -161,7 +161,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientAuthGetResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -173,7 +173,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(OriginTLSClientAuthGetResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -185,7 +185,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(OriginTLSClientAuthGetResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -214,7 +214,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetc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6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(OriginTLSClientAuthCreateResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -227,7 +227,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(OriginTLSClientAuthCreateResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -240,7 +240,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(OriginTLSClientAuthCreateResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -297,7 +297,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientAuthDeleteResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -309,7 +309,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(OriginTLSClientAuthDeleteResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -321,7 +321,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(OriginTLSClientAuthDeleteResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -345,7 +345,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientAuthGetResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -357,7 +357,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(OriginTLSClientAuthGetResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -369,7 +369,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(OriginTLSClientAuthGetResponse, origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True