listSuppressedDestinations method

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

Retrieves a list of email addresses that are on the suppression list for your account or for a specific tenant. To target a tenant's suppression list, specify the TenantName parameter. If you omit TenantName, the operation targets the account-level suppression list.

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

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.

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 the suppression list for your account or for a specific tenant.

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.

Parameter tenantName : The name of the tenant whose suppression list you want to retrieve. If you omit this parameter, the operation targets the account-level suppression list.

Implementation

Future<ListSuppressedDestinationsResponse> listSuppressedDestinations({
  DateTime? endDate,
  String? nextToken,
  int? pageSize,
  List<SuppressionListReason>? reasons,
  DateTime? startDate,
  String? tenantName,
}) 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.value).toList(),
    if (startDate != null)
      'StartDate': [_s.iso8601ToJson(startDate).toString()],
    if (tenantName != null) 'TenantName': [tenantName],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/email/suppression/addresses',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListSuppressedDestinationsResponse.fromJson(response);
}