createTenant method

Future<CreateTenantResponse> createTenant({
  1. required String tenantName,
  2. TenantSuppressionAttributes? suppressionAttributes,
  3. List<Tag>? tags,
})

Create a tenant.

Tenants are logical containers that group related SES resources together. Each tenant can have its own set of resources like email identities, configuration sets, and templates, along with reputation metrics and sending status. This helps isolate and manage email sending for different customers or business units within your Amazon SES API v2 account.

You can optionally specify SuppressionAttributes to configure tenant-level suppression at creation time. When tenant-level suppression is enabled, Amazon SES maintains a separate suppression list for the tenant instead of using the account-level suppression list.

May throw AlreadyExistsException. May throw BadRequestException. May throw LimitExceededException. May throw TooManyRequestsException.

Parameter tenantName : The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.

Parameter suppressionAttributes : An object that contains information about the suppression list preferences for the tenant. Use this to configure tenant-level suppression at creation time.

Parameter tags : An array of objects that define the tags (keys and values) to associate with the tenant

Implementation

Future<CreateTenantResponse> createTenant({
  required String tenantName,
  TenantSuppressionAttributes? suppressionAttributes,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'TenantName': tenantName,
    if (suppressionAttributes != null)
      'SuppressionAttributes': suppressionAttributes,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v2/email/tenants',
    exceptionFnMap: _exceptionFns,
  );
  return CreateTenantResponse.fromJson(response);
}