Files
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
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.
2026-09-05 18:55:38 -07:00

84 lines
4.6 KiB
Swift

//
// SocialPost.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct SocialPost: Sendable, Codable, ParameterConvertible, Hashable {
/** AccountID / ExternalID / Error are server-managed publish results, set only by the publish path (never by a client update): the account a post was published through, the provider's returned external post id (for reconciliation), and the last failure reason. Empty until a publish attempt lands. AccountID is the connected account the post went out through. Absent until a publish succeeds. */
public var accountId: String?
/** Channel is the network this post targets: x, facebook, instagram, linkedin, tiktok, youtube or threads. It is the channel whose CONNECTED accounts a publish fans out to. Example: \"x\" */
public var channel: String?
/** Content is the post's text, bounded at 8192 characters. Example: \"Shipping today.\" */
public var content: String?
/** CreatedAt is when the post was created, as a unix timestamp in seconds. */
public var createdAt: Int64?
/** Error is why the last publish attempt failed, verbatim and bounded. Absent when no attempt has failed; cleared by a later success. */
public var error: String?
/** ExternalID is the id the network returned for the published post, which is what reconciles this row against the post on the network. Absent until a publish succeeds. */
public var externalId: String?
/** ID is the post's identifier, minted on create and the id every later call addresses it by. Example: \"post_91ab20\" */
public var id: String?
/** Media is the post's attached media as a list of URLs (images today; the composer's URL field now, an S3 picker later, populate it). Stored as a JSON array in the media TEXT column and ALWAYS serialized as an array (never null), so a client can rely on `media` being present. Bounded at the write layer (normMedia in social.go): each URL clipped to maxField, the list to maxMedia. */
public var media: [String]?
/** ScheduleAt is when the post is due, as a unix timestamp in SECONDS. 0 means unscheduled. It is meaningful only while the status is scheduled — a scheduled post whose time has arrived is published by the scheduler. */
public var scheduleAt: Int64?
/** Status is the post's lifecycle state: draft, scheduled, published or failed. A fifth, transient publishing state exists while a publish attempt holds the claim; it is never settable from a request and a caller sees it only if it reads a post mid-attempt. */
public var status: String?
/** UpdatedAt is when the post row last changed, as a unix timestamp in seconds. The listing is ordered by it, newest first. */
public var updatedAt: Int64?
public init(accountId: String? = nil, channel: String? = nil, content: String? = nil, createdAt: Int64? = nil, error: String? = nil, externalId: String? = nil, id: String? = nil, media: [String]? = nil, scheduleAt: Int64? = nil, status: String? = nil, updatedAt: Int64? = nil) {
self.accountId = accountId
self.channel = channel
self.content = content
self.createdAt = createdAt
self.error = error
self.externalId = externalId
self.id = id
self.media = media
self.scheduleAt = scheduleAt
self.status = status
self.updatedAt = updatedAt
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case accountId
case channel
case content
case createdAt
case error
case externalId
case id
case media
case scheduleAt
case status
case updatedAt
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(accountId, forKey: .accountId)
try container.encodeIfPresent(channel, forKey: .channel)
try container.encodeIfPresent(content, forKey: .content)
try container.encodeIfPresent(createdAt, forKey: .createdAt)
try container.encodeIfPresent(error, forKey: .error)
try container.encodeIfPresent(externalId, forKey: .externalId)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(media, forKey: .media)
try container.encodeIfPresent(scheduleAt, forKey: .scheduleAt)
try container.encodeIfPresent(status, forKey: .status)
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
}
}
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
extension SocialPost: Identifiable {}