ConnectScheduling / Client / approve_time_off
approve_time_off¶
- ConnectScheduling.Client.approve_time_off(**kwargs)¶
Approves a time off request. Evaluates agent time off balances and group time off allowances before approving.
RuleFailureActioncontrols what happens when these evaluations fail. The request is rejected withCONFLICTING_TIME_OFF_REQUESTif it overlaps another time off request for the user that isAPPROVEDor being approved.The time off request is processed asynchronously, so a successful call doesn’t indicate the final status. Read the resulting status with
GetTimeOffor from the time off state-change events.Approving an
APPROVEDrequest succeeds without a change. Approving aREJECTEDrequest evaluates the rules again, so it can endAPPROVEDorREJECTED, and repeating the call can give a different result. Check the status withGetTimeOffbefore you retry.Returns
ConflictExceptionif the request isPENDINGorCANCELLED.PENDINGmeans Connect Customer is still processing the request asynchronously. Wait untilGetTimeOffreturns a status other thanPENDING, and then retry.Warning
When the approval succeeds, Connect Customer cancels any overtime or voluntary time off activity that overlaps the approved window.
Note
Connect Customer doesn’t check whether the principal that calls this operation supervises the user. The staffing group’s approval settings also don’t apply. IAM permissions are the only control. If you allow a principal to call this operation, that principal can send
RuleFailureActionOVERRIDEand approve a request past failed rules. Grant permission for this operation only to principals that you trust to override time off rules.See also: AWS API Documentation
Request Syntax
response = client.approve_time_off( InstanceId='string', UserId='string', TimeOffId='string', Description='string', RuleFailureAction='REJECT'|'OVERRIDE' )
- 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 unique identifier of the time off request to approve. If the time off request doesn’t belong to
UserId, the operation returnsResourceNotFoundException.Description (string) – A description recorded with the approval.
GetTimeOffdoesn’t return it.RuleFailureAction (string) – Controls what happens when a configured rule fails.
REJECT, the default, records anERRORand leaves the requestREJECTED.OVERRIDErecords aWARNINGand approves the request, like the Override time off rules option in the Connect Customer admin website.OVERRIDEnever waivesCONFLICTING_TIME_OFF_REQUEST.
- Return type:
dict
- Returns:
Response Syntax
{}Response Structure
(dict) –
The response for
ApproveTimeOff.
Exceptions