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.
69 lines
4.2 KiB
Swift
69 lines
4.2 KiB
Swift
//
|
|
// ChannelView.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ChannelView: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Account is the id-shaped fact about that connection: the lowercased external id integrations custodies for it — a Discord guild id, a Slack team (workspace) id, a Teams AAD tenant id, or the Telegram chat the org bound. Empty when not connected. Informational: the access policy keys on (org, channel), so exactly one account is representable per pair. */
|
|
public var account: String?
|
|
/** AccountLabel is the human label of that same account — the Discord guild name, the Slack team name, the Teams tenant name (falling back to the tenant id), the Telegram chat title. DISPLAY ONLY: never a key, and never swapped with Account, on any surface. */
|
|
public var accountLabel: String?
|
|
/** Capabilities is what this transport renders natively — read it before composing a message that needs threading, media or interactive actions. */
|
|
public var capabilities: Capabilities?
|
|
/** Connected is whether integrations holds a connection for (this org, this transport) — whether someone finished its connect flow. False leaves Account and AccountLabel empty, and a send is then refused downstream rather than here: by the transport's own binding check (403 for a Telegram chat this org has not bound, 409 for a Discord or Teams room with no inbound-learned route), or on Slack by the absent per-org bot token, which surfaces as 502. */
|
|
public var connected: Bool?
|
|
/** DMPolicy is how this org admits direct messages here: \"pairing\", \"allowlist\" or \"open\", defaulting to \"pairing\" when the org has never set one. */
|
|
public var dmPolicy: String?
|
|
/** GroupPolicy is how this org admits group and thread rooms here: \"open\", \"allowlist\" or \"disabled\", defaulting to \"open\". Both policy fields come back EMPTY — rather than the listing failing — when the policy cannot be read; GET /v1/channel/allowlist carries the same two with the entries they consult. */
|
|
public var groupPolicy: String?
|
|
/** ID is the fixed transport identifier — discord, slack, teams, telegram or whatsapp — and the value every route on this surface names a channel by, including the `:channel` segment of the send path. The listing is always in that order. */
|
|
public var id: String?
|
|
/** PendingPairing counts the org's UNEXPIRED pairing requests on this channel: exactly the rows GET /v1/channel/pairing returns for it, one per person waiting on an admin. It never exceeds three — the pending cap per (org, channel) — and expired requests are not counted. */
|
|
public var pendingPairing: Int64?
|
|
|
|
public init(account: String? = nil, accountLabel: String? = nil, capabilities: Capabilities? = nil, connected: Bool? = nil, dmPolicy: String? = nil, groupPolicy: String? = nil, id: String? = nil, pendingPairing: Int64? = nil) {
|
|
self.account = account
|
|
self.accountLabel = accountLabel
|
|
self.capabilities = capabilities
|
|
self.connected = connected
|
|
self.dmPolicy = dmPolicy
|
|
self.groupPolicy = groupPolicy
|
|
self.id = id
|
|
self.pendingPairing = pendingPairing
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case account
|
|
case accountLabel
|
|
case capabilities
|
|
case connected
|
|
case dmPolicy
|
|
case groupPolicy
|
|
case id
|
|
case pendingPairing
|
|
}
|
|
|
|
// 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(accountLabel, forKey: .accountLabel)
|
|
try container.encodeIfPresent(capabilities, forKey: .capabilities)
|
|
try container.encodeIfPresent(connected, forKey: .connected)
|
|
try container.encodeIfPresent(dmPolicy, forKey: .dmPolicy)
|
|
try container.encodeIfPresent(groupPolicy, forKey: .groupPolicy)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(pendingPairing, forKey: .pendingPairing)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension ChannelView: Identifiable {}
|