Skip to content

put_tenant_suppression_attributes async

put_tenant_suppression_attributes(
    tenant_name: TenantName,
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
    suppressed_reasons: Optional[SuppressionListReasons] = None,
    suppression_scope: Optional[SuppressionListScope] = None,
) -> PutTenantSuppressionAttributesResponse

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.

Parameters:

  • tenant_name (TenantName) –

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

  • suppressed_reasons (Optional[SuppressionListReasons], default: None ) –

    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.

  • suppression_scope (Optional[SuppressionListScope], default: None ) –

    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.

    If you don't specify a suppression scope, the tenant defaults to ACCOUNT scope and uses the account-level suppression list.

Raises:

Source code in docs_src/capo_sesv2/_services/async_se_sv2.py
async def put_tenant_suppression_attributes(
    self,
    tenant_name: "capo_sesv2.types.tenant_name.TenantName",
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
    suppressed_reasons: Optional[
        "capo_sesv2.types.suppression_list_reasons.SuppressionListReasons"
    ] = None,
    suppression_scope: Optional[
        "capo_sesv2.types.suppression_list_scope.SuppressionListScope"
    ] = None,
) -> "capo_sesv2.types.put_tenant_suppression_attributes_response.PutTenantSuppressionAttributesResponse":
    """<p>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.</p> <p>When you set the suppression scope to <code>TENANT</code>, Amazon SES maintains a separate suppression list for the tenant. When you set the scope to <code>ACCOUNT</code>, the tenant uses the account-level suppression list.</p>

    Args:
        tenant_name: <p>The name of the tenant to configure suppression list preferences for.</p>
        suppressed_reasons: <p>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:</p> <ul> <li> <p> <code>COMPLAINT</code> – Amazon SES adds an email address to the suppression list when a message sent to that address results in a complaint.</p> </li> <li> <p> <code>BOUNCE</code> – Amazon SES adds an email address to the suppression list when a message sent to that address results in a hard bounce.</p> </li> </ul>
        suppression_scope: <p>The suppression scope for the tenant. Specify <code>TENANT</code> to use the tenant's own suppression list, or <code>ACCOUNT</code> to use the account-level suppression list.</p> <note> <p>If you don't specify a suppression scope, the tenant defaults to <code>ACCOUNT</code> scope and uses the account-level suppression list.</p> </note>

    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_tenant_suppression_attributes_request.PutTenantSuppressionAttributesRequest]",
    ) -> AsyncOperationResponse[
        "capo_sesv2.types.put_tenant_suppression_attributes_response.PutTenantSuppressionAttributesResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.put_tenant_suppression_attributes

        (
            output,
            http_response,
        ) = await capo_sesv2._operations.simple_email_service_v2.put_tenant_suppression_attributes.async_put_tenant_suppression_attributes(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutTenantSuppressionAttributes")
    )
    input_: capo_sesv2.types.put_tenant_suppression_attributes_request.PutTenantSuppressionAttributesRequest = {
        "tenant_name": tenant_name
    }
    if suppressed_reasons is not None:
        input_["suppressed_reasons"] = suppressed_reasons
    if suppression_scope is not None:
        input_["suppression_scope"] = suppression_scope

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output