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.5 KiB
Swift

//
// AdCampaign.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct AdCampaign: Sendable, Codable, ParameterConvertible, Hashable {
/** Account is the provider ad-account the campaign runs under, in Meta's act_<id> form. Empty until the org supplies one or a launch resolves it. */
public var account: String?
/** Budget is the campaign's authorized spend in MINOR units (cents). Negative clamps to 0. It is the org's stored plan: a Meta launch creates the campaign object only, and the delivering budget lives on the ad set. */
public var budget: Int64?
/** CreatedAt is when the campaign was first stored, in unix seconds. It never changes, including across a full-replace update. */
public var createdAt: Int64?
/** ExternalID is the ad network's own campaign id, written by a successful launch and by nothing else — an update never touches it. Empty means this campaign has never reached its network. */
public var externalId: String?
/** ID is the campaign's server-minted handle, \"camp_\" + 32 hex. A create body cannot choose it, and it is the id every other route addresses. */
public var id: String?
/** Name is the campaign's display label, and the name Meta creates the campaign object under at launch. Required; trimmed and bounded to 1024 bytes. */
public var name: String?
/** Objective is the campaign goal spelled as the provider names it (\"conversions\", \"OUTCOME_TRAFFIC\"), passed through to the network verbatim at launch — Meta defaults an empty one to OUTCOME_TRAFFIC. Free text, bounded to 1024 bytes; no vocabulary is enforced here. */
public var objective: String?
/** Platform is the ad network: meta, google, tiktok or x, and nothing else — a write naming another is 400. Empty stores as meta. Only meta executes today; launching any of the other three is 501. */
public var platform: String?
/** Spend is spend-to-date in MINOR units (cents), as last written through create or update. Negative clamps to 0. It is NOT read back from the network — that is a separate insights call — so 0 means nothing was recorded here, not that nothing was spent. */
public var spend: Int64?
/** Status is the lifecycle: draft, active, paused or completed, and nothing else — a write naming another is 400. Empty stores as draft; a successful launch sets active. It records what this deployment did, not what the ad network currently reports. */
public var status: String?
/** UpdatedAt is when the row was last written, in unix seconds — set by create, update and launch. Listings are ordered by it, newest first. */
public var updatedAt: Int64?
public init(account: String? = nil, budget: Int64? = nil, createdAt: Int64? = nil, externalId: String? = nil, id: String? = nil, name: String? = nil, objective: String? = nil, platform: String? = nil, spend: Int64? = nil, status: String? = nil, updatedAt: Int64? = nil) {
self.account = account
self.budget = budget
self.createdAt = createdAt
self.externalId = externalId
self.id = id
self.name = name
self.objective = objective
self.platform = platform
self.spend = spend
self.status = status
self.updatedAt = updatedAt
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case account
case budget
case createdAt
case externalId
case id
case name
case objective
case platform
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(account, forKey: .account)
try container.encodeIfPresent(budget, forKey: .budget)
try container.encodeIfPresent(createdAt, forKey: .createdAt)
try container.encodeIfPresent(externalId, forKey: .externalId)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(name, forKey: .name)
try container.encodeIfPresent(objective, forKey: .objective)
try container.encodeIfPresent(platform, forKey: .platform)
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 AdCampaign: Identifiable {}