List all tenants associated with a specific resource.
This operation returns a list of tenants that are associated with the specified resource. This is useful for understanding which tenants are currently using a particular resource such as an email identity, configuration set, or email template.
Parameters:
-
resource_arn
(AmazonResourceName)
–
The Amazon Resource Name (ARN) of the resource to list associated tenants for.
-
page_size
(Optional[MaxItems], default:
None
)
–
The number of results to show in a single call to ListResourceTenants. If the number of results is larger than the number you specified in this parameter, then the response includes a NextToken element, which you can use to obtain additional results.
-
next_token
(Optional[NextToken], default:
None
)
–
A token returned from a previous call to ListResourceTenants to indicate the position in the list of resource tenants.
Raises:
Source code in docs_src/capo_sesv2/_services/async_se_sv2.py
| async def list_resource_tenants(
self,
resource_arn: "capo_sesv2.types.amazon_resource_name.AmazonResourceName",
*,
config_overrides: Optional[AsyncSESv2ClientConfig] = None,
page_size: Optional["capo_sesv2.types.max_items.MaxItems"] = None,
next_token: Optional["capo_sesv2.types.next_token.NextToken"] = None,
) -> "capo_sesv2.types.list_resource_tenants_response.ListResourceTenantsResponse":
"""<p>List all tenants associated with a specific resource.</p> <p>This operation returns a list of tenants that are associated with the specified resource. This is useful for understanding which tenants are currently using a particular resource such as an email identity, configuration set, or email template.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource to list associated tenants for.</p>
page_size: <p>The number of results to show in a single call to <code>ListResourceTenants</code>. If the number of results is larger than the number you specified in this parameter, then the response includes a <code>NextToken</code> element, which you can use to obtain additional results.</p>
next_token: <p>A token returned from a previous call to <code>ListResourceTenants</code> to indicate the position in the list of resource tenants.</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.list_resource_tenants_request.ListResourceTenantsRequest]",
) -> AsyncOperationResponse[
"capo_sesv2.types.list_resource_tenants_response.ListResourceTenantsResponse"
]:
import capo_sesv2._operations.simple_email_service_v2.list_resource_tenants
(
output,
http_response,
) = await capo_sesv2._operations.simple_email_service_v2.list_resource_tenants.async_list_resource_tenants(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListResourceTenants")
)
input_: capo_sesv2.types.list_resource_tenants_request.ListResourceTenantsRequest = {
"resource_arn": resource_arn
}
if page_size is not None:
input_["page_size"] = page_size
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|