/**
 * 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 { MessageBodyItem } from "./message_body_item";
import type { Attachment } from "./attachment";
import type { Contact } from "./contact";
import type { MessageRecipient } from "./message_recipient";
import type { MessageSignature } from "./message_signature";
import type { MessageStmsgHeaders } from "./message_stmsg_headers";

/**
 * Serialize messages, getting parsed details from the Message model.
Aligns field names with JMAP where appropriate (textBody, htmlBody, to, cc, bcc).
 */
export interface Message {
  /** primary key for the record as UUID */
  readonly id: string;
  /** @nullable */
  readonly parent_id: string | null;
  /** @nullable */
  readonly thread_id: string | null;
  /** @nullable */
  readonly subject: 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;
  readonly htmlBody: readonly MessageBodyItem[];
  readonly textBody: readonly MessageBodyItem[];
  /** @nullable */
  readonly draftBody: string | null;
  readonly attachments: readonly Attachment[];
  readonly sender: Contact;
  readonly to: readonly MessageRecipient[];
  readonly cc: readonly MessageRecipient[];
  readonly bcc: readonly MessageRecipient[];
  /** @nullable */
  readonly read_at: string | null;
  /** @nullable */
  readonly sent_at: string | null;
  readonly is_sender: boolean;
  readonly is_draft: boolean;
  readonly is_unread: boolean;
  readonly is_starred: boolean;
  readonly is_trashed: boolean;
  readonly is_archived: boolean;
  readonly has_attachments: boolean;
  /** @nullable */
  readonly signature: MessageSignature;
  /** Return the STMSG headers of the message. */
  readonly stmsg_headers: MessageStmsgHeaders;
}
