22
33from __future__ import annotations
44
5- from typing_extensions import Literal
5+ from typing_extensions import Literal , overload
66
77import httpx
88
99from ...._types import NOT_GIVEN , Body , Query , Headers , NotGiven
1010from ...._utils import (
1111 is_given ,
12+ required_args ,
1213 maybe_transform ,
1314 strip_not_given ,
1415 async_maybe_transform ,
@@ -206,10 +207,11 @@ def stop(
206207 cast_to = object ,
207208 )
208209
210+ @overload
209211 def update_task_execution_status (
210212 self ,
211213 * ,
212- body : task_execution_update_task_execution_status_params . Body ,
214+ failure_message : str ,
213215 connect_protocol_version : Literal [1 ],
214216 connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
215217 # 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(
225227 environment executing a task execution is expected to call this function.
226228
227229 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+
228236 connect_protocol_version: Define the version of the Connect protocol
229237
230238 connect_timeout_ms: Define the timeout, in ms
@@ -237,6 +245,60 @@ def update_task_execution_status(
237245
238246 timeout: Override the client-level default timeout for this request, in seconds
239247 """
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 :
240302 extra_headers = {
241303 ** strip_not_given (
242304 {
@@ -249,7 +311,11 @@ def update_task_execution_status(
249311 return self ._post (
250312 "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus" ,
251313 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 ,
253319 ),
254320 options = make_request_options (
255321 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
@@ -430,10 +496,11 @@ async def stop(
430496 cast_to = object ,
431497 )
432498
499+ @overload
433500 async def update_task_execution_status (
434501 self ,
435502 * ,
436- body : task_execution_update_task_execution_status_params . Body ,
503+ failure_message : str ,
437504 connect_protocol_version : Literal [1 ],
438505 connect_timeout_ms : float | NotGiven = NOT_GIVEN ,
439506 # 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(
449516 environment executing a task execution is expected to call this function.
450517
451518 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+
452525 connect_protocol_version: Define the version of the Connect protocol
453526
454527 connect_timeout_ms: Define the timeout, in ms
@@ -461,6 +534,60 @@ async def update_task_execution_status(
461534
462535 timeout: Override the client-level default timeout for this request, in seconds
463536 """
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 :
464591 extra_headers = {
465592 ** strip_not_given (
466593 {
@@ -473,7 +600,11 @@ async def update_task_execution_status(
473600 return await self ._post (
474601 "/gitpod.v1.EnvironmentAutomationService/UpdateTaskExecutionStatus" ,
475602 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 ,
477608 ),
478609 options = make_request_options (
479610 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
0 commit comments