Skip to content

Commit

Permalink
feat(api): manual updates (#2195)
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 9949651 commit 2de0fb0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 27 deletions.
10 changes: 3 additions & 7 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 DiscoveryGetResponse
from cloudflare.types.api_gateway import DiscoveryOperation, DiscoveryGetResponse
```

Methods:
Expand All @@ -2665,16 +2665,12 @@ Methods:
Types:

```python
from cloudflare.types.api_gateway.discovery import (
OperationListResponse,
OperationBulkEditResponse,
OperationEditResponse,
)
from cloudflare.types.api_gateway.discovery import 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_list_response.py">SyncV4PagePaginationArray[OperationListResponse]</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.py">SyncV4PagePaginationArray[DiscoveryOperation]</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 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[OperationListResponse]:
) -> SyncV4PagePaginationArray[DiscoveryOperation]:
"""
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[OperationListResponse],
page=SyncV4PagePaginationArray[DiscoveryOperation],
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=OperationListResponse,
model=DiscoveryOperation,
)

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[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]:
) -> AsyncPaginator[DiscoveryOperation, AsyncV4PagePaginationArray[DiscoveryOperation]]:
"""
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[OperationListResponse],
page=AsyncV4PagePaginationArray[DiscoveryOperation],
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=OperationListResponse,
model=DiscoveryOperation,
)

async def bulk_edit(
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/api_gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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 .operation_get_params import OperationGetParams as OperationGetParams
from .schema_list_response import SchemaListResponse as SchemaListResponse
from .operation_list_params import OperationListParams as OperationListParams
Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/api_gateway/discovery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from datetime import datetime
from typing_extensions import Literal

from ...._models import BaseModel
from ..._models import BaseModel

__all__ = ["OperationListResponse", "Features", "FeaturesTrafficStats"]
__all__ = ["DiscoveryOperation", "Features", "FeaturesTrafficStats"]


class FeaturesTrafficStats(BaseModel):
Expand All @@ -23,7 +23,7 @@ class Features(BaseModel):
traffic_stats: Optional[FeaturesTrafficStats] = None


class OperationListResponse(BaseModel):
class DiscoveryOperation(BaseModel):
id: str
"""UUID"""

Expand Down
18 changes: 9 additions & 9 deletions tests/api_resources/api_gateway/discovery/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand All @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
Expand All @@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
per_page=5,
state="review",
)
assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
Expand All @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
Expand All @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
Expand All @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
Expand All @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
Expand All @@ -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[OperationListResponse], operation, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down

0 comments on commit 2de0fb0

Please sign in to comment.