pub struct UserClient { /* private fields */ }Expand description
Calls UserService.
Users. Each user can read only their own profile, by the name users/me
or by their own id; the role bindings they hold are listed by
ListRoleBindings with the parent organizations/-. Anyone who may grant
roles in an organization can look a user up by email address, to name
them in a role binding. A client calls ActivatePendingRoleBindings once a
user has signed in, so the role bindings pending for their address become
theirs.
Implementations§
Source§impl UserClient
impl UserClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of UserService that sends its calls through client.
Sourcepub fn service(&self) -> &Service
pub fn service(&self) -> &Service
The endpoint the client sends its calls to, which also serves the operations its methods answer with.
Sourcepub fn with_options(&self, options: CallOptions) -> Self
pub fn with_options(&self, options: CallOptions) -> Self
The same client, whose calls are sent as options says instead of as the Client’s settings do, such as a mutation that must not be sent twice: .with_options(CallOptions::new().max_attempts(1)). See CallOptions.
Sourcepub async fn get_user(&self, request: GetUserRequest) -> Result<User, Error>
pub async fn get_user(&self, request: GetUserRequest) -> Result<User, Error>
Returns the caller’s own profile. Any other user is NOT_FOUND; a
service account caller is refused with BAD_REQUEST, having no
profile.
Sourcepub async fn lookup_user(
&self,
request: LookupUserRequest,
) -> Result<User, Error>
pub async fn lookup_user( &self, request: LookupUserRequest, ) -> Result<User, Error>
Looks up the user whose account has verified an email address, and
answers them with their name and their full name, member, which is
how a role binding names them. Needs iam.role.assign on
organization, the permission a binding of the user needs anyway.
Refused with NOT_FOUND when no enabled account has verified the
address, and with CONFLICT when more than one has. The answer leaves
given_name and family_name empty: only the user reads those.
Sourcepub async fn activate_pending_role_bindings(
&self,
request: ActivatePendingRoleBindingsRequest,
) -> Result<User, Error>
pub async fn activate_pending_role_bindings( &self, request: ActivatePendingRoleBindingsRequest, ) -> Result<User, Error>
Activates the role bindings pending for the caller’s email address,
once the caller’s account has verified it, and returns the caller’s
profile, as GetUser does. Each binding becomes active under its own
name with the caller as its member, while whoever created it still
holds every permission of its role in the organization; otherwise it
is dropped. An address not yet verified activates nothing. Calling it
again activates only what has been granted to the address since. A
service account caller is refused with BAD_REQUEST; any user but the
caller is NOT_FOUND.