updatePhoneNumber method

Future<UpdatePhoneNumberResponse> updatePhoneNumber({
  1. required String phoneNumberId,
  2. String? callingName,
  3. PhoneNumberProductType? productType,
})

Updates phone number details, such as product type or calling name, for the specified phone number ID. You can update one phone number detail at a time. For example, you can update either the product type or the calling name in one action.

For toll-free numbers, you must use the Amazon Chime Voice Connector product type.

Updates to outbound calling names can take up to 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update.

May throw UnauthorizedClientException. May throw NotFoundException. May throw ForbiddenException. May throw BadRequestException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter phoneNumberId : The phone number ID.

Parameter callingName : The outbound calling name associated with the phone number.

Parameter productType : The product type.

Implementation

Future<UpdatePhoneNumberResponse> updatePhoneNumber({
  required String phoneNumberId,
  String? callingName,
  PhoneNumberProductType? productType,
}) async {
  ArgumentError.checkNotNull(phoneNumberId, 'phoneNumberId');
  final $payload = <String, dynamic>{
    if (callingName != null) 'CallingName': callingName,
    if (productType != null) 'ProductType': productType.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/phone-numbers/${Uri.encodeComponent(phoneNumberId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePhoneNumberResponse.fromJson(response);
}