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

Provides authenticated user profile, preferences, and capability state.

# `activate_privileged_mode`

```elixir
@spec activate_privileged_mode(
  Req.Request.t(),
  Chatto.Api.V1.ActivatePrivilegedModeRequest.t()
) ::
  {:ok, Chatto.Api.V1.ActivatePrivilegedModeResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Starts a window of up to 15 minutes with all currently assigned protected roles.
During an active window, a retry keeps the stored selection and deadline,
even if all selected roles have been revoked. Deactivate to change the selection.
Returns FAILED_PRECONDITION for a bot or when starting a new activation
without any assigned protected roles.

# `activate_privileged_roles`

```elixir
@spec activate_privileged_roles(
  Req.Request.t(),
  Chatto.Api.V1.ActivatePrivilegedRolesRequest.t()
) ::
  {:ok, Chatto.Api.V1.ActivatePrivilegedRolesResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Activates the selected protected roles for up to 15 minutes.
Each request, including a retry, returns FAILED_PRECONDITION for a bot or
a caller with no assigned protected roles. Otherwise an empty selection
returns INVALID_ARGUMENT, and an unavailable role returns PERMISSION_DENIED.
During an active window, a retry with the same eligible selection keeps the
deadline. A different eligible selection returns INVALID_ARGUMENT. Deactivate
before changing the selection. A rejected retry preserves the selection and deadline.

# `deactivate_privileged_mode`

```elixir
@spec deactivate_privileged_mode(
  Req.Request.t(),
  Chatto.Api.V1.DeactivatePrivilegedModeRequest.t()
) ::
  {:ok, Chatto.Api.V1.DeactivatePrivilegedModeResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Deactivates the selected protected roles immediately. Returns
FAILED_PRECONDITION when the caller is a bot.

# `get_viewer`

```elixir
@spec get_viewer(Req.Request.t(), Chatto.Api.V1.GetViewerRequest.t()) ::
  {:ok, Chatto.Api.V1.GetViewerResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Returns the current authenticated viewer. This RPC requires a logged-in
user; unauthenticated callers receive an UNAUTHENTICATED error.

---

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