2
2
3
3
from __future__ import annotations
4
4
5
- from typing_extensions import Literal
5
+ from typing_extensions import Literal , overload
6
6
7
7
import httpx
8
8
9
9
from ...._types import NOT_GIVEN , Body , Query , Headers , NotGiven
10
10
from ...._utils import (
11
11
is_given ,
12
+ required_args ,
12
13
maybe_transform ,
13
14
strip_not_given ,
14
15
async_maybe_transform ,
@@ -206,10 +207,11 @@ def stop(
206
207
cast_to = object ,
207
208
)
208
209
210
+ @overload
209
211
def update_task_execution_status (
210
212
self ,
211
213
* ,
212
- body : task_execution_update_task_execution_status_params . Body ,
214
+ failure_message : str ,
213
215
connect_protocol_version : Literal [1 ],
214
216
connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
215
217
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -225,6 +227,12 @@ def update_task_execution_status(
225
227
environment executing a task execution is expected to call this function.
226
228
227
229
Args:
230
+ failure_message: failure_message marks the task execution as failed and provides a message
231
+ explaining the failure.
232
+
233
+ If an individual step has failed, callers are NOT expected to set this message;
234
+ only if the task execution as a whole has failed/cannot be started.
235
+
228
236
connect_protocol_version: Define the version of the Connect protocol
229
237
230
238
connect_timeout_ms: Define the timeout, in ms
@@ -237,6 +245,60 @@ def update_task_execution_status(
237
245
238
246
timeout: Override the client-level default timeout for this request, in seconds
239
247
"""
248
+ ...
249
+
250
+ @overload
251
+ def update_task_execution_status (
252
+ self ,
253
+ * ,
254
+ log_url : str ,
255
+ connect_protocol_version : Literal [1 ],
256
+ connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
257
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
258
+ # The extra values given here take precedence over values defined on the client or passed to this method.
259
+ extra_headers : Headers | None = None ,
260
+ extra_query : Query | None = None ,
261
+ extra_body : Body | None = None ,
262
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
263
+ ) -> object :
264
+ """UpdateTaskExecutionStatus updates the status of a task execution.
265
+
266
+ Only the
267
+ environment executing a task execution is expected to call this function.
268
+
269
+ Args:
270
+ log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task
271
+ either has no logs or has not yet started.
272
+
273
+ connect_protocol_version: Define the version of the Connect protocol
274
+
275
+ connect_timeout_ms: Define the timeout, in ms
276
+
277
+ extra_headers: Send extra headers
278
+
279
+ extra_query: Add additional query parameters to the request
280
+
281
+ extra_body: Add additional JSON properties to the request
282
+
283
+ timeout: Override the client-level default timeout for this request, in seconds
284
+ """
285
+ ...
286
+
287
+ @required_args (["failure_message" , "connect_protocol_version" ], ["log_url" , "connect_protocol_version" ])
288
+ def update_task_execution_status (
289
+ self ,
290
+ * ,
291
+ failure_message : str | NotGiven = NOT_GIVEN ,
292
+ connect_protocol_version : Literal [1 ],
293
+ connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
294
+ log_url : str | NotGiven = NOT_GIVEN ,
295
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
296
+ # The extra values given here take precedence over values defined on the client or passed to this method.
297
+ extra_headers : Headers | None = None ,
298
+ extra_query : Query | None = None ,
299
+ extra_body : Body | None = None ,
300
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
301
+ ) -> object :
240
302
extra_headers = {
241
303
** strip_not_given (
242
304
{
@@ -249,7 +311,11 @@ def update_task_execution_status(
249
311
return self ._post (
250
312
"/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus" ,
251
313
body = maybe_transform (
252
- body , task_execution_update_task_execution_status_params .TaskExecutionUpdateTaskExecutionStatusParams
314
+ {
315
+ "failure_message" : failure_message ,
316
+ "log_url" : log_url ,
317
+ },
318
+ task_execution_update_task_execution_status_params .TaskExecutionUpdateTaskExecutionStatusParams ,
253
319
),
254
320
options = make_request_options (
255
321
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
@@ -430,10 +496,11 @@ async def stop(
430
496
cast_to = object ,
431
497
)
432
498
499
+ @overload
433
500
async def update_task_execution_status (
434
501
self ,
435
502
* ,
436
- body : task_execution_update_task_execution_status_params . Body ,
503
+ failure_message : str ,
437
504
connect_protocol_version : Literal [1 ],
438
505
connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
439
506
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -449,6 +516,12 @@ async def update_task_execution_status(
449
516
environment executing a task execution is expected to call this function.
450
517
451
518
Args:
519
+ failure_message: failure_message marks the task execution as failed and provides a message
520
+ explaining the failure.
521
+
522
+ If an individual step has failed, callers are NOT expected to set this message;
523
+ only if the task execution as a whole has failed/cannot be started.
524
+
452
525
connect_protocol_version: Define the version of the Connect protocol
453
526
454
527
connect_timeout_ms: Define the timeout, in ms
@@ -461,6 +534,60 @@ async def update_task_execution_status(
461
534
462
535
timeout: Override the client-level default timeout for this request, in seconds
463
536
"""
537
+ ...
538
+
539
+ @overload
540
+ async def update_task_execution_status (
541
+ self ,
542
+ * ,
543
+ log_url : str ,
544
+ connect_protocol_version : Literal [1 ],
545
+ connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
546
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
547
+ # The extra values given here take precedence over values defined on the client or passed to this method.
548
+ extra_headers : Headers | None = None ,
549
+ extra_query : Query | None = None ,
550
+ extra_body : Body | None = None ,
551
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
552
+ ) -> object :
553
+ """UpdateTaskExecutionStatus updates the status of a task execution.
554
+
555
+ Only the
556
+ environment executing a task execution is expected to call this function.
557
+
558
+ Args:
559
+ log_url: log_url is the URL to the logs of the task's steps. If this is empty, the task
560
+ either has no logs or has not yet started.
561
+
562
+ connect_protocol_version: Define the version of the Connect protocol
563
+
564
+ connect_timeout_ms: Define the timeout, in ms
565
+
566
+ extra_headers: Send extra headers
567
+
568
+ extra_query: Add additional query parameters to the request
569
+
570
+ extra_body: Add additional JSON properties to the request
571
+
572
+ timeout: Override the client-level default timeout for this request, in seconds
573
+ """
574
+ ...
575
+
576
+ @required_args (["failure_message" , "connect_protocol_version" ], ["log_url" , "connect_protocol_version" ])
577
+ async def update_task_execution_status (
578
+ self ,
579
+ * ,
580
+ failure_message : str | NotGiven = NOT_GIVEN ,
581
+ connect_protocol_version : Literal [1 ],
582
+ connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
583
+ log_url : str | NotGiven = NOT_GIVEN ,
584
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
585
+ # The extra values given here take precedence over values defined on the client or passed to this method.
586
+ extra_headers : Headers | None = None ,
587
+ extra_query : Query | None = None ,
588
+ extra_body : Body | None = None ,
589
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
590
+ ) -> object :
464
591
extra_headers = {
465
592
** strip_not_given (
466
593
{
@@ -473,7 +600,11 @@ async def update_task_execution_status(
473
600
return await self ._post (
474
601
"/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus" ,
475
602
body = await async_maybe_transform (
476
- body , task_execution_update_task_execution_status_params .TaskExecutionUpdateTaskExecutionStatusParams
603
+ {
604
+ "failure_message" : failure_message ,
605
+ "log_url" : log_url ,
606
+ },
607
+ task_execution_update_task_execution_status_params .TaskExecutionUpdateTaskExecutionStatusParams ,
477
608
),
478
609
options = make_request_options (
479
610
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
0 commit comments