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

79 lines
4.1 KiB
Swift

//
// CampaignRecord.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct CampaignRecord: Sendable, Codable, ParameterConvertible, Hashable {
/** Audience is an opaque reference to the segment this campaign targets. It is stored and echoed but not yet handed to the executors — a channel targets through the provider account it runs under — so it is documentation for now. Absent when never set. */
public var audience: String?
/** Budget is the campaign's total budget in CENTS, handed to each executor as the budget for its channel. 0 means none was set. */
public var budget: Int64?
/** Channels are the fan-out targets, at most one per kind and at most 12, each carrying its own post-launch state. Empty means nothing to launch, which is what makes a launch of this campaign a 400. */
public var channels: [ChannelSpec]?
/** Content is the ordered creative set, at most 32, empty entries dropped. Content[0] is the creative that runs; the rest are A/B variants a wired experiment can assign per launch. */
public var content: [String]?
/** CreatedAt is when the campaign was created, in unix seconds. Server-set. */
public var createdAt: Int64?
/** ID is the campaign's server-minted handle — \"cmp_\" and 128 random bits — and the id every other campaign call is addressed by. Never read off the wire: a create that sends one has it ignored. */
public var id: String?
/** Name is the campaign's display name. Required on write, trimmed, and capped at 2048 characters. */
public var name: String?
/** ScheduleAt is when the campaign should run, in unix seconds. 0 (absent) means launch immediately. It is passed to each executor; nothing in this service wakes up to launch it for you. */
public var scheduleAt: Int64?
/** Status is the lifecycle state, server-owned and never accepted from a caller. Four values actually occur: draft (inert and fully mutable — nothing is sent and no budget is committed), live, paused and failed. After a fan-out live means AT LEAST ONE channel launched — read the channel rows for the rest — and failed means none did. */
public var status: String?
/** UpdatedAt is the last write in unix seconds — an edit, a launch or a pause. Server-set on every save. */
public var updatedAt: Int64?
public init(audience: String? = nil, budget: Int64? = nil, channels: [ChannelSpec]? = nil, content: [String]? = nil, createdAt: Int64? = nil, id: String? = nil, name: String? = nil, scheduleAt: Int64? = nil, status: String? = nil, updatedAt: Int64? = nil) {
self.audience = audience
self.budget = budget
self.channels = channels
self.content = content
self.createdAt = createdAt
self.id = id
self.name = name
self.scheduleAt = scheduleAt
self.status = status
self.updatedAt = updatedAt
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case audience
case budget
case channels
case content
case createdAt
case id
case name
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(audience, forKey: .audience)
try container.encodeIfPresent(budget, forKey: .budget)
try container.encodeIfPresent(channels, forKey: .channels)
try container.encodeIfPresent(content, forKey: .content)
try container.encodeIfPresent(createdAt, forKey: .createdAt)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(name, forKey: .name)
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 CampaignRecord: Identifiable {}