1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`ListUsers`](crate::operation::list_users::builders::ListUsersFluentBuilder) operation.
    /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_users::builders::ListUsersFluentBuilder::into_paginator).
    ///
    /// - The fluent builder is configurable:
    ///   - [`user_pool_id(impl Into<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::user_pool_id) / [`set_user_pool_id(Option<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_user_pool_id):<br>required: **true**<br><p>The user pool ID for the user pool on which the search should be performed.</p><br>
    ///   - [`attributes_to_get(impl Into<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::attributes_to_get) / [`set_attributes_to_get(Option<Vec::<String>>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_attributes_to_get):<br>required: **false**<br><p>A JSON array of user attribute names, for example <code>given_name</code>, that you want Amazon Cognito to include in the response for each user. When you don't provide an <code>AttributesToGet</code> parameter, Amazon Cognito returns all attributes for each user.</p> <p>Use <code>AttributesToGet</code> with required attributes in your user pool, or in conjunction with <code>Filter</code>. Amazon Cognito returns an error if not all users in the results have set a value for the attribute you request. Attributes that you can't filter on, including custom attributes, must have a value set in every user profile before an <code>AttributesToGet</code> parameter returns results.</p><br>
    ///   - [`limit(i32)`](crate::operation::list_users::builders::ListUsersFluentBuilder::limit) / [`set_limit(Option<i32>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_limit):<br>required: **false**<br><p>Maximum number of users to be returned.</p><br>
    ///   - [`pagination_token(impl Into<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::pagination_token) / [`set_pagination_token(Option<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_pagination_token):<br>required: **false**<br><p>This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.</p><br>
    ///   - [`filter(impl Into<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::filter) / [`set_filter(Option<String>)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_filter):<br>required: **false**<br><p>A filter string of the form "<i>AttributeName</i> <i>Filter-Type</i> "<i>AttributeValue</i>"". Quotation marks within the filter string must be escaped using the backslash (\) character. For example, "<code>family_name</code> = \"Reddy\"".</p> <ul>  <li>   <p><i>AttributeName</i>: The name of the attribute to search for. You can only search for one attribute at a time.</p></li>  <li>   <p><i>Filter-Type</i>: For an exact match, use =, for example, "<code>given_name</code> = \"Jon\"". For a prefix ("starts with") match, use ^=, for example, "<code>given_name</code> ^= \"Jon\"".</p></li>  <li>   <p><i>AttributeValue</i>: The attribute value that must be matched for each user.</p></li> </ul> <p>If the filter string is empty, <code>ListUsers</code> returns all users in the user pool.</p> <p>You can only search for the following standard attributes:</p> <ul>  <li>   <p><code>username</code> (case-sensitive)</p></li>  <li>   <p><code>email</code></p></li>  <li>   <p><code>phone_number</code></p></li>  <li>   <p><code>name</code></p></li>  <li>   <p><code>given_name</code></p></li>  <li>   <p><code>family_name</code></p></li>  <li>   <p><code>preferred_username</code></p></li>  <li>   <p><code>cognito:user_status</code> (called <b>Status</b> in the Console) (case-insensitive)</p></li>  <li>   <p><code>status (called <b>Enabled</b> in the Console) (case-sensitive)</code></p></li>  <li>   <p><code>sub</code></p></li> </ul> <p>Custom attributes aren't searchable.</p><note>  <p>You can also list users with a client-side filter. The server-side filter matches no more than one attribute. For an advanced search, use a client-side filter with the <code>--query</code> parameter of the <code>list-users</code> action in the CLI. When you use a client-side filter, ListUsers returns a paginated list of zero or more users. You can receive multiple pages in a row with zero results. Repeat the query with each pagination token that is returned until you receive a null pagination token value, and then review the combined result.</p>  <p>For more information about server-side and client-side filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">FilteringCLI output</a> in the <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Command Line Interface User Guide</a>.</p> </note> <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-using-listusers-api">Searching for Users Using the ListUsers API</a> and <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-listusers-api-examples">Examples of Using the ListUsers API</a> in the <i>Amazon Cognito Developer Guide</i>.</p><br>
    /// - On success, responds with [`ListUsersOutput`](crate::operation::list_users::ListUsersOutput) with field(s):
    ///   - [`users(Option<Vec::<UserType>>)`](crate::operation::list_users::ListUsersOutput::users): <p>A list of the user pool users, and their attributes, that match your query.</p><note>  <p>Amazon Cognito creates a profile in your user pool for each native user in your user pool, and each unique user ID from your third-party identity providers (IdPs). When you link users with the <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminLinkProviderForUser.html">AdminLinkProviderForUser</a> API operation, the output of <code>ListUsers</code> displays both the IdP user and the native user that you linked. You can identify IdP users in the <code>Users</code> object of this API response by the IdP prefix that Amazon Cognito appends to <code>Username</code>.</p> </note>
    ///   - [`pagination_token(Option<String>)`](crate::operation::list_users::ListUsersOutput::pagination_token): <p>The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.</p>
    /// - On failure, responds with [`SdkError<ListUsersError>`](crate::operation::list_users::ListUsersError)
    pub fn list_users(&self) -> crate::operation::list_users::builders::ListUsersFluentBuilder {
        crate::operation::list_users::builders::ListUsersFluentBuilder::new(self.handle.clone())
    }
}