carrierLookup method

Future<CarrierLookupResult> carrierLookup({
  1. required String phoneNumber,
})

Returns information about a destination phone number, including whether the number type and whether it is valid, the carrier, and more.

May throw AccessDeniedException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter phoneNumber : The phone number that you want to retrieve information about. You can provide the phone number in various formats including special characters such as parentheses, brackets, spaces, hyphens, periods, and commas. The service automatically converts the input to E164 format for processing.

Implementation

Future<CarrierLookupResult> carrierLookup({
  required String phoneNumber,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.CarrierLookup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PhoneNumber': phoneNumber,
    },
  );

  return CarrierLookupResult.fromJson(jsonResponse.body);
}