Skip to content

list_rotation_shifts

list_rotation_shifts(
    rotation_id: SsmContactsArn,
    end_time: DateTime,
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    start_time: Optional[DateTime] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListRotationShiftsResult

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

Parameters:

  • rotation_id (SsmContactsArn) –

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

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

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

  • end_time (DateTime) –

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

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

    A token to start the list. Use this token 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 you can specify in a subsequent call to get the next set of results.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/ssm_contacts.py
def list_rotation_shifts(
    self,
    rotation_id: "capo_ssm_contacts.types.ssm_contacts_arn.SsmContactsArn",
    end_time: "capo_ssm_contacts.types.date_time.DateTime",
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    start_time: Optional["capo_ssm_contacts.types.date_time.DateTime"] = 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_rotation_shifts_result.ListRotationShiftsResult":
    """<p>Returns a list of shifts generated by an existing rotation in the system.</p>

    Args:
        rotation_id: <p>The Amazon Resource Name (ARN) of the rotation to retrieve shift information about. </p>
        start_time: <p>The date and time for the beginning of the time range to list shifts for.</p>
        end_time: <p>The date and time for the end of the time range to list shifts for.</p>
        next_token: <p>A token to start the list. Use this token 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 you can specify 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.conflict_exception.ConflictException: <p>Updating or deleting a resource causes an inconsistent state.</p>
        capo_ssm_contacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred while processing the request.</p>
        capo_ssm_contacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</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.
    """

    def _handler(
        req: "OperationRequest[capo_ssm_contacts.types.list_rotation_shifts_request.ListRotationShiftsRequest]",
    ) -> OperationResponse[
        "capo_ssm_contacts.types.list_rotation_shifts_result.ListRotationShiftsResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.list_rotation_shifts

        output, http_response = (
            capo_ssm_contacts._operations.ssm_contacts.list_rotation_shifts.list_rotation_shifts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRotationShifts")
    )
    input_: capo_ssm_contacts.types.list_rotation_shifts_request.ListRotationShiftsRequest = {
        "rotation_id": rotation_id,
        "end_time": end_time,
    }
    if start_time is not None:
        input_["start_time"] = start_time
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output