Skip to content

get_time_off

get_time_off(
    instance_id: InstanceIdOrArn,
    user_id: UserIdOrArn,
    time_off_id: TimeOffId,
    *,
    config_overrides: Optional[ConnectSchedulingClientConfig] = None,
) -> GetTimeOffResponse

Returns a time off request, including its current status and validation results.

Parameters:

  • instance_id (InstanceIdOrArn) –

    The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • user_id (UserIdOrArn) –

    The identifier of the user who the time off request belongs to. This can be the ID or the ARN of the user.

  • time_off_id (TimeOffId) –

    The identifier of the time off request. If the time off request doesn't belong to UserId, the operation returns ResourceNotFoundException.

Raises:

Examples:

To get a time off request The following example gets a time off request that was approved past a failed group allowance rule, which is reported as a WARNING.

>>> client.get_time_off(instance_id='12345678-1234-1234-1234-123456789012', user_id='87654321-4321-4321-4321-210987654321', time_off_id='abcdef12-3456-7890-abcd-ef1234567890')
Source code in docs_src/capo_connectscheduling/_services/connect_scheduling.py
def get_time_off(
    self,
    instance_id: "capo_connectscheduling.types.instance_id_or_arn.InstanceIdOrArn",
    user_id: "capo_connectscheduling.types.user_id_or_arn.UserIdOrArn",
    time_off_id: "capo_connectscheduling.types.time_off_id.TimeOffId",
    *,
    config_overrides: Optional[ConnectSchedulingClientConfig] = None,
) -> "capo_connectscheduling.types.get_time_off_response.GetTimeOffResponse":
    """<p>Returns a time off request, including its current status and validation results.</p>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        user_id: <p>The identifier of the user who the time off request belongs to. This can be the ID or the ARN of the user.</p>
        time_off_id: <p>The identifier of the time off request. If the time off request doesn't belong to <code>UserId</code>, the operation returns <code>ResourceNotFoundException</code>.</p>

    Raises:
        capo_connectscheduling.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connectscheduling.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an error or failure with the service.</p>
        capo_connectscheduling.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connectscheduling.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_connectscheduling.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_connectscheduling.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get a time off request
        The following example gets a time off request that was approved past a failed group allowance rule, which is reported as a WARNING.

        >>> client.get_time_off(instance_id='12345678-1234-1234-1234-123456789012', user_id='87654321-4321-4321-4321-210987654321', time_off_id='abcdef12-3456-7890-abcd-ef1234567890')
    """

    def _handler(
        req: "OperationRequest[capo_connectscheduling.types.get_time_off_request.GetTimeOffRequest]",
    ) -> OperationResponse[
        "capo_connectscheduling.types.get_time_off_response.GetTimeOffResponse"
    ]:
        import capo_connectscheduling._operations.amazon_connect_scheduling.get_time_off

        output, http_response = (
            capo_connectscheduling._operations.amazon_connect_scheduling.get_time_off.get_time_off(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_connectscheduling.types.get_time_off_response.GetTimeOffResponse",
    ) -> dict[str, Any]:
        import capo_connectscheduling.types.get_time_off_response

        return capo_connectscheduling.types.get_time_off_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetTimeOff", redact_output=_redact_output),
    )
    input_: capo_connectscheduling.types.get_time_off_request.GetTimeOffRequest = {
        "instance_id": instance_id,
        "user_id": user_id,
        "time_off_id": time_off_id,
    }

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