mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
46 lines
2.6 KiB
Swift
46 lines
2.6 KiB
Swift
//
|
|
// PublishResult.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct PublishResult: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Channels is the channel list read off the content document — integration ids or provider names, as the item declares them. Empty when the item names none, which targets every connected, enabled channel. It is what was ASKED for; Results is what happened. */
|
|
public var channels: [String]?
|
|
/** ExternalIDs maps channel id → the post id that channel returned, merged with everything earlier publishes recorded. Successes only, and it is the idempotency ledger: a channel named here is skipped by every later publish of this item, so the map only ever grows. */
|
|
public var externalIds: [String: String]?
|
|
/** Results is the outcome per channel — which went out, which did not and why — covering the whole fan-out including failures, so partial success is never flattened into one verdict. A channel the org has not connected appears here as failed with \"channel not connected\". */
|
|
public var results: [ChannelResult]?
|
|
/** Status is the ONE headline, drawn from: \"distributed\" (something is on record and went out now), \"scheduled\" (same, handed to the channel's own scheduler for later), \"failed\" (nothing is on record — this fan-out missed entirely and no earlier one landed), \"in_progress\" (another publisher holds the item, so this call posted NOTHING and the caller retries), and \"not_configured\" (no distribution edge is wired; a transition records it instead of failing). A partial fan-out is \"distributed\"/\"scheduled\", never \"failed\" — the per-channel truth is in Results. */
|
|
public var status: String?
|
|
|
|
public init(channels: [String]? = nil, externalIds: [String: String]? = nil, results: [ChannelResult]? = nil, status: String? = nil) {
|
|
self.channels = channels
|
|
self.externalIds = externalIds
|
|
self.results = results
|
|
self.status = status
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case channels
|
|
case externalIds
|
|
case results
|
|
case status
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(channels, forKey: .channels)
|
|
try container.encodeIfPresent(externalIds, forKey: .externalIds)
|
|
try container.encodeIfPresent(results, forKey: .results)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
}
|
|
}
|
|
|