Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#2189)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 20, 2024
1 parent 09acf0a commit 93cfe28
Show file tree
Hide file tree
Showing 13 changed files with 534 additions and 286 deletions.
12 changes: 8 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2653,7 +2653,7 @@ Methods:
Types:

```python
from cloudflare.types.api_gateway import DiscoveryOperation, DiscoveryGetResponse
from cloudflare.types.api_gateway import DiscoveryGetResponse
```

Methods:
Expand All @@ -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:

- <code title="get /zones/{zone_id}/api_gateway/discovery/operations">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery_operation.py">SyncV4PagePaginationArray[DiscoveryOperation]</a></code>
- <code title="get /zones/{zone_id}/api_gateway/discovery/operations">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_list_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery/operation_list_response.py">SyncV4PagePaginationArray[OperationListResponse]</a></code>
- <code title="patch /zones/{zone_id}/api_gateway/discovery/operations">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">bulk_edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_response.py">OperationBulkEditResponse</a></code>
- <code title="patch /zones/{zone_id}/api_gateway/discovery/operations/{operation_id}">client.api_gateway.discovery.operations.<a href="./src/cloudflare/resources/api_gateway/discovery/operations.py">edit</a>(operation_id, \*, zone_id, \*\*<a href="src/cloudflare/types/api_gateway/discovery/operation_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/api_gateway/discovery/operation_edit_response.py">OperationEditResponse</a></code>

Expand All @@ -2680,7 +2684,7 @@ Types:

```python
from cloudflare.types.api_gateway import (
APIShield,
APIShieldOperation,
OperationCreateResponse,
OperationListResponse,
OperationDeleteResponse,
Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/api_gateway/discovery/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -146,7 +146,7 @@ def list(
operation_list_params.OperationListParams,
),
),
model=DiscoveryOperation,
model=OperationListResponse,
)

def bulk_edit(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -357,7 +357,7 @@ def list(
operation_list_params.OperationListParams,
),
),
model=DiscoveryOperation,
model=OperationListResponse,
)

async def bulk_edit(
Expand Down
11 changes: 6 additions & 5 deletions src/cloudflare/resources/api_gateway/operations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/types/api_gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 93cfe28

Please sign in to comment.