#[non_exhaustive]pub struct ListUsersInput {
pub user_pool_id: Option<String>,
pub attributes_to_get: Option<Vec<String>>,
pub limit: Option<i32>,
pub pagination_token: Option<String>,
pub filter: Option<String>,
}
Expand description
Represents the request to list users.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.user_pool_id: Option<String>
The user pool ID for the user pool on which the search should be performed.
attributes_to_get: Option<Vec<String>>
A JSON array of user attribute names, for example given_name
, that you want Amazon Cognito to include in the response for each user. When you don't provide an AttributesToGet
parameter, Amazon Cognito returns all attributes for each user.
Use AttributesToGet
with required attributes in your user pool, or in conjunction with Filter
. 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 AttributesToGet
parameter returns results.
limit: Option<i32>
Maximum number of users to be returned.
pagination_token: Option<String>
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.
filter: Option<String>
A filter string of the form "AttributeName Filter-Type "AttributeValue"". Quotation marks within the filter string must be escaped using the backslash (\
) character. For example, "family_name = \"Reddy\""
.
-
AttributeName: The name of the attribute to search for. You can only search for one attribute at a time.
-
Filter-Type: For an exact match, use
=
, for example, "given_name = \"Jon\"
". For a prefix ("starts with") match, use^=
, for example, "given_name ^= \"Jon\"
". -
AttributeValue: The attribute value that must be matched for each user.
If the filter string is empty, ListUsers
returns all users in the user pool.
You can only search for the following standard attributes:
-
username
(case-sensitive) -
email
-
phone_number
-
name
-
given_name
-
family_name
-
preferred_username
-
cognito:user_status
(called Status in the Console) (case-insensitive) -
status (called Enabled in the Console) (case-sensitive)
-
sub
Custom attributes aren't searchable.
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 --query
parameter of the list-users
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.
For more information about server-side and client-side filtering, see FilteringCLI output in the Command Line Interface User Guide.
For more information, see Searching for Users Using the ListUsers API and Examples of Using the ListUsers API in the Amazon Cognito Developer Guide.
Implementations§
source§impl ListUsersInput
impl ListUsersInput
sourcepub fn user_pool_id(&self) -> Option<&str>
pub fn user_pool_id(&self) -> Option<&str>
The user pool ID for the user pool on which the search should be performed.
sourcepub fn attributes_to_get(&self) -> &[String]
pub fn attributes_to_get(&self) -> &[String]
A JSON array of user attribute names, for example given_name
, that you want Amazon Cognito to include in the response for each user. When you don't provide an AttributesToGet
parameter, Amazon Cognito returns all attributes for each user.
Use AttributesToGet
with required attributes in your user pool, or in conjunction with Filter
. 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 AttributesToGet
parameter returns results.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .attributes_to_get.is_none()
.
sourcepub fn pagination_token(&self) -> Option<&str>
pub fn pagination_token(&self) -> Option<&str>
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.
sourcepub fn filter(&self) -> Option<&str>
pub fn filter(&self) -> Option<&str>
A filter string of the form "AttributeName Filter-Type "AttributeValue"". Quotation marks within the filter string must be escaped using the backslash (\
) character. For example, "family_name = \"Reddy\""
.
-
AttributeName: The name of the attribute to search for. You can only search for one attribute at a time.
-
Filter-Type: For an exact match, use
=
, for example, "given_name = \"Jon\"
". For a prefix ("starts with") match, use^=
, for example, "given_name ^= \"Jon\"
". -
AttributeValue: The attribute value that must be matched for each user.
If the filter string is empty, ListUsers
returns all users in the user pool.
You can only search for the following standard attributes:
-
username
(case-sensitive) -
email
-
phone_number
-
name
-
given_name
-
family_name
-
preferred_username
-
cognito:user_status
(called Status in the Console) (case-insensitive) -
status (called Enabled in the Console) (case-sensitive)
-
sub
Custom attributes aren't searchable.
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 --query
parameter of the list-users
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.
For more information about server-side and client-side filtering, see FilteringCLI output in the Command Line Interface User Guide.
For more information, see Searching for Users Using the ListUsers API and Examples of Using the ListUsers API in the Amazon Cognito Developer Guide.
source§impl ListUsersInput
impl ListUsersInput
sourcepub fn builder() -> ListUsersInputBuilder
pub fn builder() -> ListUsersInputBuilder
Creates a new builder-style object to manufacture ListUsersInput
.
Trait Implementations§
source§impl Clone for ListUsersInput
impl Clone for ListUsersInput
source§fn clone(&self) -> ListUsersInput
fn clone(&self) -> ListUsersInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ListUsersInput
impl Debug for ListUsersInput
source§impl PartialEq for ListUsersInput
impl PartialEq for ListUsersInput
source§fn eq(&self, other: &ListUsersInput) -> bool
fn eq(&self, other: &ListUsersInput) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ListUsersInput
Auto Trait Implementations§
impl Freeze for ListUsersInput
impl RefUnwindSafe for ListUsersInput
impl Send for ListUsersInput
impl Sync for ListUsersInput
impl Unpin for ListUsersInput
impl UnwindSafe for ListUsersInput
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more