updateTask method

Future<void> updateTask({
  1. required String taskArn,
  2. String? cloudWatchLogGroupArn,
  3. List<FilterRule>? excludes,
  4. String? name,
  5. Options? options,
  6. TaskSchedule? schedule,
})

Updates the metadata associated with a task.

May throw InvalidRequestException. May throw InternalException.

Parameter taskArn : The Amazon Resource Name (ARN) of the resource name of the task to update.

Parameter cloudWatchLogGroupArn : The Amazon Resource Name (ARN) of the resource name of the CloudWatch LogGroup.

Parameter excludes : A list of filter rules that determines which files to exclude from a task. The list should contain a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example: "/folder1|/folder2"

Parameter name : The name of the task to update.

Parameter schedule : Specifies a schedule used to periodically transfer files from a source to a destination location. You can configure your task to execute hourly, daily, weekly or on specific days of the week. You control when in the day or hour you want the task to execute. The time you specify is UTC time. For more information, see task-scheduling.

Implementation

Future<void> updateTask({
  required String taskArn,
  String? cloudWatchLogGroupArn,
  List<FilterRule>? excludes,
  String? name,
  Options? options,
  TaskSchedule? schedule,
}) async {
  ArgumentError.checkNotNull(taskArn, 'taskArn');
  _s.validateStringLength(
    'taskArn',
    taskArn,
    0,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'cloudWatchLogGroupArn',
    cloudWatchLogGroupArn,
    0,
    562,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'FmrsService.UpdateTask'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TaskArn': taskArn,
      if (cloudWatchLogGroupArn != null)
        'CloudWatchLogGroupArn': cloudWatchLogGroupArn,
      if (excludes != null) 'Excludes': excludes,
      if (name != null) 'Name': name,
      if (options != null) 'Options': options,
      if (schedule != null) 'Schedule': schedule,
    },
  );
}