77
88import httpx
99
10- from ..types import deployment_create_params , deployment_follow_params
10+ from ..types import deployment_list_params , deployment_create_params , deployment_follow_params
1111from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven , FileTypes
1212from .._utils import extract_files , maybe_transform , deepcopy_minimal , async_maybe_transform
1313from .._compat import cached_property
2020)
2121from .._streaming import Stream , AsyncStream
2222from .._base_client import make_request_options
23+ from ..types .deployment_list_response import DeploymentListResponse
2324from ..types .deployment_create_response import DeploymentCreateResponse
2425from ..types .deployment_follow_response import DeploymentFollowResponse
2526from ..types .deployment_retrieve_response import DeploymentRetrieveResponse
@@ -146,6 +147,44 @@ def retrieve(
146147 cast_to = DeploymentRetrieveResponse ,
147148 )
148149
150+ def list (
151+ self ,
152+ * ,
153+ app_name : str | NotGiven = NOT_GIVEN ,
154+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
155+ # The extra values given here take precedence over values defined on the client or passed to this method.
156+ extra_headers : Headers | None = None ,
157+ extra_query : Query | None = None ,
158+ extra_body : Body | None = None ,
159+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
160+ ) -> DeploymentListResponse :
161+ """List deployments.
162+
163+ Optionally filter by application name.
164+
165+ Args:
166+ app_name: Filter results by application name.
167+
168+ extra_headers: Send extra headers
169+
170+ extra_query: Add additional query parameters to the request
171+
172+ extra_body: Add additional JSON properties to the request
173+
174+ timeout: Override the client-level default timeout for this request, in seconds
175+ """
176+ return self ._get (
177+ "/deployments" ,
178+ options = make_request_options (
179+ extra_headers = extra_headers ,
180+ extra_query = extra_query ,
181+ extra_body = extra_body ,
182+ timeout = timeout ,
183+ query = maybe_transform ({"app_name" : app_name }, deployment_list_params .DeploymentListParams ),
184+ ),
185+ cast_to = DeploymentListResponse ,
186+ )
187+
149188 def follow (
150189 self ,
151190 id : str ,
@@ -313,6 +352,44 @@ async def retrieve(
313352 cast_to = DeploymentRetrieveResponse ,
314353 )
315354
355+ async def list (
356+ self ,
357+ * ,
358+ app_name : str | NotGiven = NOT_GIVEN ,
359+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
360+ # The extra values given here take precedence over values defined on the client or passed to this method.
361+ extra_headers : Headers | None = None ,
362+ extra_query : Query | None = None ,
363+ extra_body : Body | None = None ,
364+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
365+ ) -> DeploymentListResponse :
366+ """List deployments.
367+
368+ Optionally filter by application name.
369+
370+ Args:
371+ app_name: Filter results by application name.
372+
373+ extra_headers: Send extra headers
374+
375+ extra_query: Add additional query parameters to the request
376+
377+ extra_body: Add additional JSON properties to the request
378+
379+ timeout: Override the client-level default timeout for this request, in seconds
380+ """
381+ return await self ._get (
382+ "/deployments" ,
383+ options = make_request_options (
384+ extra_headers = extra_headers ,
385+ extra_query = extra_query ,
386+ extra_body = extra_body ,
387+ timeout = timeout ,
388+ query = await async_maybe_transform ({"app_name" : app_name }, deployment_list_params .DeploymentListParams ),
389+ ),
390+ cast_to = DeploymentListResponse ,
391+ )
392+
316393 async def follow (
317394 self ,
318395 id : str ,
@@ -371,6 +448,9 @@ def __init__(self, deployments: DeploymentsResource) -> None:
371448 self .retrieve = to_raw_response_wrapper (
372449 deployments .retrieve ,
373450 )
451+ self .list = to_raw_response_wrapper (
452+ deployments .list ,
453+ )
374454 self .follow = to_raw_response_wrapper (
375455 deployments .follow ,
376456 )
@@ -386,6 +466,9 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None:
386466 self .retrieve = async_to_raw_response_wrapper (
387467 deployments .retrieve ,
388468 )
469+ self .list = async_to_raw_response_wrapper (
470+ deployments .list ,
471+ )
389472 self .follow = async_to_raw_response_wrapper (
390473 deployments .follow ,
391474 )
@@ -401,6 +484,9 @@ def __init__(self, deployments: DeploymentsResource) -> None:
401484 self .retrieve = to_streamed_response_wrapper (
402485 deployments .retrieve ,
403486 )
487+ self .list = to_streamed_response_wrapper (
488+ deployments .list ,
489+ )
404490 self .follow = to_streamed_response_wrapper (
405491 deployments .follow ,
406492 )
@@ -416,6 +502,9 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None:
416502 self .retrieve = async_to_streamed_response_wrapper (
417503 deployments .retrieve ,
418504 )
505+ self .list = async_to_streamed_response_wrapper (
506+ deployments .list ,
507+ )
419508 self .follow = async_to_streamed_response_wrapper (
420509 deployments .follow ,
421510 )
0 commit comments