One Logo Pool Ball
AppIntents · IOS API REFERENCE

AssistantSchemas.MailEntity

protocol · iOS 16.0+ · SDK 27.1

protocol MailEntity : AssistantSchemas.Model

Assistant schema conformance for app entities that describe email.

Members (4)

get · iOS 16.0+

draft

Swift declaration
var draft: some AssistantSchemas.Entity { get }

The app entity describes an email draft. ## Overview Use Swift macros that generate additional properties and add protocol conformance for your app entity implementation. The following example shows an app entity that conforms to the `.mail.draft` schema: ```swift @AppEntity(schema: .mail.draft) struct MailDraftEntity: AppEntity { struct Query: EntityStringQuery { func entities(for identifiers: [MailDraftEntity.ID]) async throws -> [MailDraftEntity] { [] } func entities(matching string: String) async throws -> [MailDraftEntity] { [] } } static var defaultQuery = Query() var displayRepresentation: DisplayRepresentation { "Mail Draft" } let id = UUID() @Property var to: [IntentPerson] @Property var cc: [IntentPerson] @Property var bcc: [IntentPerson] @Property var subject: String? @Property var body: AttributedString? @Property var attachments: [IntentFile] @Property var account: MailAccountEntity } ``` For more information about the `.mail` app intent domain, see <doc:app-schema-domain-mail>. For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.

get · iOS 16.0+

account

Swift declaration
var account: some AssistantSchemas.Entity { get }

The app entity describes an email account. ## Overview Use Swift macros that generate additional properties and add protocol conformance for your app entity implementation. The following example shows an app entity that conforms to the `.mail.account` schema: ```swift @AppEntity(schema: .mail.account) struct MailAccountEntity: AppEntity { struct Query: EntityStringQuery { func entities(for identifiers: [MailAccountEntity.ID]) async throws -> [MailAccountEntity] { [] } func entities(matching string: String) async throws -> [MailAccountEntity] { [] } } static var defaultQuery = Query() var displayRepresentation: DisplayRepresentation { "Mail Account" } let id = UUID() @Property var name: String @Property var emailAddress: String } ``` For more information about the `.mail` app intent domain, see <doc:app-schema-domain-mail>. For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.

get · iOS 16.0+

mailbox

Swift declaration
var mailbox: some AssistantSchemas.Entity { get }

The app entity describes an email mailbox. ## Overview Use Swift macros that generate additional properties and add protocol conformance for your app entity implementation. The following example shows an app entity that conforms to the `.mail.mailbox` schema: ```swift @AppEntity(schema: .mail.mailbox) struct MailboxEntity: AppEntity { struct Query: EntityStringQuery { func entities(for identifiers: [MailboxEntity.ID]) async throws -> [MailboxEntity] { [] } func entities(matching string: String) async throws -> [MailboxEntity] { [] } } static var defaultQuery = Query() var displayRepresentation: DisplayRepresentation { "Mailbox" } let id = UUID() @Property var name: String @Property var account: MailAccountEntity } ``` For more information about the `.mail` app intent domain, see <doc:app-schema-domain-mail>. For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.

get · iOS 16.0+

message

Swift declaration
var message: some AssistantSchemas.Entity { get }

The app entity describes an email message. ## Overview Use Swift macros that generate additional properties and add protocol conformance for your app entity implementation. The following example shows an app entity that conforms to the `.mail.message` schema: ```swift @AppEntity(schema: .mail.message) struct MailMessageEntity: AppEntity { struct Query: EntityStringQuery { func entities(for identifiers: [MailMessageEntity.ID]) async throws -> [MailMessageEntity] { [] } func entities(matching string: String) async throws -> [MailMessageEntity] { [] } } static var defaultQuery = Query() var displayRepresentation: DisplayRepresentation { "Mail Message" } let id = UUID() @Property var to: [IntentPerson] @Property var cc: [IntentPerson] @Property var bcc: [IntentPerson] @Property var subject: String? @Property var body: AttributedString? @Property var attachments: [IntentFile] @Property var sender: IntentPerson @Property var dateSent: Date @Property var dateReceived: Date @Property var isRead: Bool @Property var isJunk: Bool @Property var isFlagged: Bool @Property var account: MailAccountEntity @Property var mailbox: MailboxEntity } ``` For more information about the `.mail` app intent domain, see <doc:app-schema-domain-mail>. For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →