listPreviewRotationShifts method

Future<ListPreviewRotationShiftsResult> listPreviewRotationShifts({
  1. required DateTime endTime,
  2. required List<String> members,
  3. required RecurrenceSettings recurrence,
  4. required String timeZoneId,
  5. int? maxResults,
  6. String? nextToken,
  7. List<PreviewOverride>? overrides,
  8. DateTime? rotationStartTime,
  9. DateTime? startTime,
})

Returns a list of shifts based on rotation configuration parameters.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter endTime : The date and time a rotation shift would end.

Parameter members : The contacts that would be assigned to a rotation.

Parameter recurrence : Information about how long a rotation would last before restarting at the beginning of the shift order.

Parameter timeZoneId : The time zone the rotation’s activity would be based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul".

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

Parameter nextToken : A token to start the list. This token is used to get the next set of results.

Parameter overrides : Information about changes that would be made in a rotation override.

Parameter rotationStartTime : The date and time a rotation would begin. The first shift is calculated from this date and time.

Parameter startTime : Used to filter the range of calculated shifts before sending the response back to the user.

Implementation

Future<ListPreviewRotationShiftsResult> listPreviewRotationShifts({
  required DateTime endTime,
  required List<String> members,
  required RecurrenceSettings recurrence,
  required String timeZoneId,
  int? maxResults,
  String? nextToken,
  List<PreviewOverride>? overrides,
  DateTime? rotationStartTime,
  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.ListPreviewRotationShifts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndTime': unixTimestampToJson(endTime),
      'Members': members,
      'Recurrence': recurrence,
      'TimeZoneId': timeZoneId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (overrides != null) 'Overrides': overrides,
      if (rotationStartTime != null)
        'RotationStartTime': unixTimestampToJson(rotationStartTime),
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
    },
  );

  return ListPreviewRotationShiftsResult.fromJson(jsonResponse.body);
}