import Models

/// Parsed IMAP envelope — the data we extract from a FETCH response.
public struct FetchedEnvelope: Sendable {
	public var uid: Int
	public var messageId: String?
	public var inReplyTo: String?
	public var references: String?
	public var subject: String?
	public var from: EmailAddress?
	public var to: [EmailAddress]
	public var cc: [EmailAddress]
	public var date: String
	public var snippet: String?
	public var bodyText: String?
	public var bodyHtml: String?
	public var isRead: Bool
	public var isFlagged: Bool
	public var size: Int

	public init(
		uid: Int, messageId: String?, inReplyTo: String?, references: String?,
		subject: String?, from: EmailAddress?, to: [EmailAddress], cc: [EmailAddress],
		date: String, snippet: String?, bodyText: String?, bodyHtml: String?,
		isRead: Bool, isFlagged: Bool, size: Int
	) {
		self.uid = uid
		self.messageId = messageId
		self.inReplyTo = inReplyTo
		self.references = references
		self.subject = subject
		self.from = from
		self.to = to
		self.cc = cc
		self.date = date
		self.snippet = snippet
		self.bodyText = bodyText
		self.bodyHtml = bodyHtml
		self.isRead = isRead
		self.isFlagged = isFlagged
		self.size = size
	}
}
