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
3.3 KiB
Swift
79 lines
3.3 KiB
Swift
//
|
|
// CalendarPost.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct CalendarPost: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Body is the post text. Required. */
|
|
public var body: String?
|
|
/** Channel is the target network: x, facebook, instagram, linkedin, tiktok, youtube or threads. Required — a post must name where it goes. */
|
|
public var channel: String?
|
|
/** CreatedAt is unix seconds when the post was added, server-assigned and never rewritten. */
|
|
public var createdAt: Int64?
|
|
/** Error is the exact reason the last publish attempt failed — the honest record behind a \"failed\" status, never a faked success. */
|
|
public var error: String?
|
|
/** ID is the server-assigned post id (\"cal_\" + 128 random bits). */
|
|
public var id: String?
|
|
/** PublishedAt is when the publish succeeded; 0 until it does. */
|
|
public var publishedAt: Int64?
|
|
/** ScheduledAt is the unix publish time; 0 leaves the post a draft, and any value makes it \"scheduled\" for the durable sweep to pick up. */
|
|
public var scheduledAt: Int64?
|
|
/** Status is draft, scheduled, published, failed or canceled. Server-owned. */
|
|
public var status: String?
|
|
/** Title is the post's internal label, capped at 1024 bytes. */
|
|
public var title: String?
|
|
/** UpdatedAt is unix seconds of the last write, server-assigned. The durable sweep writes too — claiming a due post, publishing it and recording a failure each bump it — so this moves without anyone editing the post. */
|
|
public var updatedAt: Int64?
|
|
|
|
public init(body: String? = nil, channel: String? = nil, createdAt: Int64? = nil, error: String? = nil, id: String? = nil, publishedAt: Int64? = nil, scheduledAt: Int64? = nil, status: String? = nil, title: String? = nil, updatedAt: Int64? = nil) {
|
|
self.body = body
|
|
self.channel = channel
|
|
self.createdAt = createdAt
|
|
self.error = error
|
|
self.id = id
|
|
self.publishedAt = publishedAt
|
|
self.scheduledAt = scheduledAt
|
|
self.status = status
|
|
self.title = title
|
|
self.updatedAt = updatedAt
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case body
|
|
case channel
|
|
case createdAt
|
|
case error
|
|
case id
|
|
case publishedAt
|
|
case scheduledAt
|
|
case status
|
|
case title
|
|
case updatedAt
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(body, forKey: .body)
|
|
try container.encodeIfPresent(channel, forKey: .channel)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(error, forKey: .error)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(publishedAt, forKey: .publishedAt)
|
|
try container.encodeIfPresent(scheduledAt, forKey: .scheduledAt)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(title, forKey: .title)
|
|
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension CalendarPost: Identifiable {}
|