modifyScheduledAction method

Future<ScheduledAction> modifyScheduledAction({
  1. required String scheduledActionName,
  2. bool? enable,
  3. DateTime? endTime,
  4. String? iamRole,
  5. String? schedule,
  6. String? scheduledActionDescription,
  7. DateTime? startTime,
  8. ScheduledActionType? targetAction,
})

Modifies a scheduled action.

May throw ScheduledActionNotFoundFault. May throw ScheduledActionTypeUnsupportedFault. May throw InvalidScheduleFault. May throw InvalidScheduledActionFault. May throw UnauthorizedOperation.

Parameter scheduledActionName : The name of the scheduled action to modify.

Parameter enable : A modified enable flag of the scheduled action. If true, the scheduled action is active. If false, the scheduled action is disabled.

Parameter endTime : A modified end time of the scheduled action. For more information about this parameter, see ScheduledAction.

Parameter iamRole : A different IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction.

Parameter schedule : A modified schedule in either at( ) or cron( ) format. For more information about this parameter, see ScheduledAction.

Parameter scheduledActionDescription : A modified description of the scheduled action.

Parameter startTime : A modified start time of the scheduled action. For more information about this parameter, see ScheduledAction.

Parameter targetAction : A modified JSON format of the scheduled action. For more information about this parameter, see ScheduledAction.

Implementation

Future<ScheduledAction> modifyScheduledAction({
  required String scheduledActionName,
  bool? enable,
  DateTime? endTime,
  String? iamRole,
  String? schedule,
  String? scheduledActionDescription,
  DateTime? startTime,
  ScheduledActionType? targetAction,
}) async {
  ArgumentError.checkNotNull(scheduledActionName, 'scheduledActionName');
  _s.validateStringLength(
    'scheduledActionName',
    scheduledActionName,
    0,
    2147483647,
    isRequired: true,
  );
  _s.validateStringLength(
    'iamRole',
    iamRole,
    0,
    2147483647,
  );
  _s.validateStringLength(
    'schedule',
    schedule,
    0,
    2147483647,
  );
  _s.validateStringLength(
    'scheduledActionDescription',
    scheduledActionDescription,
    0,
    2147483647,
  );
  final $request = <String, dynamic>{};
  $request['ScheduledActionName'] = scheduledActionName;
  enable?.also((arg) => $request['Enable'] = arg);
  endTime?.also((arg) => $request['EndTime'] = _s.iso8601ToJson(arg));
  iamRole?.also((arg) => $request['IamRole'] = arg);
  schedule?.also((arg) => $request['Schedule'] = arg);
  scheduledActionDescription
      ?.also((arg) => $request['ScheduledActionDescription'] = arg);
  startTime?.also((arg) => $request['StartTime'] = _s.iso8601ToJson(arg));
  targetAction?.also((arg) => $request['TargetAction'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ModifyScheduledAction',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyScheduledActionMessage'],
    shapes: shapes,
    resultWrapper: 'ModifyScheduledActionResult',
  );
  return ScheduledAction.fromXml($result);
}