updatePhoneNumber method
Updates your claimed phone number from its current Connect Customer instance or traffic distribution group to another Connect Customer instance or traffic distribution group in the same Amazon Web Services Region.
You can call DescribePhoneNumber API to verify the status of a previous UpdatePhoneNumber operation.
May throw AccessDeniedException.
May throw IdempotencyException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter phoneNumberId :
A unique identifier for the phone number.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services SDK
populates this field. For more information about idempotency, see Making
retries safe with idempotent APIs.
Parameter instanceId :
The identifier of the Connect Customer instance that phone numbers are
claimed to. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance. You
must enter InstanceId or TargetArn.
Parameter targetArn :
The Amazon Resource Name (ARN) for Connect Customer instances or traffic
distribution groups that phone number inbound traffic is routed through.
You must enter InstanceId or TargetArn.
Implementation
Future<UpdatePhoneNumberResponse> updatePhoneNumber({
required String phoneNumberId,
String? clientToken,
String? instanceId,
String? targetArn,
}) async {
final $payload = <String, dynamic>{
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (instanceId != null) 'InstanceId': instanceId,
if (targetArn != null) 'TargetArn': targetArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/phone-number/${Uri.encodeComponent(phoneNumberId)}',
exceptionFnMap: _exceptionFns,
);
return UpdatePhoneNumberResponse.fromJson(response);
}