mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
54 lines
2.1 KiB
Swift
54 lines
2.1 KiB
Swift
//
|
|
// TeamMessage.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct TeamMessage: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Author is the team account uuid that wrote it. It is an ACCOUNT and not a display name: what to call somebody is the roster's answer, and copying it onto every message is how the two come to disagree. An agent's messages carry the account derived from its id, so the same field answers for both. */
|
|
public var author: String?
|
|
/** CreatedOn is unix MILLIseconds, which is what the platform stamps. */
|
|
public var createdOn: Int64?
|
|
/** ID is the message document's own id. */
|
|
public var id: String?
|
|
/** Room is the room it was said in — the same id the room listing answers with, so a caller holding a message can name its room without a second read. */
|
|
public var room: String?
|
|
/** Text is the message as PLAIN TEXT. The document stores markup; this is the same `plainText` reduction the agent responder reads a prompt with, so a caller never has to parse the client's markup to know what was said. */
|
|
public var text: String?
|
|
|
|
public init(author: String? = nil, createdOn: Int64? = nil, id: String? = nil, room: String? = nil, text: String? = nil) {
|
|
self.author = author
|
|
self.createdOn = createdOn
|
|
self.id = id
|
|
self.room = room
|
|
self.text = text
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case author
|
|
case createdOn
|
|
case id
|
|
case room
|
|
case text
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(author, forKey: .author)
|
|
try container.encodeIfPresent(createdOn, forKey: .createdOn)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(room, forKey: .room)
|
|
try container.encodeIfPresent(text, forKey: .text)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension TeamMessage: Identifiable {}
|