cancel_time_off
¶
cancel_time_off(
instance_id: InstanceIdOrArn,
user_id: UserIdOrArn,
time_off_id: TimeOffId,
*,
config_overrides: Optional[ConnectSchedulingClientConfig] = None,
description: Optional[Description] = None,
) -> CancelTimeOffResponse
Cancels a time off request.
Cancelling a CANCELLED request succeeds without a change. Returns ConflictException if the request is PENDING, which means Connect Customer is still processing the request asynchronously. Wait until GetTimeOff returns a status other than PENDING, and then retry.
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 unique identifier of the time off request to cancel. If the time off request doesn't belong to
UserId, the operation returnsResourceNotFoundException. -
description(Optional[Description], default:None) –A description recorded with the cancellation. It replaces the description of the time off request. If you omit it, the request's description is removed.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
ConflictException–The request could not be processed because of a conflict with the current state of the resource.
-
InternalServerException–The request processing failed because of an error or failure with the service.
-
ResourceNotFoundException–The specified resource was not found.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To cancel a time off request The following example cancels a time off request and records the reason on the cancellation.
>>> client.cancel_time_off(instance_id='12345678-1234-1234-1234-123456789012', user_id='87654321-4321-4321-4321-210987654321', time_off_id='abcdef12-3456-7890-abcd-ef1234567890', description='Plans changed')
Source code in docs_src/capo_connectscheduling/_services/connect_scheduling.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |