listRotationShifts method

Future<ListRotationShiftsResult> listRotationShifts({
  1. required DateTime endTime,
  2. required String rotationId,
  3. int? maxResults,
  4. String? nextToken,
  5. DateTime? startTime,
})

Returns a list of shifts generated by an existing rotation in the system.

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

Parameter endTime : The date and time for the end of the time range to list shifts for.

Parameter rotationId : The Amazon Resource Name (ARN) of the rotation to retrieve shift information about.

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : A token to start the list. Use this token to get the next set of results.

Parameter startTime : The date and time for the beginning of the time range to list shifts for.

Implementation

Future<ListRotationShiftsResult> listRotationShifts({
  required DateTime endTime,
  required String rotationId,
  int? maxResults,
  String? nextToken,
  DateTime? startTime,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SSMContacts.ListRotationShifts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndTime': unixTimestampToJson(endTime),
      'RotationId': rotationId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
    },
  );

  return ListRotationShiftsResult.fromJson(jsonResponse.body);
}