pub struct UserOperations<'a> { /* private fields */ }Expand description
Performs user-management calls against the Identity Toolkit REST API.
Requires an OAuth2 bearer token (obtained from the configured service
account or Application Default Credentials) on every request except when
targeting the Firebase Auth Emulator, which instead requires a key=
query parameter to be present (any value; the emulator does not validate
it) — see crate::auth::mode::ClientMode::emulator_api_key.
Implementations§
Source§impl<'a> UserOperations<'a>
impl<'a> UserOperations<'a>
Sourcepub fn new(
http: &'a HttpClient,
endpoints: &'a IdentityToolkitEndpoints,
bearer_token: Option<&'a str>,
emulator_api_key: Option<&'static str>,
) -> Self
pub fn new( http: &'a HttpClient, endpoints: &'a IdentityToolkitEndpoints, bearer_token: Option<&'a str>, emulator_api_key: Option<&'static str>, ) -> Self
Creates a new set of user operations bound to the given transport and (when talking to production) bearer token, or (when talking to the emulator) dummy API key.
Sourcepub async fn get_user(&self, uid: &str) -> Result<UserRecord, AuthError>
pub async fn get_user(&self, uid: &str) -> Result<UserRecord, AuthError>
Fetches a single user by uid.
Sourcepub async fn get_user_by_email(
&self,
email: &str,
) -> Result<UserRecord, AuthError>
pub async fn get_user_by_email( &self, email: &str, ) -> Result<UserRecord, AuthError>
Fetches a single user by email address.
Sourcepub async fn create_user(
&self,
request: CreateUserRequest,
) -> Result<UserRecord, AuthError>
pub async fn create_user( &self, request: CreateUserRequest, ) -> Result<UserRecord, AuthError>
Creates a new user.
Sourcepub async fn update_user(
&self,
uid: &str,
request: UpdateUserRequest,
) -> Result<UserRecord, AuthError>
pub async fn update_user( &self, uid: &str, request: UpdateUserRequest, ) -> Result<UserRecord, AuthError>
Updates an existing user, including replacing its custom claims.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for UserOperations<'a>
impl<'a> !UnwindSafe for UserOperations<'a>
impl<'a> Freeze for UserOperations<'a>
impl<'a> Send for UserOperations<'a>
impl<'a> Sync for UserOperations<'a>
impl<'a> Unpin for UserOperations<'a>
impl<'a> UnsafeUnpin for UserOperations<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more