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
3.5 KiB
Swift

//
// Campaign.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct Campaign: Sendable, Codable, ParameterConvertible, Hashable {
/** Budget is what the campaign is allowed to cost, in USD cents. A negative value is clamped to 0; nothing enforces the ceiling here. */
public var budget: Int64?
/** Channel is the delivery surface: email, sms, social, meta, google or tiktok. Empty means email. */
public var channel: String?
/** CreatedAt is unix seconds when the campaign was registered. Server-assigned and never rewritten — an update leaves it as it was. */
public var createdAt: Int64?
/** ID is the server-assigned campaign id (\"camp_\" + 128 random bits). */
public var id: String?
/** Name is the campaign's label. Required, trimmed, capped at 1024 bytes. */
public var name: String?
/** Objective is the free-text goal (\"signups\"), capped at 1024 bytes. */
public var objective: String?
/** ScheduledAt is the unix send time; 0 means unscheduled. Setting it on a campaign with no explicit status makes that status \"scheduled\". */
public var scheduledAt: Int64?
/** Spend is what the campaign has cost so far, in USD cents, clamped to >= 0. The CALLER owns it: no send, ad buy or invoice moves it, so it changes only when create or update carries a new value. It is summed across the org's campaigns into GET /v1/marketing/summary. */
public var spend: Int64?
/** Status is the lifecycle: draft, scheduled, active, paused or completed. Empty means draft. */
public var status: String?
/** UpdatedAt is unix seconds of the last write. Server-assigned on create and on every update or schedule change, and the campaign list is ordered by it, newest first. */
public var updatedAt: Int64?
public init(budget: Int64? = nil, channel: String? = nil, createdAt: Int64? = nil, id: String? = nil, name: String? = nil, objective: String? = nil, scheduledAt: Int64? = nil, spend: Int64? = nil, status: String? = nil, updatedAt: Int64? = nil) {
self.budget = budget
self.channel = channel
self.createdAt = createdAt
self.id = id
self.name = name
self.objective = objective
self.scheduledAt = scheduledAt
self.spend = spend
self.status = status
self.updatedAt = updatedAt
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case budget
case channel
case createdAt
case id
case name
case objective
case scheduledAt
case spend
case status
case updatedAt
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(budget, forKey: .budget)
try container.encodeIfPresent(channel, forKey: .channel)
try container.encodeIfPresent(createdAt, forKey: .createdAt)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(name, forKey: .name)
try container.encodeIfPresent(objective, forKey: .objective)
try container.encodeIfPresent(scheduledAt, forKey: .scheduledAt)
try container.encodeIfPresent(spend, forKey: .spend)
try container.encodeIfPresent(status, forKey: .status)
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
}
}
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
extension Campaign: Identifiable {}