|
53 | 53 | async_to_streamed_response_wrapper,
|
54 | 54 | )
|
55 | 55 | from ..._wrappers import ResultWrapper
|
| 56 | +from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray |
56 | 57 | from .events.events import (
|
57 | 58 | EventsResource,
|
58 | 59 | AsyncEventsResource,
|
|
61 | 62 | EventsResourceWithStreamingResponse,
|
62 | 63 | AsyncEventsResourceWithStreamingResponse,
|
63 | 64 | )
|
64 |
| -from ..._base_client import make_request_options |
| 65 | +from ..._base_client import AsyncPaginator, make_request_options |
65 | 66 | from ...types.waiting_rooms import (
|
66 | 67 | waiting_room_edit_params,
|
| 68 | + waiting_room_list_params, |
67 | 69 | waiting_room_create_params,
|
68 | 70 | waiting_room_update_params,
|
69 | 71 | )
|
@@ -912,6 +914,71 @@ def update(
|
912 | 914 | cast_to=cast(Type[WaitingRoom], ResultWrapper[WaitingRoom]),
|
913 | 915 | )
|
914 | 916 |
|
| 917 | + def list( |
| 918 | + self, |
| 919 | + *, |
| 920 | + account_id: str | NotGiven = NOT_GIVEN, |
| 921 | + zone_id: str | NotGiven = NOT_GIVEN, |
| 922 | + page: float | NotGiven = NOT_GIVEN, |
| 923 | + per_page: float | NotGiven = NOT_GIVEN, |
| 924 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 925 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 926 | + extra_headers: Headers | None = None, |
| 927 | + extra_query: Query | None = None, |
| 928 | + extra_body: Body | None = None, |
| 929 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 930 | + ) -> SyncV4PagePaginationArray[WaitingRoom]: |
| 931 | + """ |
| 932 | + Lists waiting rooms for account or zone. |
| 933 | +
|
| 934 | + Args: |
| 935 | + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. |
| 936 | +
|
| 937 | + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. |
| 938 | +
|
| 939 | + page: Page number of paginated results. |
| 940 | +
|
| 941 | + per_page: Maximum number of results per page. Must be a multiple of 5. |
| 942 | +
|
| 943 | + extra_headers: Send extra headers |
| 944 | +
|
| 945 | + extra_query: Add additional query parameters to the request |
| 946 | +
|
| 947 | + extra_body: Add additional JSON properties to the request |
| 948 | +
|
| 949 | + timeout: Override the client-level default timeout for this request, in seconds |
| 950 | + """ |
| 951 | + if account_id and zone_id: |
| 952 | + raise ValueError("You cannot provide both account_id and zone_id") |
| 953 | + |
| 954 | + if account_id: |
| 955 | + account_or_zone = "accounts" |
| 956 | + account_or_zone_id = account_id |
| 957 | + else: |
| 958 | + if not zone_id: |
| 959 | + raise ValueError("You must provide either account_id or zone_id") |
| 960 | + |
| 961 | + account_or_zone = "zones" |
| 962 | + account_or_zone_id = zone_id |
| 963 | + return self._get_api_list( |
| 964 | + f"/{account_or_zone}/{account_or_zone_id}/waiting_rooms", |
| 965 | + page=SyncV4PagePaginationArray[WaitingRoom], |
| 966 | + options=make_request_options( |
| 967 | + extra_headers=extra_headers, |
| 968 | + extra_query=extra_query, |
| 969 | + extra_body=extra_body, |
| 970 | + timeout=timeout, |
| 971 | + query=maybe_transform( |
| 972 | + { |
| 973 | + "page": page, |
| 974 | + "per_page": per_page, |
| 975 | + }, |
| 976 | + waiting_room_list_params.WaitingRoomListParams, |
| 977 | + ), |
| 978 | + ), |
| 979 | + model=WaitingRoom, |
| 980 | + ) |
| 981 | + |
915 | 982 | def delete(
|
916 | 983 | self,
|
917 | 984 | waiting_room_id: str,
|
@@ -2234,6 +2301,71 @@ async def update(
|
2234 | 2301 | cast_to=cast(Type[WaitingRoom], ResultWrapper[WaitingRoom]),
|
2235 | 2302 | )
|
2236 | 2303 |
|
| 2304 | + def list( |
| 2305 | + self, |
| 2306 | + *, |
| 2307 | + account_id: str | NotGiven = NOT_GIVEN, |
| 2308 | + zone_id: str | NotGiven = NOT_GIVEN, |
| 2309 | + page: float | NotGiven = NOT_GIVEN, |
| 2310 | + per_page: float | NotGiven = NOT_GIVEN, |
| 2311 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 2312 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 2313 | + extra_headers: Headers | None = None, |
| 2314 | + extra_query: Query | None = None, |
| 2315 | + extra_body: Body | None = None, |
| 2316 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 2317 | + ) -> AsyncPaginator[WaitingRoom, AsyncV4PagePaginationArray[WaitingRoom]]: |
| 2318 | + """ |
| 2319 | + Lists waiting rooms for account or zone. |
| 2320 | +
|
| 2321 | + Args: |
| 2322 | + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. |
| 2323 | +
|
| 2324 | + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. |
| 2325 | +
|
| 2326 | + page: Page number of paginated results. |
| 2327 | +
|
| 2328 | + per_page: Maximum number of results per page. Must be a multiple of 5. |
| 2329 | +
|
| 2330 | + extra_headers: Send extra headers |
| 2331 | +
|
| 2332 | + extra_query: Add additional query parameters to the request |
| 2333 | +
|
| 2334 | + extra_body: Add additional JSON properties to the request |
| 2335 | +
|
| 2336 | + timeout: Override the client-level default timeout for this request, in seconds |
| 2337 | + """ |
| 2338 | + if account_id and zone_id: |
| 2339 | + raise ValueError("You cannot provide both account_id and zone_id") |
| 2340 | + |
| 2341 | + if account_id: |
| 2342 | + account_or_zone = "accounts" |
| 2343 | + account_or_zone_id = account_id |
| 2344 | + else: |
| 2345 | + if not zone_id: |
| 2346 | + raise ValueError("You must provide either account_id or zone_id") |
| 2347 | + |
| 2348 | + account_or_zone = "zones" |
| 2349 | + account_or_zone_id = zone_id |
| 2350 | + return self._get_api_list( |
| 2351 | + f"/{account_or_zone}/{account_or_zone_id}/waiting_rooms", |
| 2352 | + page=AsyncV4PagePaginationArray[WaitingRoom], |
| 2353 | + options=make_request_options( |
| 2354 | + extra_headers=extra_headers, |
| 2355 | + extra_query=extra_query, |
| 2356 | + extra_body=extra_body, |
| 2357 | + timeout=timeout, |
| 2358 | + query=maybe_transform( |
| 2359 | + { |
| 2360 | + "page": page, |
| 2361 | + "per_page": per_page, |
| 2362 | + }, |
| 2363 | + waiting_room_list_params.WaitingRoomListParams, |
| 2364 | + ), |
| 2365 | + ), |
| 2366 | + model=WaitingRoom, |
| 2367 | + ) |
| 2368 | + |
2237 | 2369 | async def delete(
|
2238 | 2370 | self,
|
2239 | 2371 | waiting_room_id: str,
|
@@ -2729,6 +2861,9 @@ def __init__(self, waiting_rooms: WaitingRoomsResource) -> None:
|
2729 | 2861 | self.update = to_raw_response_wrapper(
|
2730 | 2862 | waiting_rooms.update,
|
2731 | 2863 | )
|
| 2864 | + self.list = to_raw_response_wrapper( |
| 2865 | + waiting_rooms.list, |
| 2866 | + ) |
2732 | 2867 | self.delete = to_raw_response_wrapper(
|
2733 | 2868 | waiting_rooms.delete,
|
2734 | 2869 | )
|
@@ -2770,6 +2905,9 @@ def __init__(self, waiting_rooms: AsyncWaitingRoomsResource) -> None:
|
2770 | 2905 | self.update = async_to_raw_response_wrapper(
|
2771 | 2906 | waiting_rooms.update,
|
2772 | 2907 | )
|
| 2908 | + self.list = async_to_raw_response_wrapper( |
| 2909 | + waiting_rooms.list, |
| 2910 | + ) |
2773 | 2911 | self.delete = async_to_raw_response_wrapper(
|
2774 | 2912 | waiting_rooms.delete,
|
2775 | 2913 | )
|
@@ -2811,6 +2949,9 @@ def __init__(self, waiting_rooms: WaitingRoomsResource) -> None:
|
2811 | 2949 | self.update = to_streamed_response_wrapper(
|
2812 | 2950 | waiting_rooms.update,
|
2813 | 2951 | )
|
| 2952 | + self.list = to_streamed_response_wrapper( |
| 2953 | + waiting_rooms.list, |
| 2954 | + ) |
2814 | 2955 | self.delete = to_streamed_response_wrapper(
|
2815 | 2956 | waiting_rooms.delete,
|
2816 | 2957 | )
|
@@ -2852,6 +2993,9 @@ def __init__(self, waiting_rooms: AsyncWaitingRoomsResource) -> None:
|
2852 | 2993 | self.update = async_to_streamed_response_wrapper(
|
2853 | 2994 | waiting_rooms.update,
|
2854 | 2995 | )
|
| 2996 | + self.list = async_to_streamed_response_wrapper( |
| 2997 | + waiting_rooms.list, |
| 2998 | + ) |
2855 | 2999 | self.delete = async_to_streamed_response_wrapper(
|
2856 | 3000 | waiting_rooms.delete,
|
2857 | 3001 | )
|
|
0 commit comments