listRegistrationAssociations method

Future<ListRegistrationAssociationsResult> listRegistrationAssociations({
  1. required String registrationId,
  2. List<RegistrationAssociationFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Retrieve all of the origination identities that are associated with a registration.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter registrationId : The unique identifier for the registration.

Parameter filters : An array of RegistrationAssociationFilter to apply to the results that are returned.

Parameter maxResults : The maximum number of results to return per each request.

Parameter nextToken : The token to be used for the next set of paginated results. You don't need to supply a value for this field in the initial request.

Implementation

Future<ListRegistrationAssociationsResult> listRegistrationAssociations({
  required String registrationId,
  List<RegistrationAssociationFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.ListRegistrationAssociations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RegistrationId': registrationId,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListRegistrationAssociationsResult.fromJson(jsonResponse.body);
}