updateTask method

Future<UpdateTaskResponse> updateTask({
  1. required String taskName,
  2. required String workspaceName,
  3. String? description,
  4. TaskConfiguration? taskConfiguration,
})

Updates an existing task in the specified workspace. Only the fields provided in the request are updated; fields not included in the request are preserved unchanged.

May throw AccessDeniedException. May throw ConflictingOperationException. May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter taskName : The name of the task to update.

Parameter workspaceName : The name of the workspace.

Parameter description : A new description for the task.

Parameter taskConfiguration : The updated task execution configuration.

Implementation

Future<UpdateTaskResponse> updateTask({
  required String taskName,
  required String workspaceName,
  String? description,
  TaskConfiguration? taskConfiguration,
}) async {
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (taskConfiguration != null) 'taskConfiguration': taskConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceName)}/tasks/${Uri.encodeComponent(taskName)}',
    hostPrefix: 'api.',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateTaskResponse.fromJson(response);
}