createRotationOverride method

Future<CreateRotationOverrideResult> createRotationOverride({
  1. required DateTime endTime,
  2. required List<String> newContactIds,
  3. required String rotationId,
  4. required DateTime startTime,
  5. String? idempotencyToken,
})

Creates an override for a rotation in an on-call schedule.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter endTime : The date and time when the override ends.

Parameter newContactIds : The Amazon Resource Names (ARNs) of the contacts to replace those in the current on-call rotation with.

If you want to include any current team members in the override shift, you must include their ARNs in the new contact ID list.

Parameter rotationId : The Amazon Resource Name (ARN) of the rotation to create an override for.

Parameter startTime : The date and time when the override goes into effect.

Parameter idempotencyToken : A token that ensures that the operation is called only once with the specified details.

Implementation

Future<CreateRotationOverrideResult> createRotationOverride({
  required DateTime endTime,
  required List<String> newContactIds,
  required String rotationId,
  required DateTime startTime,
  String? idempotencyToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SSMContacts.CreateRotationOverride'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndTime': unixTimestampToJson(endTime),
      'NewContactIds': newContactIds,
      'RotationId': rotationId,
      'StartTime': unixTimestampToJson(startTime),
      if (idempotencyToken != null) 'IdempotencyToken': idempotencyToken,
    },
  );

  return CreateRotationOverrideResult.fromJson(jsonResponse.body);
}