diff --git a/api.md b/api.md index bbbeb5a3bad..503c59f2ae6 100644 --- a/api.md +++ b/api.md @@ -3080,23 +3080,23 @@ Methods: Types: ```python -from cloudflare.types import RulesetsRulesetResponse, RulesetsRulesetsResponse, RulesetListResponse +from cloudflare.types import Ruleset, RulesetListResponse ``` Methods: -- client.rulesets.create(\*, account_id, zone_id, \*\*params) -> RulesetsRulesetResponse -- client.rulesets.update(ruleset_id, \*, account_id, zone_id, \*\*params) -> RulesetsRulesetResponse +- client.rulesets.create(\*, account_id, zone_id, \*\*params) -> Ruleset +- client.rulesets.update(ruleset_id, \*, account_id, zone_id, \*\*params) -> Ruleset - client.rulesets.list(\*, account_id, zone_id) -> SyncSinglePage[RulesetListResponse] - client.rulesets.delete(ruleset_id, \*, account_id, zone_id) -> None -- client.rulesets.get(ruleset_id, \*, account_id, zone_id) -> RulesetsRulesetResponse +- client.rulesets.get(ruleset_id, \*, account_id, zone_id) -> Ruleset ## Phases Methods: -- client.rulesets.phases.update(ruleset_phase, \*, account_id, zone_id, \*\*params) -> RulesetsRulesetResponse -- client.rulesets.phases.get(ruleset_phase, \*, account_id, zone_id) -> RulesetsRulesetResponse +- client.rulesets.phases.update(ruleset_phase, \*, account_id, zone_id, \*\*params) -> Ruleset +- client.rulesets.phases.get(ruleset_phase, \*, account_id, zone_id) -> Ruleset ### Versions @@ -3109,15 +3109,15 @@ from cloudflare.types.rulesets.phases import VersionListResponse Methods: - client.rulesets.phases.versions.list(ruleset_phase, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] -- client.rulesets.phases.versions.get(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> RulesetsRulesetResponse +- client.rulesets.phases.versions.get(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> Ruleset ## Rules Methods: -- client.rulesets.rules.create(ruleset_id, \*, account_id, zone_id, \*\*params) -> RulesetsRulesetResponse -- client.rulesets.rules.delete(rule_id, \*, ruleset_id, account_id, zone_id) -> RulesetsRulesetResponse -- client.rulesets.rules.edit(rule_id, \*, ruleset_id, account_id, zone_id, \*\*params) -> RulesetsRulesetResponse +- client.rulesets.rules.create(ruleset_id, \*, account_id, zone_id, \*\*params) -> Ruleset +- client.rulesets.rules.delete(rule_id, \*, ruleset_id, account_id, zone_id) -> Ruleset +- client.rulesets.rules.edit(rule_id, \*, ruleset_id, account_id, zone_id, \*\*params) -> Ruleset ## Versions @@ -3131,13 +3131,13 @@ Methods: - client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] - client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None -- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> RulesetsRulesetResponse +- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> Ruleset ### ByTag Methods: -- client.rulesets.versions.by_tag.get(rule_tag, \*, account_id, ruleset_id, ruleset_version) -> RulesetsRulesetResponse +- client.rulesets.versions.by_tag.get(rule_tag, \*, account_id, ruleset_id, ruleset_version) -> Ruleset # URLNormalization @@ -4143,7 +4143,7 @@ Methods: Types: ```python -from cloudflare.types.request_tracers import Trace, TraceCreateResponse +from cloudflare.types.request_tracers import Trace, TraceItem, TraceCreateResponse ``` Methods: @@ -5776,7 +5776,13 @@ Methods: - client.challenges.widgets.get(sitekey, \*, account_id) -> Optional - client.challenges.widgets.rotate_secret(sitekey, \*, account_id, \*\*params) -> Optional -# Hyperdrive +# HyperdriveResource + +Types: + +```python +from cloudflare.types import Hyperdrive +``` ## Configs @@ -5784,7 +5790,6 @@ Types: ```python from cloudflare.types.hyperdrive import ( - Hyperdrive, ConfigCreateResponse, ConfigUpdateResponse, ConfigListResponse, diff --git a/mypy.ini b/mypy.ini index 52065c456a8..1df17ff1948 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,7 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|src/cloudflare/resources/workers/ai\.py|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py)$ +exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py|src/cloudflare/resources/workers/ai\.py)$ strict_equality = True implicit_reexport = True diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index dfb824979f7..8951d5319e1 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -114,7 +114,7 @@ class Cloudflare(SyncAPIClient): workers_for_platforms: resources.WorkersForPlatforms zero_trust: resources.ZeroTrust challenges: resources.Challenges - hyperdrive: resources.Hyperdrive + hyperdrive: resources.HyperdriveResource rum: resources.RUM vectorize: resources.Vectorize url_scanner: resources.URLScanner @@ -267,7 +267,7 @@ def __init__( self.workers_for_platforms = resources.WorkersForPlatforms(self) self.zero_trust = resources.ZeroTrust(self) self.challenges = resources.Challenges(self) - self.hyperdrive = resources.Hyperdrive(self) + self.hyperdrive = resources.HyperdriveResource(self) self.rum = resources.RUM(self) self.vectorize = resources.Vectorize(self) self.url_scanner = resources.URLScanner(self) @@ -525,7 +525,7 @@ class AsyncCloudflare(AsyncAPIClient): workers_for_platforms: resources.AsyncWorkersForPlatforms zero_trust: resources.AsyncZeroTrust challenges: resources.AsyncChallenges - hyperdrive: resources.AsyncHyperdrive + hyperdrive: resources.AsyncHyperdriveResource rum: resources.AsyncRUM vectorize: resources.AsyncVectorize url_scanner: resources.AsyncURLScanner @@ -678,7 +678,7 @@ def __init__( self.workers_for_platforms = resources.AsyncWorkersForPlatforms(self) self.zero_trust = resources.AsyncZeroTrust(self) self.challenges = resources.AsyncChallenges(self) - self.hyperdrive = resources.AsyncHyperdrive(self) + self.hyperdrive = resources.AsyncHyperdriveResource(self) self.rum = resources.AsyncRUM(self) self.vectorize = resources.AsyncVectorize(self) self.url_scanner = resources.AsyncURLScanner(self) @@ -937,7 +937,7 @@ def __init__(self, client: Cloudflare) -> None: self.workers_for_platforms = resources.WorkersForPlatformsWithRawResponse(client.workers_for_platforms) self.zero_trust = resources.ZeroTrustWithRawResponse(client.zero_trust) self.challenges = resources.ChallengesWithRawResponse(client.challenges) - self.hyperdrive = resources.HyperdriveWithRawResponse(client.hyperdrive) + self.hyperdrive = resources.HyperdriveResourceWithRawResponse(client.hyperdrive) self.rum = resources.RUMWithRawResponse(client.rum) self.vectorize = resources.VectorizeWithRawResponse(client.vectorize) self.url_scanner = resources.URLScannerWithRawResponse(client.url_scanner) @@ -1027,7 +1027,7 @@ def __init__(self, client: AsyncCloudflare) -> None: self.workers_for_platforms = resources.AsyncWorkersForPlatformsWithRawResponse(client.workers_for_platforms) self.zero_trust = resources.AsyncZeroTrustWithRawResponse(client.zero_trust) self.challenges = resources.AsyncChallengesWithRawResponse(client.challenges) - self.hyperdrive = resources.AsyncHyperdriveWithRawResponse(client.hyperdrive) + self.hyperdrive = resources.AsyncHyperdriveResourceWithRawResponse(client.hyperdrive) self.rum = resources.AsyncRUMWithRawResponse(client.rum) self.vectorize = resources.AsyncVectorizeWithRawResponse(client.vectorize) self.url_scanner = resources.AsyncURLScannerWithRawResponse(client.url_scanner) @@ -1117,7 +1117,7 @@ def __init__(self, client: Cloudflare) -> None: self.workers_for_platforms = resources.WorkersForPlatformsWithStreamingResponse(client.workers_for_platforms) self.zero_trust = resources.ZeroTrustWithStreamingResponse(client.zero_trust) self.challenges = resources.ChallengesWithStreamingResponse(client.challenges) - self.hyperdrive = resources.HyperdriveWithStreamingResponse(client.hyperdrive) + self.hyperdrive = resources.HyperdriveResourceWithStreamingResponse(client.hyperdrive) self.rum = resources.RUMWithStreamingResponse(client.rum) self.vectorize = resources.VectorizeWithStreamingResponse(client.vectorize) self.url_scanner = resources.URLScannerWithStreamingResponse(client.url_scanner) @@ -1213,7 +1213,7 @@ def __init__(self, client: AsyncCloudflare) -> None: ) self.zero_trust = resources.AsyncZeroTrustWithStreamingResponse(client.zero_trust) self.challenges = resources.AsyncChallengesWithStreamingResponse(client.challenges) - self.hyperdrive = resources.AsyncHyperdriveWithStreamingResponse(client.hyperdrive) + self.hyperdrive = resources.AsyncHyperdriveResourceWithStreamingResponse(client.hyperdrive) self.rum = resources.AsyncRUMWithStreamingResponse(client.rum) self.vectorize = resources.AsyncVectorizeWithStreamingResponse(client.vectorize) self.url_scanner = resources.AsyncURLScannerWithStreamingResponse(client.url_scanner) diff --git a/src/cloudflare/resources/__init__.py b/src/cloudflare/resources/__init__.py index e9596573a34..84e182ac364 100644 --- a/src/cloudflare/resources/__init__.py +++ b/src/cloudflare/resources/__init__.py @@ -353,12 +353,12 @@ AsyncChallengesWithStreamingResponse, ) from .hyperdrive import ( - Hyperdrive, - AsyncHyperdrive, - HyperdriveWithRawResponse, - AsyncHyperdriveWithRawResponse, - HyperdriveWithStreamingResponse, - AsyncHyperdriveWithStreamingResponse, + HyperdriveResource, + AsyncHyperdriveResource, + HyperdriveResourceWithRawResponse, + AsyncHyperdriveResourceWithRawResponse, + HyperdriveResourceWithStreamingResponse, + AsyncHyperdriveResourceWithStreamingResponse, ) from .rate_plans import ( RatePlans, @@ -1044,12 +1044,12 @@ "AsyncChallengesWithRawResponse", "ChallengesWithStreamingResponse", "AsyncChallengesWithStreamingResponse", - "Hyperdrive", - "AsyncHyperdrive", - "HyperdriveWithRawResponse", - "AsyncHyperdriveWithRawResponse", - "HyperdriveWithStreamingResponse", - "AsyncHyperdriveWithStreamingResponse", + "HyperdriveResource", + "AsyncHyperdriveResource", + "HyperdriveResourceWithRawResponse", + "AsyncHyperdriveResourceWithRawResponse", + "HyperdriveResourceWithStreamingResponse", + "AsyncHyperdriveResourceWithStreamingResponse", "RUM", "AsyncRUM", "RUMWithRawResponse", diff --git a/src/cloudflare/resources/hyperdrive/__init__.py b/src/cloudflare/resources/hyperdrive/__init__.py index 0b028a42f00..f83f2db969d 100644 --- a/src/cloudflare/resources/hyperdrive/__init__.py +++ b/src/cloudflare/resources/hyperdrive/__init__.py @@ -9,12 +9,12 @@ AsyncConfigsWithStreamingResponse, ) from .hyperdrive import ( - Hyperdrive, - AsyncHyperdrive, - HyperdriveWithRawResponse, - AsyncHyperdriveWithRawResponse, - HyperdriveWithStreamingResponse, - AsyncHyperdriveWithStreamingResponse, + HyperdriveResource, + AsyncHyperdriveResource, + HyperdriveResourceWithRawResponse, + AsyncHyperdriveResourceWithRawResponse, + HyperdriveResourceWithStreamingResponse, + AsyncHyperdriveResourceWithStreamingResponse, ) __all__ = [ @@ -24,10 +24,10 @@ "AsyncConfigsWithRawResponse", "ConfigsWithStreamingResponse", "AsyncConfigsWithStreamingResponse", - "Hyperdrive", - "AsyncHyperdrive", - "HyperdriveWithRawResponse", - "AsyncHyperdriveWithRawResponse", - "HyperdriveWithStreamingResponse", - "AsyncHyperdriveWithStreamingResponse", + "HyperdriveResource", + "AsyncHyperdriveResource", + "HyperdriveResourceWithRawResponse", + "AsyncHyperdriveResourceWithRawResponse", + "HyperdriveResourceWithStreamingResponse", + "AsyncHyperdriveResourceWithStreamingResponse", ] diff --git a/src/cloudflare/resources/hyperdrive/hyperdrive.py b/src/cloudflare/resources/hyperdrive/hyperdrive.py index e756a012bc1..0f2abb955fa 100644 --- a/src/cloudflare/resources/hyperdrive/hyperdrive.py +++ b/src/cloudflare/resources/hyperdrive/hyperdrive.py @@ -13,39 +13,39 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -__all__ = ["Hyperdrive", "AsyncHyperdrive"] +__all__ = ["HyperdriveResource", "AsyncHyperdriveResource"] -class Hyperdrive(SyncAPIResource): +class HyperdriveResource(SyncAPIResource): @cached_property def configs(self) -> Configs: return Configs(self._client) @cached_property - def with_raw_response(self) -> HyperdriveWithRawResponse: - return HyperdriveWithRawResponse(self) + def with_raw_response(self) -> HyperdriveResourceWithRawResponse: + return HyperdriveResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> HyperdriveWithStreamingResponse: - return HyperdriveWithStreamingResponse(self) + def with_streaming_response(self) -> HyperdriveResourceWithStreamingResponse: + return HyperdriveResourceWithStreamingResponse(self) -class AsyncHyperdrive(AsyncAPIResource): +class AsyncHyperdriveResource(AsyncAPIResource): @cached_property def configs(self) -> AsyncConfigs: return AsyncConfigs(self._client) @cached_property - def with_raw_response(self) -> AsyncHyperdriveWithRawResponse: - return AsyncHyperdriveWithRawResponse(self) + def with_raw_response(self) -> AsyncHyperdriveResourceWithRawResponse: + return AsyncHyperdriveResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncHyperdriveWithStreamingResponse: - return AsyncHyperdriveWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncHyperdriveResourceWithStreamingResponse: + return AsyncHyperdriveResourceWithStreamingResponse(self) -class HyperdriveWithRawResponse: - def __init__(self, hyperdrive: Hyperdrive) -> None: +class HyperdriveResourceWithRawResponse: + def __init__(self, hyperdrive: HyperdriveResource) -> None: self._hyperdrive = hyperdrive @cached_property @@ -53,8 +53,8 @@ def configs(self) -> ConfigsWithRawResponse: return ConfigsWithRawResponse(self._hyperdrive.configs) -class AsyncHyperdriveWithRawResponse: - def __init__(self, hyperdrive: AsyncHyperdrive) -> None: +class AsyncHyperdriveResourceWithRawResponse: + def __init__(self, hyperdrive: AsyncHyperdriveResource) -> None: self._hyperdrive = hyperdrive @cached_property @@ -62,8 +62,8 @@ def configs(self) -> AsyncConfigsWithRawResponse: return AsyncConfigsWithRawResponse(self._hyperdrive.configs) -class HyperdriveWithStreamingResponse: - def __init__(self, hyperdrive: Hyperdrive) -> None: +class HyperdriveResourceWithStreamingResponse: + def __init__(self, hyperdrive: HyperdriveResource) -> None: self._hyperdrive = hyperdrive @cached_property @@ -71,8 +71,8 @@ def configs(self) -> ConfigsWithStreamingResponse: return ConfigsWithStreamingResponse(self._hyperdrive.configs) -class AsyncHyperdriveWithStreamingResponse: - def __init__(self, hyperdrive: AsyncHyperdrive) -> None: +class AsyncHyperdriveResourceWithStreamingResponse: + def __init__(self, hyperdrive: AsyncHyperdriveResource) -> None: self._hyperdrive = hyperdrive @cached_property diff --git a/src/cloudflare/resources/rulesets/phases/phases.py b/src/cloudflare/resources/rulesets/phases/phases.py index b034e28fe16..f1098a71bff 100644 --- a/src/cloudflare/resources/rulesets/phases/phases.py +++ b/src/cloudflare/resources/rulesets/phases/phases.py @@ -7,7 +7,7 @@ import httpx -from ....types import RulesetsRulesetResponse +from ....types import Ruleset from .versions import ( Versions, AsyncVersions, @@ -118,7 +118,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an account or zone entry point ruleset, creating a new version. @@ -186,7 +186,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) def get( @@ -225,7 +225,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches the latest version of the account or zone entry point ruleset for a given phase. @@ -271,7 +271,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @@ -355,7 +355,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an account or zone entry point ruleset, creating a new version. @@ -423,7 +423,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) async def get( @@ -462,7 +462,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches the latest version of the account or zone entry point ruleset for a given phase. @@ -508,7 +508,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) diff --git a/src/cloudflare/resources/rulesets/phases/versions.py b/src/cloudflare/resources/rulesets/phases/versions.py index 88d2733058d..6dbbb398f8c 100644 --- a/src/cloudflare/resources/rulesets/phases/versions.py +++ b/src/cloudflare/resources/rulesets/phases/versions.py @@ -7,7 +7,7 @@ import httpx -from ....types import RulesetsRulesetResponse +from ....types import Ruleset from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -155,7 +155,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches a specific version of an account or zone entry point ruleset. @@ -204,7 +204,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @@ -335,7 +335,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches a specific version of an account or zone entry point ruleset. @@ -384,7 +384,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index c7c92424969..d9135563a66 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -7,7 +7,7 @@ import httpx -from ...types import RulesetsRulesetResponse +from ...types import Ruleset from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( required_args, @@ -61,7 +61,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -121,7 +121,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -181,7 +181,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -241,7 +241,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -304,7 +304,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not account_id: @@ -344,7 +344,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) def delete( @@ -360,7 +360,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Deletes an existing rule from an account or zone ruleset. @@ -409,7 +409,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @overload @@ -434,7 +434,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -495,7 +495,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -556,7 +556,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -617,7 +617,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -682,7 +682,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not rule_id: @@ -724,7 +724,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @@ -758,7 +758,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -818,7 +818,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -878,7 +878,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -938,7 +938,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """Adds a new rule to an account or zone ruleset. The rule will be added to the end @@ -1001,7 +1001,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not account_id: @@ -1041,7 +1041,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) async def delete( @@ -1057,7 +1057,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Deletes an existing rule from an account or zone ruleset. @@ -1106,7 +1106,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @overload @@ -1131,7 +1131,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -1192,7 +1192,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -1253,7 +1253,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -1314,7 +1314,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an existing rule in an account or zone ruleset. @@ -1379,7 +1379,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not rule_id: @@ -1421,7 +1421,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index 987edf37a38..f57071173b4 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -23,12 +23,7 @@ PhasesWithStreamingResponse, AsyncPhasesWithStreamingResponse, ) -from ...types import ( - RulesetListResponse, - RulesetsRulesetResponse, - ruleset_create_params, - ruleset_update_params, -) +from ...types import Ruleset, RulesetListResponse, ruleset_create_params, ruleset_update_params from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ..._utils import ( maybe_transform, @@ -123,7 +118,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Creates a ruleset. @@ -184,7 +179,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) def update( @@ -230,7 +225,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an account or zone ruleset, creating a new version. @@ -298,7 +293,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) def list( @@ -422,7 +417,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches the latest version of an account or zone ruleset. @@ -467,7 +462,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @@ -532,7 +527,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Creates a ruleset. @@ -593,7 +588,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) async def update( @@ -639,7 +634,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Updates an account or zone ruleset, creating a new version. @@ -707,7 +702,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) def list( @@ -831,7 +826,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches the latest version of an account or zone ruleset. @@ -876,7 +871,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) diff --git a/src/cloudflare/resources/rulesets/versions/by_tag.py b/src/cloudflare/resources/rulesets/versions/by_tag.py index 298651cddab..227d92f4b37 100644 --- a/src/cloudflare/resources/rulesets/versions/by_tag.py +++ b/src/cloudflare/resources/rulesets/versions/by_tag.py @@ -6,7 +6,7 @@ import httpx -from ....types import RulesetsRulesetResponse +from ....types import Ruleset from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -46,7 +46,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches the rules of a managed account ruleset version for a given tag. @@ -84,7 +84,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @@ -110,7 +110,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches the rules of a managed account ruleset version for a given tag. @@ -148,7 +148,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) diff --git a/src/cloudflare/resources/rulesets/versions/versions.py b/src/cloudflare/resources/rulesets/versions/versions.py index 6722ae11b41..70590d82022 100644 --- a/src/cloudflare/resources/rulesets/versions/versions.py +++ b/src/cloudflare/resources/rulesets/versions/versions.py @@ -14,7 +14,7 @@ ByTagWithStreamingResponse, AsyncByTagWithStreamingResponse, ) -from ....types import RulesetsRulesetResponse +from ....types import Ruleset from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -180,7 +180,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches a specific version of an account or zone ruleset. @@ -229,7 +229,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) @@ -378,7 +378,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RulesetsRulesetResponse: + ) -> Ruleset: """ Fetches a specific version of an account or zone ruleset. @@ -427,7 +427,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + cast_to=cast(Type[Ruleset], ResultWrapper[Ruleset]), ) diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index 2a1eba444ba..9d99cc14a2a 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -7,6 +7,7 @@ from .dnssec import DNSSEC as DNSSEC from .shared import ErrorData as ErrorData from .account import Account as Account +from .ruleset import Ruleset as Ruleset from .snippet import Snippet as Snippet from .calls_app import CallsApp as CallsApp from .membership import Membership as Membership @@ -102,7 +103,6 @@ from .intel_phishing_url_submit import IntelPhishingURLSubmit as IntelPhishingURLSubmit from .load_balancer_edit_params import LoadBalancerEditParams as LoadBalancerEditParams from .page_shield_update_params import PageShieldUpdateParams as PageShieldUpdateParams -from .rulesets_ruleset_response import RulesetsRulesetResponse as RulesetsRulesetResponse from .speed_schedule_get_params import SpeedScheduleGetParams as SpeedScheduleGetParams from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .url_scanner_scan_response import URLScannerScanResponse as URLScannerScanResponse @@ -112,7 +112,6 @@ from .membership_update_response import MembershipUpdateResponse as MembershipUpdateResponse from .rate_limit_create_response import RateLimitCreateResponse as RateLimitCreateResponse from .rate_limit_delete_response import RateLimitDeleteResponse as RateLimitDeleteResponse -from .rulesets_rulesets_response import RulesetsRulesetsResponse as RulesetsRulesetsResponse from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams diff --git a/src/cloudflare/types/hyperdrive/__init__.py b/src/cloudflare/types/hyperdrive/__init__.py index eb73e1cbd1f..0891cd295ba 100644 --- a/src/cloudflare/types/hyperdrive/__init__.py +++ b/src/cloudflare/types/hyperdrive/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .hyperdrive import Hyperdrive as Hyperdrive from .config_edit_params import ConfigEditParams as ConfigEditParams from .config_get_response import ConfigGetResponse as ConfigGetResponse from .config_create_params import ConfigCreateParams as ConfigCreateParams diff --git a/src/cloudflare/types/hyperdrive/hyperdrive.py b/src/cloudflare/types/hyperdrive/hyperdrive.py new file mode 100644 index 00000000000..320e9948ce3 --- /dev/null +++ b/src/cloudflare/types/hyperdrive/hyperdrive.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["Hyperdrive"] + + +class Hyperdrive(BaseModel): + id: Optional[str] = None + """Identifier""" diff --git a/src/cloudflare/types/request_tracers/__init__.py b/src/cloudflare/types/request_tracers/__init__.py index a1d489d78fa..40a59470259 100644 --- a/src/cloudflare/types/request_tracers/__init__.py +++ b/src/cloudflare/types/request_tracers/__init__.py @@ -3,5 +3,6 @@ from __future__ import annotations from .trace import Trace as Trace +from .trace_item import TraceItem as TraceItem from .trace_create_params import TraceCreateParams as TraceCreateParams from .trace_create_response import TraceCreateResponse as TraceCreateResponse diff --git a/src/cloudflare/types/request_tracers/trace.py b/src/cloudflare/types/request_tracers/trace.py index 32e14ff128c..4687762c7f8 100644 --- a/src/cloudflare/types/request_tracers/trace.py +++ b/src/cloudflare/types/request_tracers/trace.py @@ -2,48 +2,10 @@ from __future__ import annotations -from typing import List, Optional +from typing import List -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel +__all__ = ["Trace"] -__all__ = ["Trace", "TraceItem"] +Trace = List["TraceItem"] - -class TraceItem(BaseModel): - action: Optional[str] = None - """If step type is rule, then action performed by this rule""" - - action_parameters: Optional[object] = None - """If step type is rule, then action parameters of this rule as JSON""" - - description: Optional[str] = None - """If step type is rule or ruleset, the description of this entity""" - - expression: Optional[str] = None - """If step type is rule, then expression used to match for this rule""" - - kind: Optional[str] = None - """If step type is ruleset, then kind of this ruleset""" - - matched: Optional[bool] = None - """Whether tracing step affected tracing request/response""" - - name: Optional[str] = None - """If step type is ruleset, then name of this ruleset""" - - step_name: Optional[str] = None - """Tracing step identifying name""" - - trace: Optional[Trace] = None - - type: Optional[str] = None - """Tracing step type""" - - -Trace = List[TraceItem] - -if PYDANTIC_V2: - TraceItem.model_rebuild() -else: - TraceItem.update_forward_refs() # type: ignore +from .trace_item import TraceItem diff --git a/src/cloudflare/types/request_tracers/trace_item.py b/src/cloudflare/types/request_tracers/trace_item.py new file mode 100644 index 00000000000..2830764115e --- /dev/null +++ b/src/cloudflare/types/request_tracers/trace_item.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel + +__all__ = ["TraceItem"] + + +class TraceItem(BaseModel): + action: Optional[str] = None + """If step type is rule, then action performed by this rule""" + + action_parameters: Optional[object] = None + """If step type is rule, then action parameters of this rule as JSON""" + + description: Optional[str] = None + """If step type is rule or ruleset, the description of this entity""" + + expression: Optional[str] = None + """If step type is rule, then expression used to match for this rule""" + + kind: Optional[str] = None + """If step type is ruleset, then kind of this ruleset""" + + matched: Optional[bool] = None + """Whether tracing step affected tracing request/response""" + + name: Optional[str] = None + """If step type is ruleset, then name of this ruleset""" + + step_name: Optional[str] = None + """Tracing step identifying name""" + + trace: Optional["Trace"] = None + + type: Optional[str] = None + """Tracing step type""" + + +from .trace import Trace + +if PYDANTIC_V2: + TraceItem.model_rebuild() +else: + TraceItem.update_forward_refs() # type: ignore diff --git a/src/cloudflare/types/rulesets_ruleset_response.py b/src/cloudflare/types/ruleset.py similarity index 99% rename from src/cloudflare/types/rulesets_ruleset_response.py rename to src/cloudflare/types/ruleset.py index c3f54637f5d..5bc71c6f377 100644 --- a/src/cloudflare/types/rulesets_ruleset_response.py +++ b/src/cloudflare/types/ruleset.py @@ -7,7 +7,7 @@ from .._models import BaseModel __all__ = [ - "RulesetsRulesetResponse", + "Ruleset", "Rule", "RuleRulesetsBlockRule", "RuleRulesetsBlockRuleActionParameters", @@ -343,7 +343,7 @@ class RuleRulesetsSkipRule(BaseModel): Rule = Union[RuleRulesetsBlockRule, RuleRulesetsExecuteRule, RuleRulesetsLogRule, RuleRulesetsSkipRule] -class RulesetsRulesetResponse(BaseModel): +class Ruleset(BaseModel): id: str """The unique ID of the ruleset.""" diff --git a/src/cloudflare/types/rulesets_rulesets_response.py b/src/cloudflare/types/rulesets_rulesets_response.py deleted file mode 100644 index f5f3bfabd0b..00000000000 --- a/src/cloudflare/types/rulesets_rulesets_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["RulesetsRulesetsResponse", "RulesetsRulesetsResponseItem"] - - -class RulesetsRulesetsResponseItem(BaseModel): - kind: Literal["managed", "custom", "root", "zone"] - """The kind of the ruleset.""" - - name: str - """The human-readable name of the ruleset.""" - - phase: Literal[ - "ddos_l4", - "ddos_l7", - "http_config_settings", - "http_custom_errors", - "http_log_custom_fields", - "http_ratelimit", - "http_request_cache_settings", - "http_request_dynamic_redirect", - "http_request_firewall_custom", - "http_request_firewall_managed", - "http_request_late_transform", - "http_request_origin", - "http_request_redirect", - "http_request_sanitize", - "http_request_sbfm", - "http_request_select_configuration", - "http_request_transform", - "http_response_compression", - "http_response_firewall_managed", - "http_response_headers_transform", - "magic_transit", - "magic_transit_ids_managed", - "magic_transit_managed", - ] - """The phase of the ruleset.""" - - id: Optional[str] = None - """The unique ID of the ruleset.""" - - description: Optional[str] = None - """An informative description of the ruleset.""" - - last_updated: Optional[datetime] = None - """The timestamp of when the ruleset was last modified.""" - - version: Optional[str] = None - """The version of the ruleset.""" - - -RulesetsRulesetsResponse = List[RulesetsRulesetsResponseItem] diff --git a/tests/api_resources/rulesets/phases/test_versions.py b/tests/api_resources/rulesets/phases/test_versions.py index 796957cd2b1..621104eb9da 100644 --- a/tests/api_resources/rulesets/phases/test_versions.py +++ b/tests/api_resources/rulesets/phases/test_versions.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import RulesetsRulesetResponse +from cloudflare.types import Ruleset from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.rulesets.phases import VersionListResponse @@ -95,7 +95,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +121,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" version = response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -136,7 +136,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) assert cast(Any, response.is_closed) is True @@ -247,7 +247,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -258,7 +258,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -273,7 +273,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" version = await response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -288,7 +288,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = await response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rulesets/test_phases.py b/tests/api_resources/rulesets/test_phases.py index 23240617708..114168a5d5e 100644 --- a/tests/api_resources/rulesets/test_phases.py +++ b/tests/api_resources/rulesets/test_phases.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import RulesetsRulesetResponse +from cloudflare.types import Ruleset base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +27,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -92,7 +92,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="My ruleset", phase="http_request_firewall_custom", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -108,7 +108,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" phase = response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -124,7 +124,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" phase = response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) assert cast(Any, response.is_closed) is True @@ -157,7 +157,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,7 +167,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -181,7 +181,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" phase = response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -195,7 +195,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" phase = response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) assert cast(Any, response.is_closed) is True @@ -230,7 +230,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -295,7 +295,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="My ruleset", phase="http_request_firewall_custom", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +311,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" phase = await response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -327,7 +327,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" phase = await response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) assert cast(Any, response.is_closed) is True @@ -360,7 +360,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -370,7 +370,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -384,7 +384,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" phase = await response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) @pytest.mark.skip() @parametrize @@ -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" phase = await response.parse() - assert_matches_type(RulesetsRulesetResponse, phase, path=["response"]) + assert_matches_type(Ruleset, phase, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index 51ec61ff352..b508825c027 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import RulesetsRulesetResponse +from cloudflare.types import Ruleset base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -49,7 +49,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -77,7 +77,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -156,7 +156,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -170,7 +170,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -184,7 +184,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -220,7 +220,7 @@ def test_method_create_overload_3(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -238,7 +238,7 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -252,7 +252,7 @@ def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -266,7 +266,7 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -302,7 +302,7 @@ def test_method_create_overload_4(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +326,7 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -340,7 +340,7 @@ def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -354,7 +354,7 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +391,7 @@ def test_method_delete(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -402,7 +402,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -417,7 +417,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" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -432,7 +432,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -480,7 +480,7 @@ def test_method_edit_overload_1(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -505,7 +505,7 @@ def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> Non logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -520,7 +520,7 @@ def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -535,7 +535,7 @@ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -583,7 +583,7 @@ def test_method_edit_overload_2(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -627,7 +627,7 @@ def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> Non logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -642,7 +642,7 @@ def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -657,7 +657,7 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -705,7 +705,7 @@ def test_method_edit_overload_3(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -724,7 +724,7 @@ def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> Non logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -739,7 +739,7 @@ def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -754,7 +754,7 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -802,7 +802,7 @@ def test_method_edit_overload_4(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -827,7 +827,7 @@ def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> Non logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -842,7 +842,7 @@ def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -857,7 +857,7 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -908,7 +908,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -932,7 +932,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -946,7 +946,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -960,7 +960,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -996,7 +996,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1039,7 +1039,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1053,7 +1053,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1067,7 +1067,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1103,7 +1103,7 @@ async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1121,7 +1121,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1135,7 +1135,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1149,7 +1149,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1185,7 +1185,7 @@ async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1209,7 +1209,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1223,7 +1223,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1237,7 +1237,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1274,7 +1274,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1285,7 +1285,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1300,7 +1300,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" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1315,7 +1315,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1363,7 +1363,7 @@ async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> No account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1388,7 +1388,7 @@ async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncC logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1403,7 +1403,7 @@ async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1418,7 +1418,7 @@ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1466,7 +1466,7 @@ async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> No account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1510,7 +1510,7 @@ async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncC logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1525,7 +1525,7 @@ async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1540,7 +1540,7 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1588,7 +1588,7 @@ async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> No account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1607,7 +1607,7 @@ async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncC logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1622,7 +1622,7 @@ async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1637,7 +1637,7 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1685,7 +1685,7 @@ async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> No account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1710,7 +1710,7 @@ async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncC logging={"enabled": True}, ref="my_ref", ) - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1725,7 +1725,7 @@ async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1740,7 +1740,7 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + assert_matches_type(Ruleset, rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rulesets/test_versions.py b/tests/api_resources/rulesets/test_versions.py index a8812cc8df4..59d53feb980 100644 --- a/tests/api_resources/rulesets/test_versions.py +++ b/tests/api_resources/rulesets/test_versions.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import RulesetsRulesetResponse +from cloudflare.types import Ruleset from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.rulesets import VersionListResponse @@ -191,7 +191,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -202,7 +202,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -217,7 +217,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" version = response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -232,7 +232,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) assert cast(Any, response.is_closed) is True @@ -447,7 +447,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -458,7 +458,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -473,7 +473,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" version = await response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) @pytest.mark.skip() @parametrize @@ -488,7 +488,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = await response.parse() - assert_matches_type(RulesetsRulesetResponse, version, path=["response"]) + assert_matches_type(Ruleset, version, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rulesets/versions/test_by_tag.py b/tests/api_resources/rulesets/versions/test_by_tag.py index 026deb6874f..e3632bf6314 100644 --- a/tests/api_resources/rulesets/versions/test_by_tag.py +++ b/tests/api_resources/rulesets/versions/test_by_tag.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import RulesetsRulesetResponse +from cloudflare.types import Ruleset base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +26,7 @@ def test_method_get(self, client: Cloudflare) -> None: ruleset_id="2f2feab2026849078ba485f918791bdc", ruleset_version="1", ) - assert_matches_type(RulesetsRulesetResponse, by_tag, path=["response"]) + assert_matches_type(Ruleset, by_tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,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" by_tag = response.parse() - assert_matches_type(RulesetsRulesetResponse, by_tag, path=["response"]) + assert_matches_type(Ruleset, by_tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +56,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" by_tag = response.parse() - assert_matches_type(RulesetsRulesetResponse, by_tag, path=["response"]) + assert_matches_type(Ruleset, by_tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -108,7 +108,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: ruleset_id="2f2feab2026849078ba485f918791bdc", ruleset_version="1", ) - assert_matches_type(RulesetsRulesetResponse, by_tag, path=["response"]) + assert_matches_type(Ruleset, by_tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -123,7 +123,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" by_tag = await response.parse() - assert_matches_type(RulesetsRulesetResponse, by_tag, path=["response"]) + assert_matches_type(Ruleset, by_tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -138,7 +138,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" by_tag = await response.parse() - assert_matches_type(RulesetsRulesetResponse, by_tag, path=["response"]) + assert_matches_type(Ruleset, by_tag, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_rulesets.py b/tests/api_resources/test_rulesets.py index 67251b5ccf2..285259542bf 100644 --- a/tests/api_resources/test_rulesets.py +++ b/tests/api_resources/test_rulesets.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import RulesetListResponse, RulesetsRulesetResponse +from cloudflare.types import Ruleset, RulesetListResponse from cloudflare.pagination import SyncSinglePage, AsyncSinglePage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -92,7 +92,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: zone_id="string", description="My ruleset to execute managed rulesets", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -109,7 +109,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" ruleset = response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -163,7 +163,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -228,7 +228,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="My ruleset", phase="http_request_firewall_custom", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -244,7 +244,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" ruleset = response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -260,7 +260,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -437,7 +437,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -447,7 +447,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -461,7 +461,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" ruleset = response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -475,7 +475,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -518,7 +518,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -581,7 +581,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare zone_id="string", description="My ruleset to execute managed rulesets", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -598,7 +598,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" ruleset = await response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -615,7 +615,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = await response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -652,7 +652,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -717,7 +717,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="My ruleset", phase="http_request_firewall_custom", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -733,7 +733,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" ruleset = await response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -749,7 +749,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = await response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -926,7 +926,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -936,7 +936,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="string", zone_id="string", ) - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -950,7 +950,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" ruleset = await response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) @pytest.mark.skip() @parametrize @@ -964,7 +964,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = await response.parse() - assert_matches_type(RulesetsRulesetResponse, ruleset, path=["response"]) + assert_matches_type(Ruleset, ruleset, path=["response"]) assert cast(Any, response.is_closed) is True