/**
 * Generated by orval 🍺
 * Do not edit manually.
 * messages API
 * This is the messages API schema.
 * OpenAPI spec version: 1.0.0 (v1.0)
 */
import type { ImportRunFailureReasons } from "./import_run_failure_reasons";

/**
 * Read-only view of an import run (a ``Channel`` with type=import).

Progress lives in Redis and terminal state on the channel; the serializer
reads the merged view so the frontend can poll the import resource
(``GET /mailboxes/{id}/imports/{id}/``) instead of the raw Celery task state.
 */
export interface ImportRun {
  /** primary key for the record as UUID */
  readonly id: string;
  /** Human-readable name for this channel */
  readonly name: string;
  /**
   * Mailbox that receives messages from this channel
   * @nullable
   */
  readonly mailbox: string | null;
  /** Uncheck to pause this channel without deleting it. */
  readonly is_active: boolean;
  /** @nullable */
  readonly status: string | null;
  /** @nullable */
  readonly source_type: string | null;
  /** @nullable */
  readonly mode: string | null;
  /** @nullable */
  readonly poll_interval: number | null;
  /** @nullable */
  readonly imap_username: string | null;
  readonly total_messages: number;
  readonly success_count: number;
  readonly failure_count: number;
  /** @nullable */
  readonly failure_reasons: ImportRunFailureReasons;
  readonly progress: number;
  /** @nullable */
  readonly error: string | null;
  /** @nullable */
  readonly started_at: string | null;
  /** @nullable */
  readonly finished_at: string | null;
  /**
   * Operational timestamp updated (throttled) whenever the channel is used.
   * @nullable
   */
  readonly last_used_at: string | null;
  /** date and time at which a record was created */
  readonly created_at: string;
  /** date and time at which a record was last updated */
  readonly updated_at: string;
}
