use serde::{Deserialize, Serialize}; use super::common::Id; use super::user::{User, UserRole}; /// The payload returned by `auth.info`: the current API actor and their workspace. #[derive(Debug, Clone, Serialize, Deserialize)] #[non_exhaustive] pub struct AuthInfo { /// The user associated with the current API key or access token. pub user: User, /// The workspace the user belongs to. pub team: Team, } /// An Outline workspace (formerly "team"). #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct Team { /// Unique identifier for the workspace. pub id: Id, /// The name of the workspace. pub name: String, /// A short description of the workspace. #[serde(default)] pub description: Option, /// The URL of the workspace's avatar image, if any. #[serde(default)] pub avatar_url: Option, /// Whether this workspace has share links globally enabled. #[serde(default)] pub sharing: bool, /// The default role assigned to new members. #[serde(default)] pub default_user_role: Option, /// The fully qualified URL at which this workspace can be accessed. #[serde(default)] pub url: Option, /// The subdomain at which this workspace can be accessed. #[serde(default)] pub subdomain: Option, } /// Authentication configuration for an Outline instance (`auth.config`). /// /// This endpoint requires no authentication and is useful for discovering /// available sign-in methods before a client has credentials. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct AuthConfig { /// The name of the workspace. #[serde(default)] pub name: Option, /// The hostname at which this workspace can be accessed. #[serde(default)] pub hostname: Option, /// Available single sign-on services. #[serde(default)] pub services: Vec, } /// A single sign-on service available for authentication. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct AuthService { /// The service identifier, e.g. `"slack"`. #[serde(default)] pub id: Option, /// The human-readable service name, e.g. `"Slack"`. #[serde(default)] pub name: Option, /// The URL to redirect to in order to authenticate with this service. #[serde(default)] pub auth_url: Option, }