// Auto-generated by DjangoCFG - see CLAUDE.md
import * as Enums from "../enums";

/**
 * Request to disconnect OAuth provider.
 * 
 * Request model (no read-only fields).
 */
export interface OAuthDisconnectRequestRequest {
  /** OAuth provider to disconnect

  * `github` - GitHub */
  provider: Enums.OAuthDisconnectRequestRequestProvider;
}

/**
 * Error response for OAuth endpoints.
 * 
 * Response model (includes read-only fields).
 */
export interface OAuthError {
  /** Error code */
  error: string;
  /** Human-readable error description */
  error_description?: string;
}

/**
 * Request to start OAuth flow.
 * 
 * Request model (no read-only fields).
 */
export interface OAuthAuthorizeRequestRequest {
  /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
  redirect_uri?: string;
  /** Optional source URL for registration tracking */
  source_url?: string;
}

/**
 * Response with OAuth authorization URL.
 * 
 * Response model (includes read-only fields).
 */
export interface OAuthAuthorizeResponse {
  /** Full URL to redirect user to OAuth provider */
  authorization_url: string;
  /** State token for CSRF protection. Store this and verify on callback. */
  state: string;
}

/**
 * Request to complete OAuth flow (callback handler).
 * 
 * Request model (no read-only fields).
 */
export interface OAuthCallbackRequestRequest {
  /** Authorization code from OAuth provider callback */
  code: string;
  /** State token for CSRF verification (from authorize response) */
  state: string;
  /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
  redirect_uri?: string;
}

/**
 * Response with JWT tokens after OAuth authentication. When 2FA is required: -
 * requires_2fa: True - session_id: UUID of 2FA verification session -
 * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
 * session_id: null - access/refresh/user: populated
 * 
 * Response model (includes read-only fields).
 */
export interface OAuthTokenResponse {
  /** True if 2FA verification is required */
  requires_2fa?: boolean;
  /** 2FA session ID (only when requires_2fa=True) */
  session_id?: string | null;
  /** JWT access token (null when requires_2fa=True) */
  access?: string | null;
  /** JWT refresh token (null when requires_2fa=True) */
  refresh?: string | null;
  /** Authenticated user info (null when requires_2fa=True) */
  user?: Record<string, any> | null;
  /** True if a new user was created during this OAuth flow */
  is_new_user: boolean;
  /** True if a new OAuth connection was created */
  is_new_connection: boolean;
  /** True if user should be prompted to enable 2FA */
  should_prompt_2fa?: boolean;
}

/**
 * Response with available OAuth providers.
 * 
 * Response model (includes read-only fields).
 */
export interface OAuthProvidersResponse {
  /** List of available OAuth providers */
  providers: Array<Record<string, any>>;
}

