listPhoneNumbers method
Lists the phone numbers for the specified Amazon Chime SDK account, Amazon Chime SDK user, Amazon Chime SDK Voice Connector, or Amazon Chime SDK Voice Connector group.
May throw BadRequestException.
May throw ForbiddenException.
May throw NotFoundException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter filterName :
The filter to limit the number of results.
Parameter filterValue :
The filter value.
Parameter maxResults :
The maximum number of results to return in a single call.
Parameter nextToken :
The token used to return the next page of results.
Parameter productType :
The phone number product types.
Parameter status :
The status of your organization's phone numbers.
Implementation
Future<ListPhoneNumbersResponse> listPhoneNumbers({
PhoneNumberAssociationName? filterName,
String? filterValue,
int? maxResults,
String? nextToken,
PhoneNumberProductType? productType,
String? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
if (filterName != null) 'filter-name': [filterName.value],
if (filterValue != null) 'filter-value': [filterValue],
if (maxResults != null) 'max-results': [maxResults.toString()],
if (nextToken != null) 'next-token': [nextToken],
if (productType != null) 'product-type': [productType.value],
if (status != null) 'status': [status],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/phone-numbers',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListPhoneNumbersResponse.fromJson(response);
}