Skip to content

Commit 4e1d81a

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#2187)
1 parent eeb6d8e commit 4e1d81a

File tree

9 files changed

+507
-263
lines changed

9 files changed

+507
-263
lines changed

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2680,7 +2680,7 @@ Types:
26802680

26812681
```python
26822682
from cloudflare.types.api_gateway import (
2683-
APIShield,
2683+
APIShieldOperation,
26842684
OperationCreateResponse,
26852685
OperationListResponse,
26862686
OperationDeleteResponse,

src/cloudflare/resources/api_gateway/operations/operations.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131
SchemaValidationResourceWithStreamingResponse,
3232
AsyncSchemaValidationResourceWithStreamingResponse,
3333
)
34-
from ....types.api_gateway import operation_get_params, operation_list_params, operation_create_params
34+
from ....types.api_gateway import operation_get_params, operation_list_params
3535
from ....types.api_gateway.operation_get_response import OperationGetResponse
3636
from ....types.api_gateway.operation_list_response import OperationListResponse
3737
from ....types.api_gateway.operation_create_response import OperationCreateResponse
3838
from ....types.api_gateway.operation_delete_response import OperationDeleteResponse
39+
from ....types.api_gateway.api_shield_operation_param import APIShieldOperationParam
3940
from ....types.api_gateway.operation_bulk_delete_response import OperationBulkDeleteResponse
4041

4142
__all__ = ["OperationsResource", "AsyncOperationsResource"]
@@ -69,7 +70,7 @@ def create(
6970
self,
7071
*,
7172
zone_id: str,
72-
body: Iterable[operation_create_params.Body],
73+
body: Iterable[APIShieldOperationParam],
7374
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7475
# The extra values given here take precedence over values defined on the client or passed to this method.
7576
extra_headers: Headers | None = None,
@@ -100,7 +101,7 @@ def create(
100101
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
101102
return self._post(
102103
f"/zones/{zone_id}/api_gateway/operations",
103-
body=maybe_transform(body, Iterable[operation_create_params.Body]),
104+
body=maybe_transform(body, Iterable[APIShieldOperationParam]),
104105
options=make_request_options(
105106
extra_headers=extra_headers,
106107
extra_query=extra_query,
@@ -344,7 +345,7 @@ async def create(
344345
self,
345346
*,
346347
zone_id: str,
347-
body: Iterable[operation_create_params.Body],
348+
body: Iterable[APIShieldOperationParam],
348349
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349350
# The extra values given here take precedence over values defined on the client or passed to this method.
350351
extra_headers: Headers | None = None,
@@ -375,7 +376,7 @@ async def create(
375376
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
376377
return await self._post(
377378
f"/zones/{zone_id}/api_gateway/operations",
378-
body=await async_maybe_transform(body, Iterable[operation_create_params.Body]),
379+
body=await async_maybe_transform(body, Iterable[APIShieldOperationParam]),
379380
options=make_request_options(
380381
extra_headers=extra_headers,
381382
extra_query=extra_query,

src/cloudflare/types/api_gateway/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
from .message import Message as Message
66
from .settings import Settings as Settings
7-
from .api_shield import APIShield as APIShield
87
from .configuration import Configuration as Configuration
98
from .public_schema import PublicSchema as PublicSchema
109
from .schema_upload import SchemaUpload as SchemaUpload
1110
from .schema_list_params import SchemaListParams as SchemaListParams
1211
from .discovery_operation import DiscoveryOperation as DiscoveryOperation
12+
from .api_shield_operation import APIShieldOperation as APIShieldOperation
1313
from .operation_get_params import OperationGetParams as OperationGetParams
1414
from .schema_list_response import SchemaListResponse as SchemaListResponse
1515
from .operation_list_params import OperationListParams as OperationListParams
@@ -24,6 +24,7 @@
2424
from .operation_create_response import OperationCreateResponse as OperationCreateResponse
2525
from .operation_delete_response import OperationDeleteResponse as OperationDeleteResponse
2626
from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams
27+
from .api_shield_operation_param import APIShieldOperationParam as APIShieldOperationParam
2728
from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams
2829
from .user_schema_delete_response import UserSchemaDeleteResponse as UserSchemaDeleteResponse
2930
from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse

src/cloudflare/types/api_gateway/api_shield.py

-227
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal
4+
5+
from ..._models import BaseModel
6+
7+
__all__ = ["APIShieldOperation"]
8+
9+
10+
class APIShieldOperation(BaseModel):
11+
endpoint: str
12+
"""
13+
The endpoint which can contain path parameter templates in curly braces, each
14+
will be replaced from left to right with {varN}, starting with {var1}, during
15+
insertion. This will further be Cloudflare-normalized upon insertion. See:
16+
https://developers.cloudflare.com/rules/normalization/how-it-works/.
17+
"""
18+
19+
host: str
20+
"""RFC3986-compliant host."""
21+
22+
method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]
23+
"""The HTTP method used to access the endpoint."""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, TypedDict
6+
7+
__all__ = ["APIShieldOperationParam"]
8+
9+
10+
class APIShieldOperationParam(TypedDict, total=False):
11+
endpoint: Required[str]
12+
"""
13+
The endpoint which can contain path parameter templates in curly braces, each
14+
will be replaced from left to right with {varN}, starting with {var1}, during
15+
insertion. This will further be Cloudflare-normalized upon insertion. See:
16+
https://developers.cloudflare.com/rules/normalization/how-it-works/.
17+
"""
18+
19+
host: Required[str]
20+
"""RFC3986-compliant host."""
21+
22+
method: Required[Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]]
23+
"""The HTTP method used to access the endpoint."""

src/cloudflare/types/api_gateway/operation_create_params.py

+5-19
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,15 @@
33
from __future__ import annotations
44

55
from typing import Iterable
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Required, TypedDict
77

8-
__all__ = ["OperationCreateParams", "Body"]
8+
from .api_shield_operation_param import APIShieldOperationParam
9+
10+
__all__ = ["OperationCreateParams"]
911

1012

1113
class OperationCreateParams(TypedDict, total=False):
1214
zone_id: Required[str]
1315
"""Identifier"""
1416

15-
body: Required[Iterable[Body]]
16-
17-
18-
class Body(TypedDict, total=False):
19-
endpoint: Required[str]
20-
"""
21-
The endpoint which can contain path parameter templates in curly braces, each
22-
will be replaced from left to right with {varN}, starting with {var1}, during
23-
insertion. This will further be Cloudflare-normalized upon insertion. See:
24-
https://developers.cloudflare.com/rules/normalization/how-it-works/.
25-
"""
26-
27-
host: Required[str]
28-
"""RFC3986-compliant host."""
29-
30-
method: Required[Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]]
31-
"""The HTTP method used to access the endpoint."""
17+
body: Required[Iterable[APIShieldOperationParam]]

0 commit comments

Comments
 (0)