Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 192ef64 commit e2478c5
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 23 deletions.
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7221,7 +7221,7 @@ Types:
```python
from cloudflare.types.cloudforce_one import (
Item,
List,
ListItem,
Quota,
RequestConstants,
RequestTypes,
Expand All @@ -7233,7 +7233,7 @@ Methods:

- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/new">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">update</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">list</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_list_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/list.py">SyncV4PagePaginationArray[List]</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">list</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_list_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/list_item.py">SyncV4PagePaginationArray[ListItem]</a></code>
- <code title="delete /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">delete</a>(request_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_delete_response.py">RequestDeleteResponse</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/constants">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">constants</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_constants.py">RequestConstants</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">get</a>(request_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
Expand Down
16 changes: 8 additions & 8 deletions src/cloudflare/resources/cloudforce_one/requests/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, List, Type, Union, cast
from typing import Any, Type, Union, cast
from datetime import datetime
from typing_extensions import Literal

Expand Down Expand Up @@ -45,8 +45,8 @@
)
from ....types.cloudforce_one import (
Item,
List,
Quota,
ListItem,
RequestTypes,
RequestConstants,
RequestDeleteResponse,
Expand Down Expand Up @@ -233,7 +233,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncV4PagePaginationArray[List]:
) -> SyncV4PagePaginationArray[ListItem]:
"""
List Requests
Expand Down Expand Up @@ -272,7 +272,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
return self._get_api_list(
f"/accounts/{account_identifier}/cloudforce-one/requests",
page=SyncV4PagePaginationArray[List],
page=SyncV4PagePaginationArray[ListItem],
body=maybe_transform(
{
"page": page,
Expand All @@ -291,7 +291,7 @@ def list(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=List,
model=ListItem,
method="post",
)

Expand Down Expand Up @@ -681,7 +681,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[List, AsyncV4PagePaginationArray[List]]:
) -> AsyncPaginator[ListItem, AsyncV4PagePaginationArray[ListItem]]:
"""
List Requests
Expand Down Expand Up @@ -720,7 +720,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
return self._get_api_list(
f"/accounts/{account_identifier}/cloudforce-one/requests",
page=AsyncV4PagePaginationArray[List],
page=AsyncV4PagePaginationArray[ListItem],
body=maybe_transform(
{
"page": page,
Expand All @@ -739,7 +739,7 @@ def list(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=List,
model=ListItem,
method="post",
)

Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/cloudforce_one/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from __future__ import annotations

from .item import Item as Item
from .list import List as List
from .quota import Quota as Quota
from .list_item import ListItem as ListItem
from .request_types import RequestTypes as RequestTypes
from .request_constants import RequestConstants as RequestConstants
from .request_list_params import RequestListParams as RequestListParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing import Optional
from datetime import datetime
from typing_extensions import Literal

from ..._models import BaseModel

__all__ = ["List"]
__all__ = ["ListItem"]


class List(BaseModel):
class ListItem(BaseModel):
id: str
"""UUID"""

Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/rules/lists/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from .list_item import ListItem as ListItem
from .list_cursor import ListCursor as ListCursor
from .item_list_params import ItemListParams as ItemListParams
from .operation_status import OperationStatus as OperationStatus
Expand Down
12 changes: 12 additions & 0 deletions src/cloudflare/types/rules/lists/list_item.py
Original file line number Diff line number Diff line change
@@ -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__ = ["ListItem"]


class ListItem(BaseModel):
operation_id: Optional[str] = None
"""The unique operation ID of the asynchronous action."""
18 changes: 9 additions & 9 deletions tests/api_resources/cloudforce_one/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from cloudflare.types.cloudforce_one import (
Item,
List,
Quota,
ListItem,
RequestTypes,
RequestConstants,
RequestDeleteResponse,
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_method_list(self, client: Cloudflare) -> None:
page=0,
per_page=10,
)
assert_matches_type(SyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -173,7 +173,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
sort_order="asc",
status="open",
)
assert_matches_type(SyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -187,7 +187,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"
request = response.parse()
assert_matches_type(SyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -201,7 +201,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

request = response.parse()
assert_matches_type(SyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -578,7 +578,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
page=0,
per_page=10,
)
assert_matches_type(AsyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -596,7 +596,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
sort_order="asc",
status="open",
)
assert_matches_type(AsyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -610,7 +610,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"
request = await response.parse()
assert_matches_type(AsyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -624,7 +624,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

request = await response.parse()
assert_matches_type(AsyncV4PagePaginationArray[List], request, path=["response"])
assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down

0 comments on commit e2478c5

Please sign in to comment.