Adds an email address to 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 address is added to the account-level suppression list.
Parameters:
-
email_address
(EmailAddress)
–
The email address that should be added to the suppression list for your account or for the specified tenant.
-
reason
(SuppressionListReason)
–
The factors that should cause the email address to be added to the suppression list for your account or for the specified tenant.
-
tenant_name
(Optional[TenantName], default:
None
)
–
The name of the tenant whose suppression list you want to add the address to. If you omit this parameter, the address is added to the account-level suppression list.
Raises:
Source code in docs_src/capo_sesv2/_services/async_se_sv2.py
| async def put_suppressed_destination(
self,
email_address: "capo_sesv2.types.email_address.EmailAddress",
reason: "capo_sesv2.types.suppression_list_reason.SuppressionListReason",
*,
config_overrides: Optional[AsyncSESv2ClientConfig] = None,
tenant_name: Optional["capo_sesv2.types.tenant_name.TenantName"] = None,
) -> "capo_sesv2.types.put_suppressed_destination_response.PutSuppressedDestinationResponse":
"""<p>Adds an email address to the suppression list for your account or for a specific tenant. To target a tenant's suppression list, specify the <code>TenantName</code> parameter. If you omit <code>TenantName</code>, the address is added to the account-level suppression list.</p>
Args:
email_address: <p>The email address that should be added to the suppression list for your account or for the specified tenant.</p>
reason: <p>The factors that should cause the email address to be added to the suppression list for your account or for the specified tenant.</p>
tenant_name: <p>The name of the tenant whose suppression list you want to add the address to. If you omit this parameter, the address is added to the account-level suppression list.</p>
Raises:
capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sesv2.types.put_suppressed_destination_request.PutSuppressedDestinationRequest]",
) -> AsyncOperationResponse[
"capo_sesv2.types.put_suppressed_destination_response.PutSuppressedDestinationResponse"
]:
import capo_sesv2._operations.simple_email_service_v2.put_suppressed_destination
(
output,
http_response,
) = await capo_sesv2._operations.simple_email_service_v2.put_suppressed_destination.async_put_suppressed_destination(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutSuppressedDestination")
)
input_: capo_sesv2.types.put_suppressed_destination_request.PutSuppressedDestinationRequest = {
"email_address": email_address,
"reason": reason,
}
if tenant_name is not None:
input_["tenant_name"] = tenant_name
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|