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 cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime SIP Media Application Dial-In product type.

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

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

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 {
  final $payload = <String, dynamic>{
    if (callingName != null) 'CallingName': callingName,
    if (productType != null) 'ProductType': productType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/phone-numbers/${Uri.encodeComponent(phoneNumberId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePhoneNumberResponse.fromJson(response);
}