From c0855b7ee11a2b7c05a2a0708ea6fee582bce23b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 28 Mar 2024 04:24:15 +0000 Subject: [PATCH] feat(api): update via SDK Studio --- api.md | 28 +++--- src/cloudflare/pagination.py | 41 ++------- .../resources/challenges/widgets.py | 56 +++++------ .../resources/dcv_delegation/uuid.py | 14 +-- .../resources/hostnames/settings/tls.py | 33 ++----- src/cloudflare/types/challenges/__init__.py | 4 +- ..._widget_detail.py => challenges_widget.py} | 4 +- ...dget_list.py => challenges_widget_list.py} | 4 +- .../types/dcv_delegation/__init__.py | 4 +- ..._uuid_object.py => dcv_delegation_uuid.py} | 4 +- .../types/hostnames/settings/__init__.py | 8 +- ...t_delete.py => hostname_setting_delete.py} | 4 +- ...s_setting_object.py => hostname_stting.py} | 4 +- .../api_resources/challenges/test_widgets.py | 92 +++++++++---------- .../api_resources/dcv_delegation/test_uuid.py | 14 +-- .../hostnames/settings/test_tls.py | 30 +++--- 16 files changed, 146 insertions(+), 198 deletions(-) rename src/cloudflare/types/challenges/{nc_challenges_admin_widget_detail.py => challenges_widget.py} (93%) rename src/cloudflare/types/challenges/{nc_challenges_admin_widget_list.py => challenges_widget_list.py} (93%) rename src/cloudflare/types/dcv_delegation/{tls_certificates_and_hostnames_uuid_object.py => dcv_delegation_uuid.py} (68%) rename src/cloudflare/types/hostnames/settings/{tls_certificates_and_hostnames_setting_object_delete.py => hostname_setting_delete.py} (81%) rename src/cloudflare/types/hostnames/settings/{tls_certificates_and_hostnames_setting_object.py => hostname_stting.py} (85%) diff --git a/api.md b/api.md index 9c60a9851ae..8d63267f790 100644 --- a/api.md +++ b/api.md @@ -5842,17 +5842,17 @@ Methods: Types: ```python -from cloudflare.types.challenges import NcChallengesAdminWidgetDetail, NcChallengesAdminWidgetList +from cloudflare.types.challenges import ChallengesWidget, ChallengesWidgetList ``` Methods: -- client.challenges.widgets.create(\*, account_id, \*\*params) -> Optional -- client.challenges.widgets.update(sitekey, \*, account_id, \*\*params) -> Optional -- client.challenges.widgets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[NcChallengesAdminWidgetList] -- client.challenges.widgets.delete(sitekey, \*, account_id) -> Optional -- client.challenges.widgets.get(sitekey, \*, account_id) -> Optional -- client.challenges.widgets.rotate_secret(sitekey, \*, account_id, \*\*params) -> Optional +- client.challenges.widgets.create(\*, account_id, \*\*params) -> Optional +- client.challenges.widgets.update(sitekey, \*, account_id, \*\*params) -> Optional +- client.challenges.widgets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ChallengesWidgetList] +- client.challenges.widgets.delete(sitekey, \*, account_id) -> Optional +- client.challenges.widgets.get(sitekey, \*, account_id) -> Optional +- client.challenges.widgets.rotate_secret(sitekey, \*, account_id, \*\*params) -> Optional # Hyperdrive @@ -5862,7 +5862,7 @@ Types: ```python from cloudflare.types.hyperdrive import ( - HyperdriveHyperdriveWithIdentifier, + Hyperdrive, ConfigCreateResponse, ConfigUpdateResponse, ConfigListResponse, @@ -7115,12 +7115,12 @@ Methods: Types: ```python -from cloudflare.types.dcv_delegation import TLSCertificatesAndHostnamesUUIDObject +from cloudflare.types.dcv_delegation import DCVDelegationUUID ``` Methods: -- client.dcv_delegation.uuid.get(\*, zone_id) -> TLSCertificatesAndHostnamesUUIDObject +- client.dcv_delegation.uuid.get(\*, zone_id) -> DCVDelegationUUID # Hostnames @@ -7132,16 +7132,16 @@ Types: ```python from cloudflare.types.hostnames.settings import ( - TLSCertificatesAndHostnamesSettingObject, - TLSCertificatesAndHostnamesSettingObjectDelete, + HostnameSettingDelete, + HostnameStting, TLSGetResponse, ) ``` Methods: -- client.hostnames.settings.tls.update(hostname, \*, zone_id, setting_id, \*\*params) -> TLSCertificatesAndHostnamesSettingObject -- client.hostnames.settings.tls.delete(hostname, \*, zone_id, setting_id) -> TLSCertificatesAndHostnamesSettingObjectDelete +- client.hostnames.settings.tls.update(hostname, \*, zone_id, setting_id, \*\*params) -> HostnameStting +- client.hostnames.settings.tls.delete(hostname, \*, zone_id, setting_id) -> HostnameSettingDelete - client.hostnames.settings.tls.get(setting_id, \*, zone_id) -> Optional # Snippets diff --git a/src/cloudflare/pagination.py b/src/cloudflare/pagination.py index b6f4cc2cfc6..5f6aecf9f92 100644 --- a/src/cloudflare/pagination.py +++ b/src/cloudflare/pagination.py @@ -1,11 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Any, List, Type, Generic, Mapping, TypeVar, Optional, cast +from typing import List, Generic, TypeVar, Optional, cast from typing_extensions import override -from httpx import Response - -from ._utils import is_mapping from ._models import BaseModel, GenericModel from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage @@ -27,8 +24,6 @@ "AsyncSinglePage", ] -_BaseModelT = TypeVar("_BaseModelT", bound=BaseModel) - _T = TypeVar("_T") @@ -257,14 +252,14 @@ def next_page_info(self) -> Optional[PageInfo]: class SyncSinglePage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): - result: List[_T] + items: List[_T] @override def _get_page_items(self) -> List[_T]: - result = self.result - if not result: + items = self.items + if not items: return [] - return result + return items @override def next_page_info(self) -> None: @@ -274,25 +269,16 @@ def next_page_info(self) -> None: """ return None - @classmethod - def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003 - return cls.construct( - None, - **{ - **(cast(Mapping[str, Any], data) if is_mapping(data) else {"result": data}), - }, - ) - class AsyncSinglePage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): - result: List[_T] + items: List[_T] @override def _get_page_items(self) -> List[_T]: - result = self.result - if not result: + items = self.items + if not items: return [] - return result + return items @override def next_page_info(self) -> None: @@ -301,12 +287,3 @@ def next_page_info(self) -> None: so there will never be a next page. """ return None - - @classmethod - def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003 - return cls.construct( - None, - **{ - **(cast(Mapping[str, Any], data) if is_mapping(data) else {"result": data}), - }, - ) diff --git a/src/cloudflare/resources/challenges/widgets.py b/src/cloudflare/resources/challenges/widgets.py index 45f79b1e42a..5c9d1521e5b 100644 --- a/src/cloudflare/resources/challenges/widgets.py +++ b/src/cloudflare/resources/challenges/widgets.py @@ -27,8 +27,8 @@ make_request_options, ) from ...types.challenges import ( - NcChallengesAdminWidgetList, - NcChallengesAdminWidgetDetail, + ChallengesWidget, + ChallengesWidgetList, widget_list_params, widget_create_params, widget_update_params, @@ -68,7 +68,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Lists challenge widgets. @@ -139,7 +139,7 @@ def create( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) def update( @@ -159,7 +159,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Update the configuration of a widget. @@ -214,7 +214,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) def list( @@ -231,7 +231,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[NcChallengesAdminWidgetList]: + ) -> SyncV4PagePaginationArray[ChallengesWidgetList]: """ Lists all turnstile widgets of an account. @@ -258,7 +258,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/challenges/widgets", - page=SyncV4PagePaginationArray[NcChallengesAdminWidgetList], + page=SyncV4PagePaginationArray[ChallengesWidgetList], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -274,7 +274,7 @@ def list( widget_list_params.WidgetListParams, ), ), - model=NcChallengesAdminWidgetList, + model=ChallengesWidgetList, ) def delete( @@ -288,7 +288,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Destroy a Turnstile Widget. @@ -318,7 +318,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) def get( @@ -332,7 +332,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Show a single challenge widget configuration. @@ -362,7 +362,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) def rotate_secret( @@ -377,7 +377,7 @@ def rotate_secret( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """Generate a new secret key for this widget. If `invalidate_immediately` is set to @@ -418,7 +418,7 @@ def rotate_secret( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) @@ -452,7 +452,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Lists challenge widgets. @@ -523,7 +523,7 @@ async def create( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) async def update( @@ -543,7 +543,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Update the configuration of a widget. @@ -598,7 +598,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) def list( @@ -615,7 +615,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[NcChallengesAdminWidgetList, AsyncV4PagePaginationArray[NcChallengesAdminWidgetList]]: + ) -> AsyncPaginator[ChallengesWidgetList, AsyncV4PagePaginationArray[ChallengesWidgetList]]: """ Lists all turnstile widgets of an account. @@ -642,7 +642,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/challenges/widgets", - page=AsyncV4PagePaginationArray[NcChallengesAdminWidgetList], + page=AsyncV4PagePaginationArray[ChallengesWidgetList], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -658,7 +658,7 @@ def list( widget_list_params.WidgetListParams, ), ), - model=NcChallengesAdminWidgetList, + model=ChallengesWidgetList, ) async def delete( @@ -672,7 +672,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Destroy a Turnstile Widget. @@ -702,7 +702,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) async def get( @@ -716,7 +716,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """ Show a single challenge widget configuration. @@ -746,7 +746,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) async def rotate_secret( @@ -761,7 +761,7 @@ async def rotate_secret( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NcChallengesAdminWidgetDetail]: + ) -> Optional[ChallengesWidget]: """Generate a new secret key for this widget. If `invalidate_immediately` is set to @@ -802,7 +802,7 @@ async def rotate_secret( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NcChallengesAdminWidgetDetail]], ResultWrapper[NcChallengesAdminWidgetDetail]), + cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), ) diff --git a/src/cloudflare/resources/dcv_delegation/uuid.py b/src/cloudflare/resources/dcv_delegation/uuid.py index a56cb3629a9..c6460a75e22 100644 --- a/src/cloudflare/resources/dcv_delegation/uuid.py +++ b/src/cloudflare/resources/dcv_delegation/uuid.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.dcv_delegation import TLSCertificatesAndHostnamesUUIDObject +from ...types.dcv_delegation import DCVDelegationUUID __all__ = ["UUID", "AsyncUUID"] @@ -43,7 +43,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSCertificatesAndHostnamesUUIDObject: + ) -> DCVDelegationUUID: """ Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation. @@ -70,9 +70,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[TLSCertificatesAndHostnamesUUIDObject], ResultWrapper[TLSCertificatesAndHostnamesUUIDObject] - ), + cast_to=cast(Type[DCVDelegationUUID], ResultWrapper[DCVDelegationUUID]), ) @@ -95,7 +93,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSCertificatesAndHostnamesUUIDObject: + ) -> DCVDelegationUUID: """ Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation. @@ -122,9 +120,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[TLSCertificatesAndHostnamesUUIDObject], ResultWrapper[TLSCertificatesAndHostnamesUUIDObject] - ), + cast_to=cast(Type[DCVDelegationUUID], ResultWrapper[DCVDelegationUUID]), ) diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index df9d4918347..9c58de5adde 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -24,12 +24,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.hostnames.settings import ( - TLSGetResponse, - TLSCertificatesAndHostnamesSettingObject, - TLSCertificatesAndHostnamesSettingObjectDelete, - tls_update_params, -) +from ....types.hostnames.settings import HostnameStting, TLSGetResponse, HostnameSettingDelete, tls_update_params __all__ = ["TLS", "AsyncTLS"] @@ -56,7 +51,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSCertificatesAndHostnamesSettingObject: + ) -> HostnameStting: """ Update the tls setting value for the hostname. @@ -93,9 +88,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[TLSCertificatesAndHostnamesSettingObject], ResultWrapper[TLSCertificatesAndHostnamesSettingObject] - ), + cast_to=cast(Type[HostnameStting], ResultWrapper[HostnameStting]), ) def delete( @@ -110,7 +103,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSCertificatesAndHostnamesSettingObjectDelete: + ) -> HostnameSettingDelete: """ Delete the tls setting value for the hostname. @@ -144,10 +137,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[TLSCertificatesAndHostnamesSettingObjectDelete], - ResultWrapper[TLSCertificatesAndHostnamesSettingObjectDelete], - ), + cast_to=cast(Type[HostnameSettingDelete], ResultWrapper[HostnameSettingDelete]), ) def get( @@ -217,7 +207,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSCertificatesAndHostnamesSettingObject: + ) -> HostnameStting: """ Update the tls setting value for the hostname. @@ -254,9 +244,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[TLSCertificatesAndHostnamesSettingObject], ResultWrapper[TLSCertificatesAndHostnamesSettingObject] - ), + cast_to=cast(Type[HostnameStting], ResultWrapper[HostnameStting]), ) async def delete( @@ -271,7 +259,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TLSCertificatesAndHostnamesSettingObjectDelete: + ) -> HostnameSettingDelete: """ Delete the tls setting value for the hostname. @@ -305,10 +293,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[TLSCertificatesAndHostnamesSettingObjectDelete], - ResultWrapper[TLSCertificatesAndHostnamesSettingObjectDelete], - ), + cast_to=cast(Type[HostnameSettingDelete], ResultWrapper[HostnameSettingDelete]), ) async def get( diff --git a/src/cloudflare/types/challenges/__init__.py b/src/cloudflare/types/challenges/__init__.py index dda7901b9ed..21538f16a7a 100644 --- a/src/cloudflare/types/challenges/__init__.py +++ b/src/cloudflare/types/challenges/__init__.py @@ -2,9 +2,9 @@ from __future__ import annotations +from .challenges_widget import ChallengesWidget as ChallengesWidget from .widget_list_params import WidgetListParams as WidgetListParams from .widget_create_params import WidgetCreateParams as WidgetCreateParams from .widget_update_params import WidgetUpdateParams as WidgetUpdateParams +from .challenges_widget_list import ChallengesWidgetList as ChallengesWidgetList from .widget_rotate_secret_params import WidgetRotateSecretParams as WidgetRotateSecretParams -from .nc_challenges_admin_widget_list import NcChallengesAdminWidgetList as NcChallengesAdminWidgetList -from .nc_challenges_admin_widget_detail import NcChallengesAdminWidgetDetail as NcChallengesAdminWidgetDetail diff --git a/src/cloudflare/types/challenges/nc_challenges_admin_widget_detail.py b/src/cloudflare/types/challenges/challenges_widget.py similarity index 93% rename from src/cloudflare/types/challenges/nc_challenges_admin_widget_detail.py rename to src/cloudflare/types/challenges/challenges_widget.py index f6c3b713595..25dd3a000ad 100644 --- a/src/cloudflare/types/challenges/nc_challenges_admin_widget_detail.py +++ b/src/cloudflare/types/challenges/challenges_widget.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["NcChallengesAdminWidgetDetail"] +__all__ = ["ChallengesWidget"] -class NcChallengesAdminWidgetDetail(BaseModel): +class ChallengesWidget(BaseModel): bot_fight_mode: bool """ If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive diff --git a/src/cloudflare/types/challenges/nc_challenges_admin_widget_list.py b/src/cloudflare/types/challenges/challenges_widget_list.py similarity index 93% rename from src/cloudflare/types/challenges/nc_challenges_admin_widget_list.py rename to src/cloudflare/types/challenges/challenges_widget_list.py index ebeeb4343f4..c7b05f2f592 100644 --- a/src/cloudflare/types/challenges/nc_challenges_admin_widget_list.py +++ b/src/cloudflare/types/challenges/challenges_widget_list.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["NcChallengesAdminWidgetList"] +__all__ = ["ChallengesWidgetList"] -class NcChallengesAdminWidgetList(BaseModel): +class ChallengesWidgetList(BaseModel): bot_fight_mode: bool """ If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive diff --git a/src/cloudflare/types/dcv_delegation/__init__.py b/src/cloudflare/types/dcv_delegation/__init__.py index d1de3e6391e..9c1d5c3039b 100644 --- a/src/cloudflare/types/dcv_delegation/__init__.py +++ b/src/cloudflare/types/dcv_delegation/__init__.py @@ -2,6 +2,4 @@ from __future__ import annotations -from .tls_certificates_and_hostnames_uuid_object import ( - TLSCertificatesAndHostnamesUUIDObject as TLSCertificatesAndHostnamesUUIDObject, -) +from .dcv_delegation_uuid import DCVDelegationUUID as DCVDelegationUUID diff --git a/src/cloudflare/types/dcv_delegation/tls_certificates_and_hostnames_uuid_object.py b/src/cloudflare/types/dcv_delegation/dcv_delegation_uuid.py similarity index 68% rename from src/cloudflare/types/dcv_delegation/tls_certificates_and_hostnames_uuid_object.py rename to src/cloudflare/types/dcv_delegation/dcv_delegation_uuid.py index e4a04cde06b..43469f24d9c 100644 --- a/src/cloudflare/types/dcv_delegation/tls_certificates_and_hostnames_uuid_object.py +++ b/src/cloudflare/types/dcv_delegation/dcv_delegation_uuid.py @@ -4,9 +4,9 @@ from ..._models import BaseModel -__all__ = ["TLSCertificatesAndHostnamesUUIDObject"] +__all__ = ["DCVDelegationUUID"] -class TLSCertificatesAndHostnamesUUIDObject(BaseModel): +class DCVDelegationUUID(BaseModel): uuid: Optional[str] = None """The DCV Delegation unique identifier.""" diff --git a/src/cloudflare/types/hostnames/settings/__init__.py b/src/cloudflare/types/hostnames/settings/__init__.py index 9f307e5137b..d4d13ab9044 100644 --- a/src/cloudflare/types/hostnames/settings/__init__.py +++ b/src/cloudflare/types/hostnames/settings/__init__.py @@ -2,11 +2,7 @@ from __future__ import annotations +from .hostname_stting import HostnameStting as HostnameStting from .tls_get_response import TLSGetResponse as TLSGetResponse from .tls_update_params import TLSUpdateParams as TLSUpdateParams -from .tls_certificates_and_hostnames_setting_object import ( - TLSCertificatesAndHostnamesSettingObject as TLSCertificatesAndHostnamesSettingObject, -) -from .tls_certificates_and_hostnames_setting_object_delete import ( - TLSCertificatesAndHostnamesSettingObjectDelete as TLSCertificatesAndHostnamesSettingObjectDelete, -) +from .hostname_setting_delete import HostnameSettingDelete as HostnameSettingDelete diff --git a/src/cloudflare/types/hostnames/settings/tls_certificates_and_hostnames_setting_object_delete.py b/src/cloudflare/types/hostnames/settings/hostname_setting_delete.py similarity index 81% rename from src/cloudflare/types/hostnames/settings/tls_certificates_and_hostnames_setting_object_delete.py rename to src/cloudflare/types/hostnames/settings/hostname_setting_delete.py index 8008b9ef4b7..5991fe4d96f 100644 --- a/src/cloudflare/types/hostnames/settings/tls_certificates_and_hostnames_setting_object_delete.py +++ b/src/cloudflare/types/hostnames/settings/hostname_setting_delete.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["TLSCertificatesAndHostnamesSettingObjectDelete"] +__all__ = ["HostnameSettingDelete"] -class TLSCertificatesAndHostnamesSettingObjectDelete(BaseModel): +class HostnameSettingDelete(BaseModel): created_at: Optional[datetime] = None """This is the time the tls setting was originally created for this hostname.""" diff --git a/src/cloudflare/types/hostnames/settings/tls_certificates_and_hostnames_setting_object.py b/src/cloudflare/types/hostnames/settings/hostname_stting.py similarity index 85% rename from src/cloudflare/types/hostnames/settings/tls_certificates_and_hostnames_setting_object.py rename to src/cloudflare/types/hostnames/settings/hostname_stting.py index 2ca745daf84..31d6932795e 100644 --- a/src/cloudflare/types/hostnames/settings/tls_certificates_and_hostnames_setting_object.py +++ b/src/cloudflare/types/hostnames/settings/hostname_stting.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["TLSCertificatesAndHostnamesSettingObject"] +__all__ = ["HostnameStting"] -class TLSCertificatesAndHostnamesSettingObject(BaseModel): +class HostnameStting(BaseModel): created_at: Optional[datetime] = None """This is the time the tls setting was originally created for this hostname.""" diff --git a/tests/api_resources/challenges/test_widgets.py b/tests/api_resources/challenges/test_widgets.py index 71cf53e33a0..9a6efa429ee 100644 --- a/tests/api_resources/challenges/test_widgets.py +++ b/tests/api_resources/challenges/test_widgets.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.challenges import ( - NcChallengesAdminWidgetList, - NcChallengesAdminWidgetDetail, + ChallengesWidget, + ChallengesWidgetList, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: offlabel=False, region="world", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,7 +64,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" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -79,7 +79,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +104,7 @@ def test_method_update(self, client: Cloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +119,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: clearance_level="interactive", offlabel=False, ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,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" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -151,7 +151,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -182,7 +182,7 @@ def test_method_list(self, client: Cloudflare) -> None: widget = client.challenges.widgets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -194,7 +194,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -206,7 +206,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(SyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -218,7 +218,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(SyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -237,7 +237,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -250,7 +250,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" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +263,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -289,7 +289,7 @@ def test_method_get(self, client: Cloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -302,7 +302,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" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -315,7 +315,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -341,7 +341,7 @@ def test_method_rotate_secret(self, client: Cloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -351,7 +351,7 @@ def test_method_rotate_secret_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", invalidate_immediately=True, ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -364,7 +364,7 @@ def test_raw_response_rotate_secret(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -377,7 +377,7 @@ def test_streaming_response_rotate_secret(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -409,7 +409,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -428,7 +428,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare offlabel=False, region="world", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -443,7 +443,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" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -458,7 +458,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -483,7 +483,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -498,7 +498,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare clearance_level="interactive", offlabel=False, ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -514,7 +514,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" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -530,7 +530,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -561,7 +561,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: widget = await async_client.challenges.widgets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -573,7 +573,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -585,7 +585,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -597,7 +597,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[NcChallengesAdminWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -616,7 +616,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -629,7 +629,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" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -642,7 +642,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -668,7 +668,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -681,7 +681,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" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -694,7 +694,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -720,7 +720,7 @@ async def test_method_rotate_secret(self, async_client: AsyncCloudflare) -> None "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -730,7 +730,7 @@ async def test_method_rotate_secret_with_all_params(self, async_client: AsyncClo account_id="023e105f4ecef8ad9ca31a8372d0c353", invalidate_immediately=True, ) - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -743,7 +743,7 @@ async def test_raw_response_rotate_secret(self, async_client: AsyncCloudflare) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -756,7 +756,7 @@ async def test_streaming_response_rotate_secret(self, async_client: AsyncCloudfl assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[NcChallengesAdminWidgetDetail], widget, path=["response"]) + assert_matches_type(Optional[ChallengesWidget], widget, 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 3f5e3b861a3..0bb10895bed 100644 --- a/tests/api_resources/dcv_delegation/test_uuid.py +++ b/tests/api_resources/dcv_delegation/test_uuid.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.dcv_delegation import TLSCertificatesAndHostnamesUUIDObject +from cloudflare.types.dcv_delegation import DCVDelegationUUID base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: uuid = client.dcv_delegation.uuid.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TLSCertificatesAndHostnamesUUIDObject, uuid, path=["response"]) + assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,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(TLSCertificatesAndHostnamesUUIDObject, uuid, path=["response"]) + assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,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(TLSCertificatesAndHostnamesUUIDObject, uuid, path=["response"]) + assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,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(TLSCertificatesAndHostnamesUUIDObject, uuid, path=["response"]) + assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,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(TLSCertificatesAndHostnamesUUIDObject, uuid, path=["response"]) + assert_matches_type(DCVDelegationUUID, uuid, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,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(TLSCertificatesAndHostnamesUUIDObject, uuid, path=["response"]) + assert_matches_type(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 0d3a91ed60e..36b390abae3 100644 --- a/tests/api_resources/hostnames/settings/test_tls.py +++ b/tests/api_resources/hostnames/settings/test_tls.py @@ -9,11 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.hostnames.settings import ( - TLSGetResponse, - TLSCertificatesAndHostnamesSettingObject, - TLSCertificatesAndHostnamesSettingObjectDelete, -) +from cloudflare.types.hostnames.settings import HostnameStting, TLSGetResponse, HostnameSettingDelete base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +26,7 @@ def test_method_update(self, client: Cloudflare) -> None: setting_id="ciphers", value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], ) - assert_matches_type(TLSCertificatesAndHostnamesSettingObject, tls, path=["response"]) + assert_matches_type(HostnameStting, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +41,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(TLSCertificatesAndHostnamesSettingObject, tls, path=["response"]) + assert_matches_type(HostnameStting, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +56,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(TLSCertificatesAndHostnamesSettingObject, tls, path=["response"]) + assert_matches_type(HostnameStting, tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -91,7 +87,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", ) - assert_matches_type(TLSCertificatesAndHostnamesSettingObjectDelete, tls, path=["response"]) + assert_matches_type(HostnameSettingDelete, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +101,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(TLSCertificatesAndHostnamesSettingObjectDelete, tls, path=["response"]) + assert_matches_type(HostnameSettingDelete, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +115,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(TLSCertificatesAndHostnamesSettingObjectDelete, tls, path=["response"]) + assert_matches_type(HostnameSettingDelete, tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -199,7 +195,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(TLSCertificatesAndHostnamesSettingObject, tls, path=["response"]) + assert_matches_type(HostnameStting, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -214,7 +210,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(TLSCertificatesAndHostnamesSettingObject, tls, path=["response"]) + assert_matches_type(HostnameStting, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -229,7 +225,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(TLSCertificatesAndHostnamesSettingObject, tls, path=["response"]) + assert_matches_type(HostnameStting, tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -260,7 +256,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", ) - assert_matches_type(TLSCertificatesAndHostnamesSettingObjectDelete, tls, path=["response"]) + assert_matches_type(HostnameSettingDelete, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -274,7 +270,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(TLSCertificatesAndHostnamesSettingObjectDelete, tls, path=["response"]) + assert_matches_type(HostnameSettingDelete, tls, path=["response"]) @pytest.mark.skip() @parametrize @@ -288,7 +284,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(TLSCertificatesAndHostnamesSettingObjectDelete, tls, path=["response"]) + assert_matches_type(HostnameSettingDelete, tls, path=["response"]) assert cast(Any, response.is_closed) is True