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.
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.