20
20
from .._base_client import make_request_options
21
21
from ..types .app_deploy_response import AppDeployResponse
22
22
from ..types .app_invoke_response import AppInvokeResponse
23
+ from ..types .app_retrieve_invocation_response import AppRetrieveInvocationResponse
23
24
24
25
__all__ = ["AppsResource" , "AsyncAppsResource" ]
25
26
@@ -152,6 +153,39 @@ def invoke(
152
153
cast_to = AppInvokeResponse ,
153
154
)
154
155
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
+
155
189
156
190
class AsyncAppsResource (AsyncAPIResource ):
157
191
@cached_property
@@ -281,6 +315,39 @@ async def invoke(
281
315
cast_to = AppInvokeResponse ,
282
316
)
283
317
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
+
284
351
285
352
class AppsResourceWithRawResponse :
286
353
def __init__ (self , apps : AppsResource ) -> None :
@@ -292,6 +359,9 @@ def __init__(self, apps: AppsResource) -> None:
292
359
self .invoke = to_raw_response_wrapper (
293
360
apps .invoke ,
294
361
)
362
+ self .retrieve_invocation = to_raw_response_wrapper (
363
+ apps .retrieve_invocation ,
364
+ )
295
365
296
366
297
367
class AsyncAppsResourceWithRawResponse :
@@ -304,6 +374,9 @@ def __init__(self, apps: AsyncAppsResource) -> None:
304
374
self .invoke = async_to_raw_response_wrapper (
305
375
apps .invoke ,
306
376
)
377
+ self .retrieve_invocation = async_to_raw_response_wrapper (
378
+ apps .retrieve_invocation ,
379
+ )
307
380
308
381
309
382
class AppsResourceWithStreamingResponse :
@@ -316,6 +389,9 @@ def __init__(self, apps: AppsResource) -> None:
316
389
self .invoke = to_streamed_response_wrapper (
317
390
apps .invoke ,
318
391
)
392
+ self .retrieve_invocation = to_streamed_response_wrapper (
393
+ apps .retrieve_invocation ,
394
+ )
319
395
320
396
321
397
class AsyncAppsResourceWithStreamingResponse :
@@ -328,3 +404,6 @@ def __init__(self, apps: AsyncAppsResource) -> None:
328
404
self .invoke = async_to_streamed_response_wrapper (
329
405
apps .invoke ,
330
406
)
407
+ self .retrieve_invocation = async_to_streamed_response_wrapper (
408
+ apps .retrieve_invocation ,
409
+ )
0 commit comments