listSuppressedDestinations method

Future<ListSuppressedDestinationsResponse> listSuppressedDestinations({
  1. DateTime? endDate,
  2. String? nextToken,
  3. int? pageSize,
  4. List<SuppressionListReason>? reasons,
  5. DateTime? startDate,
})

Retrieves a list of email addresses that are on the suppression list for your account.

May throw BadRequestException. May throw TooManyRequestsException. May throw InvalidNextTokenException.

Parameter endDate : Used to filter the list of suppressed email destinations so that it only includes addresses that were added to the list before a specific date. The date that you specify should be in Unix time format.

Parameter nextToken : A token returned from a previous call to ListSuppressedDestinations to indicate the position in the list of suppressed email addresses.

Parameter pageSize : The number of results to show in a single call to ListSuppressedDestinations. If the number of results is larger than the number you specified in this parameter, then the response includes a NextToken element, which you can use to obtain additional results.

Parameter reasons : The factors that caused the email address to be added to .

Parameter startDate : Used to filter the list of suppressed email destinations so that it only includes addresses that were added to the list after a specific date. The date that you specify should be in Unix time format.

Implementation

Future<ListSuppressedDestinationsResponse> listSuppressedDestinations({
  DateTime? endDate,
  String? nextToken,
  int? pageSize,
  List<SuppressionListReason>? reasons,
  DateTime? startDate,
}) async {
  final $query = <String, List<String>>{
    if (endDate != null) 'EndDate': [_s.iso8601ToJson(endDate).toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (pageSize != null) 'PageSize': [pageSize.toString()],
    if (reasons != null) 'Reason': reasons.map((e) => e.toValue()).toList(),
    if (startDate != null)
      'StartDate': [_s.iso8601ToJson(startDate).toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/email/suppression/addresses',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListSuppressedDestinationsResponse.fromJson(response);
}