77
88import httpx
99
10- from ..types import invocation_create_params , invocation_follow_params , invocation_update_params
10+ from ..types import invocation_list_params , invocation_create_params , invocation_follow_params , invocation_update_params
1111from .._types import Body , Omit , Query , Headers , NoneType , NotGiven , omit , not_given
1212from .._utils import maybe_transform , async_maybe_transform
1313from .._compat import cached_property
1919 async_to_streamed_response_wrapper ,
2020)
2121from .._streaming import Stream , AsyncStream
22- from .._base_client import make_request_options
22+ from ..pagination import SyncOffsetPagination , AsyncOffsetPagination
23+ from .._base_client import AsyncPaginator , make_request_options
24+ from ..types .invocation_list_response import InvocationListResponse
2325from ..types .invocation_create_response import InvocationCreateResponse
2426from ..types .invocation_follow_response import InvocationFollowResponse
2527from ..types .invocation_update_response import InvocationUpdateResponse
@@ -185,6 +187,76 @@ def update(
185187 cast_to = InvocationUpdateResponse ,
186188 )
187189
190+ def list (
191+ self ,
192+ * ,
193+ action_name : str | Omit = omit ,
194+ app_name : str | Omit = omit ,
195+ deployment_id : str | Omit = omit ,
196+ limit : int | Omit = omit ,
197+ offset : int | Omit = omit ,
198+ since : str | Omit = omit ,
199+ status : Literal ["queued" , "running" , "succeeded" , "failed" ] | Omit = omit ,
200+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
201+ # The extra values given here take precedence over values defined on the client or passed to this method.
202+ extra_headers : Headers | None = None ,
203+ extra_query : Query | None = None ,
204+ extra_body : Body | None = None ,
205+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
206+ ) -> SyncOffsetPagination [InvocationListResponse ]:
207+ """List invocations.
208+
209+ Optionally filter by application name, action name, status,
210+ deployment ID, or start time.
211+
212+ Args:
213+ action_name: Filter results by action name.
214+
215+ app_name: Filter results by application name.
216+
217+ deployment_id: Filter results by deployment ID.
218+
219+ limit: Limit the number of invocations to return.
220+
221+ offset: Offset the number of invocations to return.
222+
223+ since: Show invocations that have started since the given time (RFC timestamps or
224+ durations like 5m).
225+
226+ status: Filter results by invocation status.
227+
228+ extra_headers: Send extra headers
229+
230+ extra_query: Add additional query parameters to the request
231+
232+ extra_body: Add additional JSON properties to the request
233+
234+ timeout: Override the client-level default timeout for this request, in seconds
235+ """
236+ return self ._get_api_list (
237+ "/invocations" ,
238+ page = SyncOffsetPagination [InvocationListResponse ],
239+ options = make_request_options (
240+ extra_headers = extra_headers ,
241+ extra_query = extra_query ,
242+ extra_body = extra_body ,
243+ timeout = timeout ,
244+ query = maybe_transform (
245+ {
246+ "action_name" : action_name ,
247+ "app_name" : app_name ,
248+ "deployment_id" : deployment_id ,
249+ "limit" : limit ,
250+ "offset" : offset ,
251+ "since" : since ,
252+ "status" : status ,
253+ },
254+ invocation_list_params .InvocationListParams ,
255+ ),
256+ ),
257+ model = InvocationListResponse ,
258+ )
259+
188260 def delete_browsers (
189261 self ,
190262 id : str ,
@@ -424,6 +496,76 @@ async def update(
424496 cast_to = InvocationUpdateResponse ,
425497 )
426498
499+ def list (
500+ self ,
501+ * ,
502+ action_name : str | Omit = omit ,
503+ app_name : str | Omit = omit ,
504+ deployment_id : str | Omit = omit ,
505+ limit : int | Omit = omit ,
506+ offset : int | Omit = omit ,
507+ since : str | Omit = omit ,
508+ status : Literal ["queued" , "running" , "succeeded" , "failed" ] | Omit = omit ,
509+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
510+ # The extra values given here take precedence over values defined on the client or passed to this method.
511+ extra_headers : Headers | None = None ,
512+ extra_query : Query | None = None ,
513+ extra_body : Body | None = None ,
514+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
515+ ) -> AsyncPaginator [InvocationListResponse , AsyncOffsetPagination [InvocationListResponse ]]:
516+ """List invocations.
517+
518+ Optionally filter by application name, action name, status,
519+ deployment ID, or start time.
520+
521+ Args:
522+ action_name: Filter results by action name.
523+
524+ app_name: Filter results by application name.
525+
526+ deployment_id: Filter results by deployment ID.
527+
528+ limit: Limit the number of invocations to return.
529+
530+ offset: Offset the number of invocations to return.
531+
532+ since: Show invocations that have started since the given time (RFC timestamps or
533+ durations like 5m).
534+
535+ status: Filter results by invocation status.
536+
537+ extra_headers: Send extra headers
538+
539+ extra_query: Add additional query parameters to the request
540+
541+ extra_body: Add additional JSON properties to the request
542+
543+ timeout: Override the client-level default timeout for this request, in seconds
544+ """
545+ return self ._get_api_list (
546+ "/invocations" ,
547+ page = AsyncOffsetPagination [InvocationListResponse ],
548+ options = make_request_options (
549+ extra_headers = extra_headers ,
550+ extra_query = extra_query ,
551+ extra_body = extra_body ,
552+ timeout = timeout ,
553+ query = maybe_transform (
554+ {
555+ "action_name" : action_name ,
556+ "app_name" : app_name ,
557+ "deployment_id" : deployment_id ,
558+ "limit" : limit ,
559+ "offset" : offset ,
560+ "since" : since ,
561+ "status" : status ,
562+ },
563+ invocation_list_params .InvocationListParams ,
564+ ),
565+ ),
566+ model = InvocationListResponse ,
567+ )
568+
427569 async def delete_browsers (
428570 self ,
429571 id : str ,
@@ -519,6 +661,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
519661 self .update = to_raw_response_wrapper (
520662 invocations .update ,
521663 )
664+ self .list = to_raw_response_wrapper (
665+ invocations .list ,
666+ )
522667 self .delete_browsers = to_raw_response_wrapper (
523668 invocations .delete_browsers ,
524669 )
@@ -540,6 +685,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
540685 self .update = async_to_raw_response_wrapper (
541686 invocations .update ,
542687 )
688+ self .list = async_to_raw_response_wrapper (
689+ invocations .list ,
690+ )
543691 self .delete_browsers = async_to_raw_response_wrapper (
544692 invocations .delete_browsers ,
545693 )
@@ -561,6 +709,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
561709 self .update = to_streamed_response_wrapper (
562710 invocations .update ,
563711 )
712+ self .list = to_streamed_response_wrapper (
713+ invocations .list ,
714+ )
564715 self .delete_browsers = to_streamed_response_wrapper (
565716 invocations .delete_browsers ,
566717 )
@@ -582,6 +733,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
582733 self .update = async_to_streamed_response_wrapper (
583734 invocations .update ,
584735 )
736+ self .list = async_to_streamed_response_wrapper (
737+ invocations .list ,
738+ )
585739 self .delete_browsers = async_to_streamed_response_wrapper (
586740 invocations .delete_browsers ,
587741 )
0 commit comments