2020from .._base_client import make_request_options
2121from ..types .app_deploy_response import AppDeployResponse
2222from ..types .app_invoke_response import AppInvokeResponse
23+ from ..types .app_retrieve_invocation_response import AppRetrieveInvocationResponse
2324
2425__all__ = ["AppsResource" , "AsyncAppsResource" ]
2526
@@ -152,6 +153,39 @@ def invoke(
152153 cast_to = AppInvokeResponse ,
153154 )
154155
156+ def retrieve_invocation (
157+ self ,
158+ id : str ,
159+ * ,
160+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
161+ # The extra values given here take precedence over values defined on the client or passed to this method.
162+ extra_headers : Headers | None = None ,
163+ extra_query : Query | None = None ,
164+ extra_body : Body | None = None ,
165+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
166+ ) -> AppRetrieveInvocationResponse :
167+ """
168+ Get an app invocation by id
169+
170+ Args:
171+ extra_headers: Send extra headers
172+
173+ extra_query: Add additional query parameters to the request
174+
175+ extra_body: Add additional JSON properties to the request
176+
177+ timeout: Override the client-level default timeout for this request, in seconds
178+ """
179+ if not id :
180+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
181+ return self ._get (
182+ f"/apps/invocations/{ id } " ,
183+ options = make_request_options (
184+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
185+ ),
186+ cast_to = AppRetrieveInvocationResponse ,
187+ )
188+
155189
156190class AsyncAppsResource (AsyncAPIResource ):
157191 @cached_property
@@ -281,6 +315,39 @@ async def invoke(
281315 cast_to = AppInvokeResponse ,
282316 )
283317
318+ async def retrieve_invocation (
319+ self ,
320+ id : str ,
321+ * ,
322+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
323+ # The extra values given here take precedence over values defined on the client or passed to this method.
324+ extra_headers : Headers | None = None ,
325+ extra_query : Query | None = None ,
326+ extra_body : Body | None = None ,
327+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
328+ ) -> AppRetrieveInvocationResponse :
329+ """
330+ Get an app invocation by id
331+
332+ Args:
333+ extra_headers: Send extra headers
334+
335+ extra_query: Add additional query parameters to the request
336+
337+ extra_body: Add additional JSON properties to the request
338+
339+ timeout: Override the client-level default timeout for this request, in seconds
340+ """
341+ if not id :
342+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
343+ return await self ._get (
344+ f"/apps/invocations/{ id } " ,
345+ options = make_request_options (
346+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
347+ ),
348+ cast_to = AppRetrieveInvocationResponse ,
349+ )
350+
284351
285352class AppsResourceWithRawResponse :
286353 def __init__ (self , apps : AppsResource ) -> None :
@@ -292,6 +359,9 @@ def __init__(self, apps: AppsResource) -> None:
292359 self .invoke = to_raw_response_wrapper (
293360 apps .invoke ,
294361 )
362+ self .retrieve_invocation = to_raw_response_wrapper (
363+ apps .retrieve_invocation ,
364+ )
295365
296366
297367class AsyncAppsResourceWithRawResponse :
@@ -304,6 +374,9 @@ def __init__(self, apps: AsyncAppsResource) -> None:
304374 self .invoke = async_to_raw_response_wrapper (
305375 apps .invoke ,
306376 )
377+ self .retrieve_invocation = async_to_raw_response_wrapper (
378+ apps .retrieve_invocation ,
379+ )
307380
308381
309382class AppsResourceWithStreamingResponse :
@@ -316,6 +389,9 @@ def __init__(self, apps: AppsResource) -> None:
316389 self .invoke = to_streamed_response_wrapper (
317390 apps .invoke ,
318391 )
392+ self .retrieve_invocation = to_streamed_response_wrapper (
393+ apps .retrieve_invocation ,
394+ )
319395
320396
321397class AsyncAppsResourceWithStreamingResponse :
@@ -328,3 +404,6 @@ def __init__(self, apps: AsyncAppsResource) -> None:
328404 self .invoke = async_to_streamed_response_wrapper (
329405 apps .invoke ,
330406 )
407+ self .retrieve_invocation = async_to_streamed_response_wrapper (
408+ apps .retrieve_invocation ,
409+ )
0 commit comments