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.
Parameters:
-
tenant_name
(TenantName)
–
The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.
-
tags
(Optional[TagList], default:
None
)
–
An array of objects that define the tags (keys and values) to associate with the tenant
-
suppression_attributes
(Optional[TenantSuppressionAttributes], default:
None
)
–
An object that contains information about the suppression list preferences for the tenant. Use this to configure tenant-level suppression at creation time.
Raises:
Source code in docs_src/capo_sesv2/_services/se_sv2.py
| def create_tenant(
self,
tenant_name: "capo_sesv2.types.tenant_name.TenantName",
*,
config_overrides: Optional[SESv2ClientConfig] = None,
tags: Optional["capo_sesv2.types.tag_list.TagList"] = None,
suppression_attributes: Optional[
"capo_sesv2.types.tenant_suppression_attributes.TenantSuppressionAttributes"
] = None,
) -> "capo_sesv2.types.create_tenant_response.CreateTenantResponse":
"""<p>Create a tenant.</p> <p> <i>Tenants</i> 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.</p> <p>You can optionally specify <code>SuppressionAttributes</code> 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.</p>
Args:
tenant_name: <p>The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.</p>
tags: <p>An array of objects that define the tags (keys and values) to associate with the tenant</p>
suppression_attributes: <p>An object that contains information about the suppression list preferences for the tenant. Use this to configure tenant-level suppression at creation time.</p>
Raises:
capo_sesv2.errors.already_exists_exception.AlreadyExistsException: <p>The resource specified in your request already exists.</p>
capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
capo_sesv2.errors.limit_exceeded_exception.LimitExceededException: <p>There are too many instances of the specified resource type.</p>
capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sesv2.types.create_tenant_request.CreateTenantRequest]",
) -> OperationResponse[
"capo_sesv2.types.create_tenant_response.CreateTenantResponse"
]:
import capo_sesv2._operations.simple_email_service_v2.create_tenant
output, http_response = (
capo_sesv2._operations.simple_email_service_v2.create_tenant.create_tenant(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateTenant")
)
input_: capo_sesv2.types.create_tenant_request.CreateTenantRequest = {
"tenant_name": tenant_name
}
if tags is not None:
input_["tags"] = tags
if suppression_attributes is not None:
input_["suppression_attributes"] = suppression_attributes
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|