Skip to content

list_preview_rotation_shifts async

list_preview_rotation_shifts(
    end_time: DateTime,
    members: RotationPreviewMemberList,
    time_zone_id: TimeZoneId,
    recurrence: RecurrenceSettings,
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    rotation_start_time: Optional[DateTime] = None,
    start_time: Optional[DateTime] = None,
    overrides: Optional[OverrideList] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListPreviewRotationShiftsResult

Returns a list of shifts based on rotation configuration parameters.

The Incident Manager primarily uses this operation to populate the Preview calendar. It is not typically run by end users.

Parameters:

  • rotation_start_time (Optional[DateTime], default: None ) –

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

  • start_time (Optional[DateTime], default: None ) –

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

  • end_time (DateTime) –

    The date and time a rotation shift would end.

  • members (RotationPreviewMemberList) –

    The contacts that would be assigned to a rotation.

  • time_zone_id (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".

  • recurrence (RecurrenceSettings) –

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

  • overrides (Optional[OverrideList], default: None ) –

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

  • next_token (Optional[PaginationToken], default: None ) –

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

  • max_results (Optional[MaxResults], default: None ) –

    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.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/async_ssm_contacts.py
async def list_preview_rotation_shifts(
    self,
    end_time: "capo_ssm_contacts.types.date_time.DateTime",
    members: "capo_ssm_contacts.types.rotation_preview_member_list.RotationPreviewMemberList",
    time_zone_id: "capo_ssm_contacts.types.time_zone_id.TimeZoneId",
    recurrence: "capo_ssm_contacts.types.recurrence_settings.RecurrenceSettings",
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    rotation_start_time: Optional[
        "capo_ssm_contacts.types.date_time.DateTime"
    ] = None,
    start_time: Optional["capo_ssm_contacts.types.date_time.DateTime"] = None,
    overrides: Optional[
        "capo_ssm_contacts.types.override_list.OverrideList"
    ] = None,
    next_token: Optional[
        "capo_ssm_contacts.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_ssm_contacts.types.max_results.MaxResults"] = None,
) -> "capo_ssm_contacts.types.list_preview_rotation_shifts_result.ListPreviewRotationShiftsResult":
    """<p>Returns a list of shifts based on rotation configuration parameters.</p> <note> <p>The Incident Manager primarily uses this operation to populate the <b>Preview</b> calendar. It is not typically run by end users.</p> </note>

    Args:
        rotation_start_time: <p>The date and time a rotation would begin. The first shift is calculated from this date and time.</p>
        start_time: <p>Used to filter the range of calculated shifts before sending the response back to the user. </p>
        end_time: <p>The date and time a rotation shift would end.</p>
        members: <p>The contacts that would be assigned to a rotation.</p>
        time_zone_id: <p>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". </p>
        recurrence: <p>Information about how long a rotation would last before restarting at the beginning of the shift order.</p>
        overrides: <p>Information about changes that would be made in a rotation override.</p>
        next_token: <p>A token to start the list. This token is used to get the next set of results.</p>
        max_results: <p>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.</p>

    Raises:
        capo_ssm_contacts.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_contacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred while processing the request.</p>
        capo_ssm_contacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_contacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_contacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm_contacts.types.list_preview_rotation_shifts_request.ListPreviewRotationShiftsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm_contacts.types.list_preview_rotation_shifts_result.ListPreviewRotationShiftsResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.list_preview_rotation_shifts

        (
            output,
            http_response,
        ) = await capo_ssm_contacts._operations.ssm_contacts.list_preview_rotation_shifts.async_list_preview_rotation_shifts(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPreviewRotationShifts")
    )
    input_: capo_ssm_contacts.types.list_preview_rotation_shifts_request.ListPreviewRotationShiftsRequest = {
        "end_time": end_time,
        "members": members,
        "time_zone_id": time_zone_id,
        "recurrence": recurrence,
    }
    if rotation_start_time is not None:
        input_["rotation_start_time"] = rotation_start_time
    if start_time is not None:
        input_["start_time"] = start_time
    if overrides is not None:
        input_["overrides"] = overrides
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output