List all resources associated with a specific tenant.
This operation returns a list of resources (email identities, configuration sets, or email templates) that are associated with the specified tenant. You can optionally filter the results by resource type.
Parameters:
-
tenant_name
(TenantName)
–
The name of the tenant to list resources for.
-
filter
(Optional[ListTenantResourcesFilter], default:
None
)
–
A map of filter keys and values for filtering the list of tenant resources. Currently, the only supported filter key is RESOURCE_TYPE.
-
page_size
(Optional[MaxItems], default:
None
)
–
The number of results to show in a single call to ListTenantResources. 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 ListTenantResources to indicate the position in the list of tenant resources.
Raises:
Source code in docs_src/capo_sesv2/_services/se_sv2.py
| def list_tenant_resources(
self,
tenant_name: "capo_sesv2.types.tenant_name.TenantName",
*,
config_overrides: Optional[SESv2ClientConfig] = None,
filter: Optional[
"capo_sesv2.types.list_tenant_resources_filter.ListTenantResourcesFilter"
] = 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_tenant_resources_response.ListTenantResourcesResponse":
"""<p>List all resources associated with a specific tenant.</p> <p>This operation returns a list of resources (email identities, configuration sets, or email templates) that are associated with the specified tenant. You can optionally filter the results by resource type.</p>
Args:
tenant_name: <p>The name of the tenant to list resources for.</p>
filter: <p>A map of filter keys and values for filtering the list of tenant resources. Currently, the only supported filter key is <code>RESOURCE_TYPE</code>.</p>
page_size: <p>The number of results to show in a single call to <code>ListTenantResources</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>ListTenantResources</code> to indicate the position in the list of tenant resources.</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.
"""
def _handler(
req: "OperationRequest[capo_sesv2.types.list_tenant_resources_request.ListTenantResourcesRequest]",
) -> OperationResponse[
"capo_sesv2.types.list_tenant_resources_response.ListTenantResourcesResponse"
]:
import capo_sesv2._operations.simple_email_service_v2.list_tenant_resources
output, http_response = (
capo_sesv2._operations.simple_email_service_v2.list_tenant_resources.list_tenant_resources(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListTenantResources")
)
input_: capo_sesv2.types.list_tenant_resources_request.ListTenantResourcesRequest = {
"tenant_name": tenant_name
}
if filter is not None:
input_["filter"] = filter
if page_size is not None:
input_["page_size"] = page_size
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|