updatePhoneNumberMetadata method

Future<void> updatePhoneNumberMetadata({
  1. required String phoneNumberId,
  2. String? clientToken,
  3. String? phoneNumberDescription,
})

Updates a phone number’s metadata.

May throw AccessDeniedException. May throw IdempotencyException. May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter phoneNumberId : The Amazon Resource Name (ARN) or resource ID of 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 phoneNumberDescription : The description of the phone number.

Implementation

Future<void> updatePhoneNumberMetadata({
  required String phoneNumberId,
  String? clientToken,
  String? phoneNumberDescription,
}) async {
  final $payload = <String, dynamic>{
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (phoneNumberDescription != null)
      'PhoneNumberDescription': phoneNumberDescription,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/phone-number/${Uri.encodeComponent(phoneNumberId)}/metadata',
    exceptionFnMap: _exceptionFns,
  );
}