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.
79 lines
5.2 KiB
Swift
79 lines
5.2 KiB
Swift
//
|
|
// InboxView.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct InboxView: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Account is the lowercased external id of the org's connected account on that transport: the Discord guild id, the Slack team id, the Teams AAD tenant id, or the bound Telegram chat id. Informational only — the gate keys on (org, channel), never on the account. */
|
|
public var account: String?
|
|
/** Channel is the transport this message arrived on — discord, slack, teams or telegram — and the `:channel` segment to reply through. */
|
|
public var channel: String?
|
|
/** CreatedAt is Unix SECONDS, stamped by the ingest goroutine when the message was accepted — not the transport's own send time. Rows are dropped 30 days after it. */
|
|
public var createdAt: Int64?
|
|
/** ID is the store's row id, assigned on insert — SERVER-SET, and the cursor: pass a page's last id back as `since`. It rises with arrival order but is not contiguous, because one sequence is shared by every org in the store and a caller reads only its own rows. */
|
|
public var id: Int64?
|
|
/** ReplyTo is the transport's reply target for this message: Slack's thread_ts, or the Telegram message id it arrived as. Send it back as the body's `replyTo` to answer in the SAME thread. Empty means the transport reported none — a top-level Slack message, and every Discord and Teams message, since neither carries one — and a reply then lands at the top level of the room. */
|
|
public var replyTo: String?
|
|
/** RoomID is the conversation on the ORIGINATING transport, and the value to send back as `room.id`: a Discord channel snowflake, a Slack conversation id (D… IM, C… public channel, G… private or mpim), a Teams conversation id (19:…@thread.… for a channel or group chat, a:… for a personal chat), or a Telegram chat id in decimal (negative for a group, positive for a DM). It is stable for the life of the room, so every message from one conversation carries the same value. */
|
|
public var roomId: String?
|
|
/** RoomKind is how ingest classified the room: \"dm\", \"group\" or \"thread\". It decides which policy gated the message — dmPolicy for \"dm\", groupPolicy for BOTH \"group\" and \"thread\". Only Slack ever reports \"thread\"; Telegram's reply-to id becomes ReplyTo instead, and Discord's ingress is guild-scoped so its rooms are always \"group\". */
|
|
public var roomKind: String?
|
|
/** Sender is the TRANSPORT-NATIVE user id of whoever wrote the message — a Discord member.user.id, a Slack U… user id, a Teams aadObjectId (falling back to from.id), a Telegram from.id in decimal. Stable per person per transport, and the identity the gate keys on: an allow entry, an access-group member and a pairing approval all name exactly this value. */
|
|
public var sender: String?
|
|
/** SenderUser is the HANZO account subject that chat identity is linked to, resolved at ingest through the org's user link. Best-effort and omitted when absent: a person who never linked their chat account — or a link store that could not be read — leaves it empty and is never blocked for it. */
|
|
public var senderUser: String?
|
|
/** Text is the body as the transport delivered it, with the bot mention already stripped by the ingress adapter (on Discord it is the /hanzo prompt argument, since that ingress is slash commands only), truncated to 8 KiB on store. Inbound attachments are not stored — this is the whole of what was said. */
|
|
public var text: String?
|
|
|
|
public init(account: String? = nil, channel: String? = nil, createdAt: Int64? = nil, id: Int64? = nil, replyTo: String? = nil, roomId: String? = nil, roomKind: String? = nil, sender: String? = nil, senderUser: String? = nil, text: String? = nil) {
|
|
self.account = account
|
|
self.channel = channel
|
|
self.createdAt = createdAt
|
|
self.id = id
|
|
self.replyTo = replyTo
|
|
self.roomId = roomId
|
|
self.roomKind = roomKind
|
|
self.sender = sender
|
|
self.senderUser = senderUser
|
|
self.text = text
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case account
|
|
case channel
|
|
case createdAt
|
|
case id
|
|
case replyTo
|
|
case roomId
|
|
case roomKind
|
|
case sender
|
|
case senderUser
|
|
case text
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(account, forKey: .account)
|
|
try container.encodeIfPresent(channel, forKey: .channel)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(replyTo, forKey: .replyTo)
|
|
try container.encodeIfPresent(roomId, forKey: .roomId)
|
|
try container.encodeIfPresent(roomKind, forKey: .roomKind)
|
|
try container.encodeIfPresent(sender, forKey: .sender)
|
|
try container.encodeIfPresent(senderUser, forKey: .senderUser)
|
|
try container.encodeIfPresent(text, forKey: .text)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension InboxView: Identifiable {}
|