# `Chatto.Admin.V1.AdminUserService`
[🔗](https://github.com/xtian/elixir-chatto/blob/v0.1.0/lib/chatto/generated/chatto_admin_v1_admin_user_service.ex#L3)

Server-admin user management commands and member-detail reads.

# `assign_role`

```elixir
@spec assign_role(Req.Request.t(), Chatto.Admin.V1.AssignRoleRequest.t()) ::
  {:ok, Chatto.Admin.V1.AssignRoleResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Assigns a role to a user. Requires role.assign, and non-owner callers may
only assign roles whose granted authority they already possess.

# `batch_get_members`

```elixir
@spec batch_get_members(Req.Request.t(), Chatto.Admin.V1.BatchGetMembersRequest.t()) ::
  {:ok, Chatto.Admin.V1.BatchGetMembersResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets server member rows for multiple users. Requires admin.view-users.

# `change_user_password`

```elixir
@spec change_user_password(
  Req.Request.t(),
  Chatto.Admin.V1.ChangeUserPasswordRequest.t()
) ::
  {:ok, Chatto.Admin.V1.ChangeUserPasswordResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Updates another user's password as an admin action. Requires
user.manage-accounts and a fresh credential for the caller; the caller
cannot target their own account.

# `clear_username_cooldown`

```elixir
@spec clear_username_cooldown(
  Req.Request.t(),
  Chatto.Admin.V1.ClearUsernameCooldownRequest.t()
) ::
  {:ok, Chatto.Admin.V1.ClearUsernameCooldownResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Clears the target user's self-service username-change cooldown. Requires
user.manage-accounts, including when the caller targets their own account.

# `delete_user`

```elixir
@spec delete_user(Req.Request.t(), Chatto.Admin.V1.DeleteUserRequest.t()) ::
  {:ok, Chatto.Admin.V1.DeleteUserResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Deletes a user account as an admin action. Requires user.delete-any for
other users or user.delete-self for the caller.

# `get_member`

```elixir
@spec get_member(Req.Request.t(), Chatto.Admin.V1.GetMemberRequest.t()) ::
  {:ok, Chatto.Admin.V1.GetMemberResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets one server member plus role/permission metadata for admin details.
Requires admin.view-users. Returns NOT_FOUND when the user does not exist.

# `get_user_role_assignments`

```elixir
@spec get_user_role_assignments(
  Req.Request.t(),
  Chatto.Admin.V1.GetUserRoleAssignmentsRequest.t()
) ::
  {:ok, Chatto.Admin.V1.GetUserRoleAssignmentsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets explicit roles and current assignment limits for one human user.
Requires effective role.assign;
admin.view-users is not required. Returns NOT_FOUND for an unknown or
deleted user, and FAILED_PRECONDITION for a bot account.

# `list_members`

```elixir
@spec list_members(Req.Request.t(), Chatto.Admin.V1.ListMembersRequest.t()) ::
  {:ok, Chatto.Admin.V1.ListMembersResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists server members for the admin members screen. Requires
admin.view-users.

# `revoke_role`

```elixir
@spec revoke_role(Req.Request.t(), Chatto.Admin.V1.RevokeRoleRequest.t()) ::
  {:ok, Chatto.Admin.V1.RevokeRoleResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Revokes a role from a user. Requires role.assign, and non-owner callers may
only revoke roles whose permission decisions are within their authority.

# `set_user_deactivated`

```elixir
@spec set_user_deactivated(
  Req.Request.t(),
  Chatto.Admin.V1.SetUserDeactivatedRequest.t()
) ::
  {:ok, Chatto.Admin.V1.SetUserDeactivatedResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Deactivates or reactivates a human account. Requires user.manage-accounts.
The caller cannot target their own account or an owner account.
Deactivation invalidates existing sessions within one minute in the worst
case and prevents sign-in.
Reactivation permits new sign-ins; old sessions remain invalid.
Repeating the current state succeeds without changing it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
