Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #296

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ Methods:

- <code title="post /zones/{zone_id}/waiting_rooms">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/waiting_room_create_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_room.py">WaitingRoom</a></code>
- <code title="put /zones/{zone_id}/waiting_rooms/{waiting_room_id}">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">update</a>(waiting_room_id, \*, zone_id, \*\*<a href="src/cloudflare/types/waiting_room_update_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_room.py">WaitingRoom</a></code>
- <code title="get /zones/{zone_id}/waiting_rooms">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">list</a>(\*, zone_id) -> <a href="./src/cloudflare/types/waiting_room.py">SyncSinglePage[WaitingRoom]</a></code>
- <code title="get /zones/{zone_id}/waiting_rooms">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/waiting_room_list_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_room.py">SyncSinglePage[WaitingRoom]</a></code>
- <code title="delete /zones/{zone_id}/waiting_rooms/{waiting_room_id}">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">delete</a>(waiting_room_id, \*, zone_id, \*\*<a href="src/cloudflare/types/waiting_room_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_room_delete_response.py">WaitingRoomDeleteResponse</a></code>
- <code title="patch /zones/{zone_id}/waiting_rooms/{waiting_room_id}">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">edit</a>(waiting_room_id, \*, zone_id, \*\*<a href="src/cloudflare/types/waiting_room_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_room.py">WaitingRoom</a></code>
- <code title="get /zones/{zone_id}/waiting_rooms/{waiting_room_id}">client.waiting_rooms.<a href="./src/cloudflare/resources/waiting_rooms/waiting_rooms.py">get</a>(waiting_room_id, \*, zone_id) -> <a href="./src/cloudflare/types/waiting_room.py">WaitingRoom</a></code>
Expand Down Expand Up @@ -2477,7 +2477,7 @@ Methods:

- <code title="post /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">create</a>(waiting_room_id, \*, zone_id, \*\*<a href="src/cloudflare/types/waiting_rooms/event_create_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_rooms/event.py">Event</a></code>
- <code title="put /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">update</a>(event_id, \*, zone_id, waiting_room_id, \*\*<a href="src/cloudflare/types/waiting_rooms/event_update_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_rooms/event.py">Event</a></code>
- <code title="get /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">list</a>(waiting_room_id, \*, zone_id) -> <a href="./src/cloudflare/types/waiting_rooms/event.py">SyncSinglePage[Event]</a></code>
- <code title="get /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">list</a>(waiting_room_id, \*, zone_id, \*\*<a href="src/cloudflare/types/waiting_rooms/event_list_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_rooms/event.py">SyncSinglePage[Event]</a></code>
- <code title="delete /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">delete</a>(event_id, \*, zone_id, waiting_room_id, \*\*<a href="src/cloudflare/types/waiting_rooms/event_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_rooms/event_delete_response.py">EventDeleteResponse</a></code>
- <code title="patch /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">edit</a>(event_id, \*, zone_id, waiting_room_id, \*\*<a href="src/cloudflare/types/waiting_rooms/event_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/waiting_rooms/event.py">Event</a></code>
- <code title="get /zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}">client.waiting_rooms.events.<a href="./src/cloudflare/resources/waiting_rooms/events/events.py">get</a>(event_id, \*, zone_id, waiting_room_id) -> <a href="./src/cloudflare/types/waiting_rooms/event.py">Event</a></code>
Expand Down
37 changes: 35 additions & 2 deletions src/cloudflare/resources/waiting_rooms/events/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
Event,
EventDeleteResponse,
event_edit_params,
event_list_params,
event_create_params,
event_delete_params,
event_update_params,
Expand Down Expand Up @@ -308,6 +309,8 @@ def list(
waiting_room_id: str,
*,
zone_id: str,
page: object | NotGiven = NOT_GIVEN,
per_page: object | NotGiven = NOT_GIVEN,
# 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 All @@ -321,6 +324,10 @@ def list(
Args:
zone_id: Identifier
page: Page number of paginated results.
per_page: Maximum number of results per page. Must be a multiple of 5.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -337,7 +344,17 @@ def list(
f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events",
page=SyncSinglePage[Event],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"page": page,
"per_page": per_page,
},
event_list_params.EventListParams,
),
),
model=Event,
)
Expand Down Expand Up @@ -819,6 +836,8 @@ def list(
waiting_room_id: str,
*,
zone_id: str,
page: object | NotGiven = NOT_GIVEN,
per_page: object | NotGiven = NOT_GIVEN,
# 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 All @@ -832,6 +851,10 @@ def list(
Args:
zone_id: Identifier
page: Page number of paginated results.
per_page: Maximum number of results per page. Must be a multiple of 5.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -848,7 +871,17 @@ def list(
f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events",
page=AsyncSinglePage[Event],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"page": page,
"per_page": per_page,
},
event_list_params.EventListParams,
),
),
model=Event,
)
Expand Down
37 changes: 35 additions & 2 deletions src/cloudflare/resources/waiting_rooms/waiting_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
CookieAttributesParam,
WaitingRoomDeleteResponse,
waiting_room_edit_params,
waiting_room_list_params,
waiting_room_create_params,
waiting_room_delete_params,
waiting_room_update_params,
Expand Down Expand Up @@ -827,6 +828,8 @@ def list(
self,
*,
zone_id: str,
page: object | NotGiven = NOT_GIVEN,
per_page: object | NotGiven = NOT_GIVEN,
# 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 All @@ -840,6 +843,10 @@ def list(
Args:
zone_id: Identifier
page: Page number of paginated results.
per_page: Maximum number of results per page. Must be a multiple of 5.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -854,7 +861,17 @@ def list(
f"/zones/{zone_id}/waiting_rooms",
page=SyncSinglePage[WaitingRoom],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"page": page,
"per_page": per_page,
},
waiting_room_list_params.WaitingRoomListParams,
),
),
model=WaitingRoom,
)
Expand Down Expand Up @@ -2050,6 +2067,8 @@ def list(
self,
*,
zone_id: str,
page: object | NotGiven = NOT_GIVEN,
per_page: object | NotGiven = NOT_GIVEN,
# 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 All @@ -2063,6 +2082,10 @@ def list(
Args:
zone_id: Identifier
page: Page number of paginated results.
per_page: Maximum number of results per page. Must be a multiple of 5.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -2077,7 +2100,17 @@ def list(
f"/zones/{zone_id}/waiting_rooms",
page=AsyncSinglePage[WaitingRoom],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"page": page,
"per_page": per_page,
},
waiting_room_list_params.WaitingRoomListParams,
),
),
model=WaitingRoom,
)
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
from .rate_limit_edit_response import RateLimitEditResponse as RateLimitEditResponse
from .speed_trends_list_params import SpeedTrendsListParams as SpeedTrendsListParams
from .waiting_room_edit_params import WaitingRoomEditParams as WaitingRoomEditParams
from .waiting_room_list_params import WaitingRoomListParams as WaitingRoomListParams
from .healthcheck_create_params import HealthcheckCreateParams as HealthcheckCreateParams
from .healthcheck_delete_params import HealthcheckDeleteParams as HealthcheckDeleteParams
from .healthcheck_update_params import HealthcheckUpdateParams as HealthcheckUpdateParams
Expand Down
18 changes: 18 additions & 0 deletions src/cloudflare/types/waiting_room_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, TypedDict

__all__ = ["WaitingRoomListParams"]


class WaitingRoomListParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""

page: object
"""Page number of paginated results."""

per_page: object
"""Maximum number of results per page. Must be a multiple of 5."""
1 change: 1 addition & 0 deletions src/cloudflare/types/waiting_rooms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .setting import Setting as Setting
from .rule_edit_params import RuleEditParams as RuleEditParams
from .event_edit_params import EventEditParams as EventEditParams
from .event_list_params import EventListParams as EventListParams
from .waiting_room_rule import WaitingRoomRule as WaitingRoomRule
from .rule_create_params import RuleCreateParams as RuleCreateParams
from .rule_delete_params import RuleDeleteParams as RuleDeleteParams
Expand Down
18 changes: 18 additions & 0 deletions src/cloudflare/types/waiting_rooms/event_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, TypedDict

__all__ = ["EventListParams"]


class EventListParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""

page: object
"""Page number of paginated results."""

per_page: object
"""Maximum number of results per page. Must be a multiple of 5."""
20 changes: 20 additions & 0 deletions tests/api_resources/test_waiting_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(SyncSinglePage[WaitingRoom], waiting_room, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
waiting_room = client.waiting_rooms.list(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
page={},
per_page={},
)
assert_matches_type(SyncSinglePage[WaitingRoom], waiting_room, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
Expand Down Expand Up @@ -729,6 +739,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(AsyncSinglePage[WaitingRoom], waiting_room, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
waiting_room = await async_client.waiting_rooms.list(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
page={},
per_page={},
)
assert_matches_type(AsyncSinglePage[WaitingRoom], waiting_room, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
Expand Down
22 changes: 22 additions & 0 deletions tests/api_resources/waiting_rooms/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(SyncSinglePage[Event], event, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
event = client.waiting_rooms.events.list(
"699d98642c564d2e855e9661899b7252",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
page={},
per_page={},
)
assert_matches_type(SyncSinglePage[Event], event, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
Expand Down Expand Up @@ -713,6 +724,17 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(AsyncSinglePage[Event], event, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
event = await async_client.waiting_rooms.events.list(
"699d98642c564d2e855e9661899b7252",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
page={},
per_page={},
)
assert_matches_type(AsyncSinglePage[Event], event, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
Expand Down