Skip to content

list_tenants

list_tenants(
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    filter: Optional[ListTenantsFilter] = None,
    next_token: Optional[NextToken] = None,
    page_size: Optional[MaxItems] = None,
) -> ListTenantsResponse

List all tenants associated with your account in the current Amazon Web Services Region.

This operation returns basic information about each tenant, such as tenant name, ID, ARN, and creation timestamp.

Parameters:

  • filter (Optional[ListTenantsFilter], default: None ) –

    An object that contains filters to apply when listing tenants. You can filter by a substring of the tenant name or by sending status.

  • next_token (Optional[NextToken], default: None ) –

    A token returned from a previous call to ListTenants to indicate the position in the list of tenants.

  • page_size (Optional[MaxItems], default: None ) –

    The number of results to show in a single call to ListTenants. 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.

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def list_tenants(
    self,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    filter: Optional[
        "capo_sesv2.types.list_tenants_filter.ListTenantsFilter"
    ] = None,
    next_token: Optional["capo_sesv2.types.next_token.NextToken"] = None,
    page_size: Optional["capo_sesv2.types.max_items.MaxItems"] = None,
) -> "capo_sesv2.types.list_tenants_response.ListTenantsResponse":
    """<p>List all tenants associated with your account in the current Amazon Web Services Region.</p> <p>This operation returns basic information about each tenant, such as tenant name, ID, ARN, and creation timestamp.</p>

    Args:
        filter: <p>An object that contains filters to apply when listing tenants. You can filter by a substring of the tenant name or by sending status.</p>
        next_token: <p>A token returned from a previous call to <code>ListTenants</code> to indicate the position in the list of tenants.</p>
        page_size: <p>The number of results to show in a single call to <code>ListTenants</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>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</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_tenants_request.ListTenantsRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.list_tenants_response.ListTenantsResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.list_tenants

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.list_tenants.list_tenants(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTenants")
    )
    input_: capo_sesv2.types.list_tenants_request.ListTenantsRequest = {}
    if filter is not None:
        input_["filter"] = filter
    if next_token is not None:
        input_["next_token"] = next_token
    if page_size is not None:
        input_["page_size"] = page_size

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output