putTenantSuppressionAttributes method

Future<void> putTenantSuppressionAttributes({
  1. required String tenantName,
  2. List<SuppressionListReason>? suppressedReasons,
  3. SuppressionListScope? suppressionScope,
})

Configure the suppression list preferences for a tenant. Use this operation to enable or disable tenant-level suppression, or to change the suppressed reasons for a tenant.

When you set the suppression scope to TENANT, Amazon SES maintains a separate suppression list for the tenant. When you set the scope to ACCOUNT, the tenant uses the account-level suppression list.

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

Parameter tenantName : The name of the tenant to configure suppression list preferences for.

Parameter suppressedReasons : A list that contains the reasons that email addresses are automatically added to the suppression list for the tenant. This list can contain any or all of the following:

  • COMPLAINT – Amazon SES adds an email address to the suppression list when a message sent to that address results in a complaint.
  • BOUNCE – Amazon SES adds an email address to the suppression list when a message sent to that address results in a hard bounce.

Parameter suppressionScope : The suppression scope for the tenant. Specify TENANT to use the tenant's own suppression list, or ACCOUNT to use the account-level suppression list.

Implementation

Future<void> putTenantSuppressionAttributes({
  required String tenantName,
  List<SuppressionListReason>? suppressedReasons,
  SuppressionListScope? suppressionScope,
}) async {
  final $payload = <String, dynamic>{
    'TenantName': tenantName,
    if (suppressedReasons != null)
      'SuppressedReasons': suppressedReasons.map((e) => e.value).toList(),
    if (suppressionScope != null) 'SuppressionScope': suppressionScope.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v2/email/tenant/suppression',
    exceptionFnMap: _exceptionFns,
  );
}