Message
public struct Message : Sendable
extension Message: Equatable
Represents all info about a message in a chat.
-
The unique id for the message. Refers to the
idOnExternalPlatform.The canonical, case-preserving identifier of the message as provided by the backend. Stores the exact value from the backend, without altering case.
Declaration
Swift
public let id: String -
The thread id for the message. Refers to the
threadIdOnExternalPlatform.Declaration
Swift
public let threadId: String -
The content of the message
Declaration
Swift
public let contentType: MessageContentType -
The timestamp of when the message was created.
Declaration
Swift
public let createdAt: Date -
The attachments on the message.
Declaration
Swift
public let attachments: [Attachment] -
The direction that the message is being sent (in regards to the agent).
Declaration
Swift
public let direction: MessageDirection -
An agent statistic information about the message (read status, viewed status, etc.).
Declaration
Swift
public let agentStatistics: UserStatistics? -
A customer statistic information about the message (read status, viewed status, etc.).
Declaration
Swift
public let customerStatistics: UserStatistics? -
The agent that sent the message. Only present if the direction is to client (outbound).
Declaration
Swift
public let authorUser: Agent? -
The customer that sent the message. Only present if the direction is to agent (inbound).
Declaration
Swift
public let authorEndUserIdentity: CustomerIdentity? -
Information about the sender of a message.
Declaration
Swift
public var senderInfo: SenderInfo? { get } -
The delivery or read status of the message.
Declaration
Swift
public let status: MessageStatus -
Whether the message content was generated by an AI agent.
truewhen the backend marks the message as AI-generated;falseotherwise, including when the backend feature is disabled and the field is absent from the payload.Declaration
Swift
public let isAiGenerated: Bool
-
init(id:threadId: contentType: createdAt: attachments: direction: agentStatistics: customerStatistics: authorUser: authorEndUserIdentity: status: isAiGenerated: ) Initializer of the Message object
Declaration
Swift
public init( id: String, threadId: String, contentType: MessageContentType, createdAt: Date, attachments: [Attachment], direction: MessageDirection, agentStatistics: UserStatistics?, customerStatistics: UserStatistics?, authorUser: Agent?, authorEndUserIdentity: CustomerIdentity?, status: MessageStatus, isAiGenerated: Bool = false )Parameters
idThe unique id for the message.
threadIdThe thread id for the message.
contentTypeThe content of the message
createdAtThe timestamp of when the message was created.
attachmentsThe attachments on the message.
directionThe direction that the message is being sent (in regards to the agent).
agentStatisticsAn agent statistic information about the message (read status, viewed status, etc.).
customerStatisticsA customer statistic information about the message (read status, viewed status, etc.).
authorUserThe agent that sent the message. Only present if the direction is to client (outbound).
authorEndUserIdentityThe customer that sent the message. Only present if the direction is to agent (inbound).
statusThe delivery or read status of the message.
isAiGeneratedWhether the message content was generated by an AI agent. Defaults to
false.
-
Declaration
Swift
public static func == (lhs: Message, rhs: Message) -> Bool
View on GitHub