Skip to content

delete_tenant_resource_association async

delete_tenant_resource_association(
    tenant_name: TenantName,
    resource_arn: AmazonResourceName,
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
) -> DeleteTenantResourceAssociationResponse

Delete an association between a tenant and a resource.

When you delete a tenant-resource association, the resource itself is not deleted, only its association with the specific tenant is removed. After removal, the resource will no longer be available for use with that tenant's email sending operations.

Parameters:

  • tenant_name (TenantName) –

    The name of the tenant to remove the resource association from.

  • resource_arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) of the resource to remove from the tenant association.

Raises:

Source code in docs_src/capo_sesv2/_services/async_se_sv2.py
async def delete_tenant_resource_association(
    self,
    tenant_name: "capo_sesv2.types.tenant_name.TenantName",
    resource_arn: "capo_sesv2.types.amazon_resource_name.AmazonResourceName",
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
) -> "capo_sesv2.types.delete_tenant_resource_association_response.DeleteTenantResourceAssociationResponse":
    """<p>Delete an association between a tenant and a resource.</p> <p>When you delete a tenant-resource association, the resource itself is not deleted, only its association with the specific tenant is removed. After removal, the resource will no longer be available for use with that tenant's email sending operations.</p>

    Args:
        tenant_name: <p>The name of the tenant to remove the resource association from.</p>
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to remove from the tenant association.</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.delete_tenant_resource_association_request.DeleteTenantResourceAssociationRequest]",
    ) -> AsyncOperationResponse[
        "capo_sesv2.types.delete_tenant_resource_association_response.DeleteTenantResourceAssociationResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.delete_tenant_resource_association

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteTenantResourceAssociation")
    )
    input_: capo_sesv2.types.delete_tenant_resource_association_request.DeleteTenantResourceAssociationRequest = {
        "tenant_name": tenant_name,
        "resource_arn": resource_arn,
    }

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