ConnectScheduling / Client / get_time_off

get_time_off

ConnectScheduling.Client.get_time_off(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.get_time_off(
    InstanceId='string',
    UserId='string',
    TimeOffId='string'
)
Parameters:
  • InstanceId (string) –

    [REQUIRED]

    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.

  • UserId (string) –

    [REQUIRED]

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

  • TimeOffId (string) –

    [REQUIRED]

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

Return type:

dict

Returns:

Response Syntax

{
    'TimeOffId': 'string',
    'UserId': 'string',
    'ShiftActivityId': 'string',
    'StartAt': datetime(2015, 1, 1),
    'EndAt': datetime(2015, 1, 1),
    'Status': 'PENDING'|'APPROVED'|'REJECTED'|'CANCELLED'|'AWAITING_APPROVAL',
    'Description': 'string',
    'ValidationResults': [
        {
            'Severity': 'WARNING'|'ERROR',
            'Code': 'INSUFFICIENT_USER_TIME_OFF_BALANCE'|'INSUFFICIENT_GROUP_TIME_OFF_ALLOWANCE'|'INSUFFICIENT_STAFFING_GROUP_TIME_OFF_ALLOWANCE'|'CONFLICTING_TIME_OFF_REQUEST'
        },
    ],
    'CreatedBy': {
        'ConnectUserArn': 'string',
        'AWSIdentityArn': 'string'
    },
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedBy': {
        'ConnectUserArn': 'string',
        'AWSIdentityArn': 'string'
    },
    'UpdatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    The response for GetTimeOff.

    • TimeOffId (string) –

      The identifier of the time off request.

    • UserId (string) –

      The identifier of the user the time off is for.

    • ShiftActivityId (string) –

      The identifier of the shift activity for the time off request.

    • StartAt (datetime) –

      The start of the time off window, inclusive, as sent to CreateTimeOff.

    • EndAt (datetime) –

      The end of the time off window, exclusive, as sent to CreateTimeOff.

    • Status (string) –

      The status of the time off request.

      • PENDING: Connect Customer is processing a change to the request, which then changes to another status. An edit in the Connect Customer admin website can also make a request PENDING, so an APPROVED request can become PENDING and then end APPROVED or REJECTED.

      • AWAITING_APPROVAL: the request is waiting for an ApproveTimeOff or RejectTimeOff call.

    • Description (string) –

      The description of the time off request. CreateTimeOff sets it, and CancelTimeOff replaces or removes it. An edit in the Connect Customer admin website can also change it. GetTimeOff doesn’t return descriptions sent with ApproveTimeOff or RejectTimeOff.

    • ValidationResults (list) –

      Warnings or failures produced while processing the time off request.

      • (dict) –

        A warning or failure produced while processing the time off request.

        • Severity (string) –

          The severity of the validation result. WARNING is a breach of the configured rules that is not enough to reject the request, either because of the rules configuration or because the caller sent RuleFailureAction OVERRIDE. ERROR is a reason the request was rejected.

        • Code (string) –

          The specific reason for the validation result. New values may be added, so treat an unrecognized value as a generic failure of the reported severity.

          • INSUFFICIENT_USER_TIME_OFF_BALANCE: the user’s time off balance for the activity is less than the time this request deducts. Connect Customer deducts only working time in the window. For details, see How the system calculates time off deductions in the Connect Customer Administrator Guide.

          • INSUFFICIENT_GROUP_TIME_OFF_ALLOWANCE: the time off allowance of the user’s forecast group or demand group for the activity is too low for this request.

          • INSUFFICIENT_STAFFING_GROUP_TIME_OFF_ALLOWANCE: the daily time off allowance of the user’s staffing group for the activity is too low for this request.

          • CONFLICTING_TIME_OFF_REQUEST: the request overlaps another time off request for the user that is APPROVED or being approved. Requests in AWAITING_APPROVAL don’t count. For CreateTimeOff with AUTOMATIC, overlapping overtime and voluntary time off also count.

    • CreatedBy (dict) –

      The identity that created the request. Immutable for the life of the request.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: ConnectUserArn, AWSIdentityArn. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
      
      • ConnectUserArn (string) –

        The ARN of the Connect Customer user who performed the action.

      • AWSIdentityArn (string) –

        The IAM or AWS STS ARN of the identity that performed the action. Present when that identity is not a Connect Customer user.

    • CreatedAt (datetime) –

      The timestamp when the time off request was created.

    • UpdatedBy (dict) –

      The identity that made the most recent ApproveTimeOff, RejectTimeOff, or CancelTimeOff call on the request, or took the same action in the Connect Customer admin website. Absent until one of those actions is taken, including after Connect Customer decides an AUTOMATIC request. UpdatedAt also changes when a PENDING request changes to another status and for other edits, which don’t set UpdatedBy.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: ConnectUserArn, AWSIdentityArn. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
      
      • ConnectUserArn (string) –

        The ARN of the Connect Customer user who performed the action.

      • AWSIdentityArn (string) –

        The IAM or AWS STS ARN of the identity that performed the action. Present when that identity is not a Connect Customer user.

    • UpdatedAt (datetime) –

      The timestamp when the time off request was last modified.

Exceptions