Contents

account

The app entity describes an email account.

Declaration

var account: some AssistantSchemas.Entity { get }

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:

@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 Making email actions available to Siri and Apple Intelligence. For general information about app intent domains, see Integrating actions with Siri and Apple Intelligence.

See Also

Content and parameter types