diff --git a/api.md b/api.md
index 692bfb6d3d5..6a87d7e1546 100644
--- a/api.md
+++ b/api.md
@@ -2653,7 +2653,7 @@ Methods:
Types:
```python
-from cloudflare.types.api_gateway import DiscoveryOperation, DiscoveryGetResponse
+from cloudflare.types.api_gateway import DiscoveryGetResponse
```
Methods:
@@ -2665,12 +2665,16 @@ Methods:
Types:
```python
-from cloudflare.types.api_gateway.discovery import OperationBulkEditResponse, OperationEditResponse
+from cloudflare.types.api_gateway.discovery import (
+ OperationListResponse,
+ OperationBulkEditResponse,
+ OperationEditResponse,
+)
```
Methods:
-- client.api_gateway.discovery.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[DiscoveryOperation]
+- client.api_gateway.discovery.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse]
- client.api_gateway.discovery.operations.bulk_edit(\*, zone_id, \*\*params) -> OperationBulkEditResponse
- client.api_gateway.discovery.operations.edit(operation_id, \*, zone_id, \*\*params) -> OperationEditResponse
@@ -2680,7 +2684,7 @@ Types:
```python
from cloudflare.types.api_gateway import (
- APIShield,
+ APIShieldOperation,
OperationCreateResponse,
OperationListResponse,
OperationDeleteResponse,
diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py
index 1994f365d02..95a5dc74fc6 100644
--- a/src/cloudflare/resources/api_gateway/discovery/operations.py
+++ b/src/cloudflare/resources/api_gateway/discovery/operations.py
@@ -24,8 +24,8 @@
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from ...._base_client import AsyncPaginator, make_request_options
from ....types.api_gateway.discovery import operation_edit_params, operation_list_params, operation_bulk_edit_params
-from ....types.api_gateway.discovery_operation import DiscoveryOperation
from ....types.api_gateway.discovery.operation_edit_response import OperationEditResponse
+from ....types.api_gateway.discovery.operation_list_response import OperationListResponse
from ....types.api_gateway.discovery.operation_bulk_edit_response import OperationBulkEditResponse
__all__ = ["OperationsResource", "AsyncOperationsResource"]
@@ -72,7 +72,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncV4PagePaginationArray[DiscoveryOperation]:
+ ) -> SyncV4PagePaginationArray[OperationListResponse]:
"""
Retrieve the most up to date view of discovered operations
@@ -124,7 +124,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
f"/zones/{zone_id}/api_gateway/discovery/operations",
- page=SyncV4PagePaginationArray[DiscoveryOperation],
+ page=SyncV4PagePaginationArray[OperationListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -146,7 +146,7 @@ def list(
operation_list_params.OperationListParams,
),
),
- model=DiscoveryOperation,
+ model=OperationListResponse,
)
def bulk_edit(
@@ -283,7 +283,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[DiscoveryOperation, AsyncV4PagePaginationArray[DiscoveryOperation]]:
+ ) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]:
"""
Retrieve the most up to date view of discovered operations
@@ -335,7 +335,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
f"/zones/{zone_id}/api_gateway/discovery/operations",
- page=AsyncV4PagePaginationArray[DiscoveryOperation],
+ page=AsyncV4PagePaginationArray[OperationListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -357,7 +357,7 @@ def list(
operation_list_params.OperationListParams,
),
),
- model=DiscoveryOperation,
+ model=OperationListResponse,
)
async def bulk_edit(
diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py
index 4e2c044805e..5ac50872179 100644
--- a/src/cloudflare/resources/api_gateway/operations/operations.py
+++ b/src/cloudflare/resources/api_gateway/operations/operations.py
@@ -31,11 +31,12 @@
SchemaValidationResourceWithStreamingResponse,
AsyncSchemaValidationResourceWithStreamingResponse,
)
-from ....types.api_gateway import operation_get_params, operation_list_params, operation_create_params
+from ....types.api_gateway import operation_get_params, operation_list_params
from ....types.api_gateway.operation_get_response import OperationGetResponse
from ....types.api_gateway.operation_list_response import OperationListResponse
from ....types.api_gateway.operation_create_response import OperationCreateResponse
from ....types.api_gateway.operation_delete_response import OperationDeleteResponse
+from ....types.api_gateway.api_shield_operation_param import APIShieldOperationParam
from ....types.api_gateway.operation_bulk_delete_response import OperationBulkDeleteResponse
__all__ = ["OperationsResource", "AsyncOperationsResource"]
@@ -69,7 +70,7 @@ def create(
self,
*,
zone_id: str,
- body: Iterable[operation_create_params.Body],
+ body: Iterable[APIShieldOperationParam],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -100,7 +101,7 @@ def create(
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
f"/zones/{zone_id}/api_gateway/operations",
- body=maybe_transform(body, Iterable[operation_create_params.Body]),
+ body=maybe_transform(body, Iterable[APIShieldOperationParam]),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -344,7 +345,7 @@ async def create(
self,
*,
zone_id: str,
- body: Iterable[operation_create_params.Body],
+ body: Iterable[APIShieldOperationParam],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -375,7 +376,7 @@ async def create(
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
f"/zones/{zone_id}/api_gateway/operations",
- body=await async_maybe_transform(body, Iterable[operation_create_params.Body]),
+ body=await async_maybe_transform(body, Iterable[APIShieldOperationParam]),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/types/api_gateway/__init__.py b/src/cloudflare/types/api_gateway/__init__.py
index 272e71c2b78..a4f7ec8c544 100644
--- a/src/cloudflare/types/api_gateway/__init__.py
+++ b/src/cloudflare/types/api_gateway/__init__.py
@@ -4,12 +4,11 @@
from .message import Message as Message
from .settings import Settings as Settings
-from .api_shield import APIShield as APIShield
from .configuration import Configuration as Configuration
from .public_schema import PublicSchema as PublicSchema
from .schema_upload import SchemaUpload as SchemaUpload
from .schema_list_params import SchemaListParams as SchemaListParams
-from .discovery_operation import DiscoveryOperation as DiscoveryOperation
+from .api_shield_operation import APIShieldOperation as APIShieldOperation
from .operation_get_params import OperationGetParams as OperationGetParams
from .schema_list_response import SchemaListResponse as SchemaListResponse
from .operation_list_params import OperationListParams as OperationListParams
@@ -24,6 +23,7 @@
from .operation_create_response import OperationCreateResponse as OperationCreateResponse
from .operation_delete_response import OperationDeleteResponse as OperationDeleteResponse
from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams
+from .api_shield_operation_param import APIShieldOperationParam as APIShieldOperationParam
from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams
from .user_schema_delete_response import UserSchemaDeleteResponse as UserSchemaDeleteResponse
from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse
diff --git a/src/cloudflare/types/api_gateway/api_shield.py b/src/cloudflare/types/api_gateway/api_shield.py
deleted file mode 100644
index f884d96b96c..00000000000
--- a/src/cloudflare/types/api_gateway/api_shield.py
+++ /dev/null
@@ -1,227 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, TypeAlias
-
-from ..._models import BaseModel
-
-__all__ = [
- "APIShield",
- "Features",
- "FeaturesAPIShieldOperationFeatureThresholds",
- "FeaturesAPIShieldOperationFeatureThresholdsThresholds",
- "FeaturesAPIShieldOperationFeatureParameterSchemas",
- "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas",
- "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas",
- "FeaturesAPIShieldOperationFeatureAPIRouting",
- "FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervals",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95",
- "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99",
- "FeaturesAPIShieldOperationFeatureSchemaInfo",
- "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo",
- "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema",
-]
-
-
-class FeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel):
- auth_id_tokens: Optional[int] = None
- """The total number of auth-ids seen across this calculation."""
-
- data_points: Optional[int] = None
- """The number of data points used for the threshold suggestion calculation."""
-
- last_updated: Optional[datetime] = None
-
- p50: Optional[int] = None
- """The p50 quantile of requests (in period_seconds)."""
-
- p90: Optional[int] = None
- """The p90 quantile of requests (in period_seconds)."""
-
- p99: Optional[int] = None
- """The p99 quantile of requests (in period_seconds)."""
-
- period_seconds: Optional[int] = None
- """The period over which this threshold is suggested."""
-
- requests: Optional[int] = None
- """The estimated number of requests covered by these calculations."""
-
- suggested_threshold: Optional[int] = None
- """The suggested threshold in requests done by the same auth_id or period_seconds."""
-
-
-class FeaturesAPIShieldOperationFeatureThresholds(BaseModel):
- thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds] = None
-
-
-class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel):
- parameters: Optional[List[object]] = None
- """An array containing the learned parameter schemas."""
-
- responses: Optional[object] = None
- """An empty response object.
-
- This field is required to yield a valid operation schema.
- """
-
-
-class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel):
- last_updated: Optional[datetime] = None
-
- parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas] = (
- None
- )
- """An operation schema object containing a response."""
-
-
-class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel):
- parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas
-
-
-class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel):
- last_updated: Optional[datetime] = None
-
- route: Optional[str] = None
- """Target route."""
-
-
-class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel):
- api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None
- """API Routing settings on endpoint."""
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90(
- BaseModel
-):
- lower: Optional[float] = None
- """Lower bound for percentile estimate"""
-
- upper: Optional[float] = None
- """Upper bound for percentile estimate"""
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95(
- BaseModel
-):
- lower: Optional[float] = None
- """Lower bound for percentile estimate"""
-
- upper: Optional[float] = None
- """Upper bound for percentile estimate"""
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99(
- BaseModel
-):
- lower: Optional[float] = None
- """Lower bound for percentile estimate"""
-
- upper: Optional[float] = None
- """Upper bound for percentile estimate"""
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals(
- BaseModel
-):
- p90: Optional[
- FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90
- ] = None
- """Upper and lower bound for percentile estimate"""
-
- p95: Optional[
- FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95
- ] = None
- """Upper and lower bound for percentile estimate"""
-
- p99: Optional[
- FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99
- ] = None
- """Upper and lower bound for percentile estimate"""
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel):
- confidence_intervals: Optional[
- FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals
- ] = None
-
- mean: Optional[float] = None
- """Suggested threshold."""
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel):
- last_updated: Optional[datetime] = None
-
- suggested_threshold: Optional[
- FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold
- ] = None
-
-
-class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel):
- confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None
-
-
-class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel):
- id: Optional[str] = None
- """UUID"""
-
- created_at: Optional[datetime] = None
-
- is_learned: Optional[bool] = None
- """True if schema is Cloudflare-provided."""
-
- name: Optional[str] = None
- """Schema file name."""
-
-
-class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel):
- active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None
- """Schema active on endpoint."""
-
- learned_available: Optional[bool] = None
- """True if a Cloudflare-provided learned schema is available for this endpoint."""
-
- mitigation_action: Optional[Literal["none", "log", "block"]] = None
- """Action taken on requests failing validation."""
-
-
-class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel):
- schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None
-
-
-Features: TypeAlias = Union[
- FeaturesAPIShieldOperationFeatureThresholds,
- FeaturesAPIShieldOperationFeatureParameterSchemas,
- FeaturesAPIShieldOperationFeatureAPIRouting,
- FeaturesAPIShieldOperationFeatureConfidenceIntervals,
- FeaturesAPIShieldOperationFeatureSchemaInfo,
-]
-
-
-class APIShield(BaseModel):
- endpoint: str
- """
- The endpoint which can contain path parameter templates in curly braces, each
- will be replaced from left to right with {varN}, starting with {var1}, during
- insertion. This will further be Cloudflare-normalized upon insertion. See:
- https://developers.cloudflare.com/rules/normalization/how-it-works/.
- """
-
- host: str
- """RFC3986-compliant host."""
-
- last_updated: datetime
-
- method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]
- """The HTTP method used to access the endpoint."""
-
- operation_id: str
- """UUID"""
-
- features: Optional[Features] = None
diff --git a/src/cloudflare/types/api_gateway/api_shield_operation.py b/src/cloudflare/types/api_gateway/api_shield_operation.py
new file mode 100644
index 00000000000..a7c1e2c4011
--- /dev/null
+++ b/src/cloudflare/types/api_gateway/api_shield_operation.py
@@ -0,0 +1,23 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["APIShieldOperation"]
+
+
+class APIShieldOperation(BaseModel):
+ endpoint: str
+ """
+ The endpoint which can contain path parameter templates in curly braces, each
+ will be replaced from left to right with {varN}, starting with {var1}, during
+ insertion. This will further be Cloudflare-normalized upon insertion. See:
+ https://developers.cloudflare.com/rules/normalization/how-it-works/.
+ """
+
+ host: str
+ """RFC3986-compliant host."""
+
+ method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]
+ """The HTTP method used to access the endpoint."""
diff --git a/src/cloudflare/types/api_gateway/api_shield_operation_param.py b/src/cloudflare/types/api_gateway/api_shield_operation_param.py
new file mode 100644
index 00000000000..5124aa6963f
--- /dev/null
+++ b/src/cloudflare/types/api_gateway/api_shield_operation_param.py
@@ -0,0 +1,23 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["APIShieldOperationParam"]
+
+
+class APIShieldOperationParam(TypedDict, total=False):
+ endpoint: Required[str]
+ """
+ The endpoint which can contain path parameter templates in curly braces, each
+ will be replaced from left to right with {varN}, starting with {var1}, during
+ insertion. This will further be Cloudflare-normalized upon insertion. See:
+ https://developers.cloudflare.com/rules/normalization/how-it-works/.
+ """
+
+ host: Required[str]
+ """RFC3986-compliant host."""
+
+ method: Required[Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]]
+ """The HTTP method used to access the endpoint."""
diff --git a/src/cloudflare/types/api_gateway/discovery/__init__.py b/src/cloudflare/types/api_gateway/discovery/__init__.py
index 40378bcab0c..80aadd81e5a 100644
--- a/src/cloudflare/types/api_gateway/discovery/__init__.py
+++ b/src/cloudflare/types/api_gateway/discovery/__init__.py
@@ -5,5 +5,6 @@
from .operation_edit_params import OperationEditParams as OperationEditParams
from .operation_list_params import OperationListParams as OperationListParams
from .operation_edit_response import OperationEditResponse as OperationEditResponse
+from .operation_list_response import OperationListResponse as OperationListResponse
from .operation_bulk_edit_params import OperationBulkEditParams as OperationBulkEditParams
from .operation_bulk_edit_response import OperationBulkEditResponse as OperationBulkEditResponse
diff --git a/src/cloudflare/types/api_gateway/discovery_operation.py b/src/cloudflare/types/api_gateway/discovery/operation_list_response.py
similarity index 91%
rename from src/cloudflare/types/api_gateway/discovery_operation.py
rename to src/cloudflare/types/api_gateway/discovery/operation_list_response.py
index 8c3fe0a8617..98dc452c73c 100644
--- a/src/cloudflare/types/api_gateway/discovery_operation.py
+++ b/src/cloudflare/types/api_gateway/discovery/operation_list_response.py
@@ -4,9 +4,9 @@
from datetime import datetime
from typing_extensions import Literal
-from ..._models import BaseModel
+from ...._models import BaseModel
-__all__ = ["DiscoveryOperation", "Features", "FeaturesTrafficStats"]
+__all__ = ["OperationListResponse", "Features", "FeaturesTrafficStats"]
class FeaturesTrafficStats(BaseModel):
@@ -23,7 +23,7 @@ class Features(BaseModel):
traffic_stats: Optional[FeaturesTrafficStats] = None
-class DiscoveryOperation(BaseModel):
+class OperationListResponse(BaseModel):
id: str
"""UUID"""
diff --git a/src/cloudflare/types/api_gateway/operation_create_params.py b/src/cloudflare/types/api_gateway/operation_create_params.py
index dbfa97bf6e8..6a76b839b6f 100644
--- a/src/cloudflare/types/api_gateway/operation_create_params.py
+++ b/src/cloudflare/types/api_gateway/operation_create_params.py
@@ -3,29 +3,15 @@
from __future__ import annotations
from typing import Iterable
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Required, TypedDict
-__all__ = ["OperationCreateParams", "Body"]
+from .api_shield_operation_param import APIShieldOperationParam
+
+__all__ = ["OperationCreateParams"]
class OperationCreateParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""
- body: Required[Iterable[Body]]
-
-
-class Body(TypedDict, total=False):
- endpoint: Required[str]
- """
- The endpoint which can contain path parameter templates in curly braces, each
- will be replaced from left to right with {varN}, starting with {var1}, during
- insertion. This will further be Cloudflare-normalized upon insertion. See:
- https://developers.cloudflare.com/rules/normalization/how-it-works/.
- """
-
- host: Required[str]
- """RFC3986-compliant host."""
-
- method: Required[Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]]
- """The HTTP method used to access the endpoint."""
+ body: Required[Iterable[APIShieldOperationParam]]
diff --git a/src/cloudflare/types/api_gateway/operation_create_response.py b/src/cloudflare/types/api_gateway/operation_create_response.py
index 23d0751ec12..f259f867239 100644
--- a/src/cloudflare/types/api_gateway/operation_create_response.py
+++ b/src/cloudflare/types/api_gateway/operation_create_response.py
@@ -1,10 +1,239 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List
-from typing_extensions import TypeAlias
+from typing import List, Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, TypeAlias
-from .api_shield import APIShield
+from ..._models import BaseModel
-__all__ = ["OperationCreateResponse"]
+__all__ = [
+ "OperationCreateResponse",
+ "OperationCreateResponseItem",
+ "OperationCreateResponseItemFeatures",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo",
+ "OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema",
+]
-OperationCreateResponse: TypeAlias = List[APIShield]
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel):
+ auth_id_tokens: Optional[int] = None
+ """The total number of auth-ids seen across this calculation."""
+
+ data_points: Optional[int] = None
+ """The number of data points used for the threshold suggestion calculation."""
+
+ last_updated: Optional[datetime] = None
+
+ p50: Optional[int] = None
+ """The p50 quantile of requests (in period_seconds)."""
+
+ p90: Optional[int] = None
+ """The p90 quantile of requests (in period_seconds)."""
+
+ p99: Optional[int] = None
+ """The p99 quantile of requests (in period_seconds)."""
+
+ period_seconds: Optional[int] = None
+ """The period over which this threshold is suggested."""
+
+ requests: Optional[int] = None
+ """The estimated number of requests covered by these calculations."""
+
+ suggested_threshold: Optional[int] = None
+ """The suggested threshold in requests done by the same auth_id or period_seconds."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds(BaseModel):
+ thresholds: Optional[OperationCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(
+ BaseModel
+):
+ parameters: Optional[List[object]] = None
+ """An array containing the learned parameter schemas."""
+
+ responses: Optional[object] = None
+ """An empty response object.
+
+ This field is required to yield a valid operation schema.
+ """
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel):
+ last_updated: Optional[datetime] = None
+
+ parameter_schemas: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas
+ ] = None
+ """An operation schema object containing a response."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel):
+ parameter_schemas: OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel):
+ last_updated: Optional[datetime] = None
+
+ route: Optional[str] = None
+ """Target route."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel):
+ api_routing: Optional[OperationCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None
+ """API Routing settings on endpoint."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90(
+ BaseModel
+):
+ lower: Optional[float] = None
+ """Lower bound for percentile estimate"""
+
+ upper: Optional[float] = None
+ """Upper bound for percentile estimate"""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95(
+ BaseModel
+):
+ lower: Optional[float] = None
+ """Lower bound for percentile estimate"""
+
+ upper: Optional[float] = None
+ """Upper bound for percentile estimate"""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99(
+ BaseModel
+):
+ lower: Optional[float] = None
+ """Lower bound for percentile estimate"""
+
+ upper: Optional[float] = None
+ """Upper bound for percentile estimate"""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals(
+ BaseModel
+):
+ p90: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90
+ ] = None
+ """Upper and lower bound for percentile estimate"""
+
+ p95: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95
+ ] = None
+ """Upper and lower bound for percentile estimate"""
+
+ p99: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99
+ ] = None
+ """Upper and lower bound for percentile estimate"""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(
+ BaseModel
+):
+ confidence_intervals: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals
+ ] = None
+
+ mean: Optional[float] = None
+ """Suggested threshold."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel):
+ last_updated: Optional[datetime] = None
+
+ suggested_threshold: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold
+ ] = None
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel):
+ confidence_intervals: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals
+ ] = None
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel):
+ id: Optional[str] = None
+ """UUID"""
+
+ created_at: Optional[datetime] = None
+
+ is_learned: Optional[bool] = None
+ """True if schema is Cloudflare-provided."""
+
+ name: Optional[str] = None
+ """Schema file name."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel):
+ active_schema: Optional[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema
+ ] = None
+ """Schema active on endpoint."""
+
+ learned_available: Optional[bool] = None
+ """True if a Cloudflare-provided learned schema is available for this endpoint."""
+
+ mitigation_action: Optional[Literal["none", "log", "block"]] = None
+ """Action taken on requests failing validation."""
+
+
+class OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel):
+ schema_info: Optional[OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None
+
+
+OperationCreateResponseItemFeatures: TypeAlias = Union[
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds,
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas,
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting,
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals,
+ OperationCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo,
+]
+
+
+class OperationCreateResponseItem(BaseModel):
+ endpoint: str
+ """
+ The endpoint which can contain path parameter templates in curly braces, each
+ will be replaced from left to right with {varN}, starting with {var1}, during
+ insertion. This will further be Cloudflare-normalized upon insertion. See:
+ https://developers.cloudflare.com/rules/normalization/how-it-works/.
+ """
+
+ host: str
+ """RFC3986-compliant host."""
+
+ last_updated: datetime
+
+ method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]
+ """The HTTP method used to access the endpoint."""
+
+ operation_id: str
+ """UUID"""
+
+ features: Optional[OperationCreateResponseItemFeatures] = None
+
+
+OperationCreateResponse: TypeAlias = List[OperationCreateResponseItem]
diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py
index 3149155c055..fa984a5b255 100644
--- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py
+++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py
@@ -1,15 +1,216 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Union
+from typing import List, Union, Optional
+from datetime import datetime
from typing_extensions import Literal, TypeAlias
+from .. import api_shield_operation
from ...._models import BaseModel
-from ..api_shield import APIShield
-__all__ = ["OperationListResponse", "APIShieldBasicOperation"]
+__all__ = [
+ "OperationListResponse",
+ "APIShieldOperation",
+ "APIShieldOperationFeatures",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo",
+ "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema",
+]
-class APIShieldBasicOperation(BaseModel):
+class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel):
+ auth_id_tokens: Optional[int] = None
+ """The total number of auth-ids seen across this calculation."""
+
+ data_points: Optional[int] = None
+ """The number of data points used for the threshold suggestion calculation."""
+
+ last_updated: Optional[datetime] = None
+
+ p50: Optional[int] = None
+ """The p50 quantile of requests (in period_seconds)."""
+
+ p90: Optional[int] = None
+ """The p90 quantile of requests (in period_seconds)."""
+
+ p99: Optional[int] = None
+ """The p99 quantile of requests (in period_seconds)."""
+
+ period_seconds: Optional[int] = None
+ """The period over which this threshold is suggested."""
+
+ requests: Optional[int] = None
+ """The estimated number of requests covered by these calculations."""
+
+ suggested_threshold: Optional[int] = None
+ """The suggested threshold in requests done by the same auth_id or period_seconds."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds(BaseModel):
+ thresholds: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel):
+ parameters: Optional[List[object]] = None
+ """An array containing the learned parameter schemas."""
+
+ responses: Optional[object] = None
+ """An empty response object.
+
+ This field is required to yield a valid operation schema.
+ """
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel):
+ last_updated: Optional[datetime] = None
+
+ parameter_schemas: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas
+ ] = None
+ """An operation schema object containing a response."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel):
+ parameter_schemas: APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel):
+ last_updated: Optional[datetime] = None
+
+ route: Optional[str] = None
+ """Target route."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel):
+ api_routing: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None
+ """API Routing settings on endpoint."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90(
+ BaseModel
+):
+ lower: Optional[float] = None
+ """Lower bound for percentile estimate"""
+
+ upper: Optional[float] = None
+ """Upper bound for percentile estimate"""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95(
+ BaseModel
+):
+ lower: Optional[float] = None
+ """Lower bound for percentile estimate"""
+
+ upper: Optional[float] = None
+ """Upper bound for percentile estimate"""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99(
+ BaseModel
+):
+ lower: Optional[float] = None
+ """Lower bound for percentile estimate"""
+
+ upper: Optional[float] = None
+ """Upper bound for percentile estimate"""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals(
+ BaseModel
+):
+ p90: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90
+ ] = None
+ """Upper and lower bound for percentile estimate"""
+
+ p95: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95
+ ] = None
+ """Upper and lower bound for percentile estimate"""
+
+ p99: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99
+ ] = None
+ """Upper and lower bound for percentile estimate"""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(
+ BaseModel
+):
+ confidence_intervals: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals
+ ] = None
+
+ mean: Optional[float] = None
+ """Suggested threshold."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel):
+ last_updated: Optional[datetime] = None
+
+ suggested_threshold: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold
+ ] = None
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel):
+ confidence_intervals: Optional[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals
+ ] = None
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel):
+ id: Optional[str] = None
+ """UUID"""
+
+ created_at: Optional[datetime] = None
+
+ is_learned: Optional[bool] = None
+ """True if schema is Cloudflare-provided."""
+
+ name: Optional[str] = None
+ """Schema file name."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel):
+ active_schema: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None
+ """Schema active on endpoint."""
+
+ learned_available: Optional[bool] = None
+ """True if a Cloudflare-provided learned schema is available for this endpoint."""
+
+ mitigation_action: Optional[Literal["none", "log", "block"]] = None
+ """Action taken on requests failing validation."""
+
+
+class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel):
+ schema_info: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None
+
+
+APIShieldOperationFeatures: TypeAlias = Union[
+ APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds,
+ APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas,
+ APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting,
+ APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals,
+ APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo,
+]
+
+
+class APIShieldOperation(BaseModel):
endpoint: str
"""
The endpoint which can contain path parameter templates in curly braces, each
@@ -21,8 +222,15 @@ class APIShieldBasicOperation(BaseModel):
host: str
"""RFC3986-compliant host."""
+ last_updated: datetime
+
method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]
"""The HTTP method used to access the endpoint."""
+ operation_id: str
+ """UUID"""
+
+ features: Optional[APIShieldOperationFeatures] = None
+
-OperationListResponse: TypeAlias = Union[APIShield, APIShieldBasicOperation]
+OperationListResponse: TypeAlias = Union[APIShieldOperation, api_shield_operation.APIShieldOperation]
diff --git a/tests/api_resources/api_gateway/discovery/test_operations.py b/tests/api_resources/api_gateway/discovery/test_operations.py
index 01e6ba3122e..9cdf69de240 100644
--- a/tests/api_resources/api_gateway/discovery/test_operations.py
+++ b/tests/api_resources/api_gateway/discovery/test_operations.py
@@ -10,9 +10,9 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
-from cloudflare.types.api_gateway import DiscoveryOperation
from cloudflare.types.api_gateway.discovery import (
OperationEditResponse,
+ OperationListResponse,
OperationBulkEditResponse,
)
@@ -27,7 +27,7 @@ def test_method_list(self, client: Cloudflare) -> None:
operation = client.api_gateway.discovery.operations.list(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
@@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
per_page=5,
state="review",
)
- assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -55,7 +55,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
operation = response.parse()
- assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
@@ -66,7 +66,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
operation = response.parse()
- assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -197,7 +197,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
operation = await async_client.api_gateway.discovery.operations.list(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
- assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
@@ -214,7 +214,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
per_page=5,
state="review",
)
- assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -225,7 +225,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
operation = await response.parse()
- assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -236,7 +236,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
operation = await response.parse()
- assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])
+ assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
assert cast(Any, response.is_closed) is True