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.
56 lines
2.5 KiB
Swift
56 lines
2.5 KiB
Swift
//
|
|
// ChannelMetric.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ChannelMetric: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** ExternalID is the provider-side id of the execution the spend belongs to. Absent until the channel has launched. */
|
|
public var externalId: String?
|
|
/** Kind is which channel this row is: paid, organic or email. It is also the row's identity — a campaign carries at most one channel per kind. */
|
|
public var kind: String?
|
|
/** Platform is the provider the spend was read from: meta, google, x, instagram, or the email provider. */
|
|
public var platform: String?
|
|
/** SpendCents is what the provider itself reports this channel spent, in CENTS. 0 when the channel never launched, when no executor is wired for it, or when the read failed — SpendError tells the last case apart from a genuine zero. */
|
|
public var spendCents: Int64?
|
|
/** SpendError is why this channel's spend could not be read (connector not connected, provider error), as one secret-free line. Present only on failure; the campaign total then simply omits this channel rather than failing. */
|
|
public var spendError: String?
|
|
/** Status is the channel's launch state on the campaign — pending, live, paused, failed or unavailable. Only a live channel is asked for its spend at all. */
|
|
public var status: String?
|
|
|
|
public init(externalId: String? = nil, kind: String? = nil, platform: String? = nil, spendCents: Int64? = nil, spendError: String? = nil, status: String? = nil) {
|
|
self.externalId = externalId
|
|
self.kind = kind
|
|
self.platform = platform
|
|
self.spendCents = spendCents
|
|
self.spendError = spendError
|
|
self.status = status
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case externalId
|
|
case kind
|
|
case platform
|
|
case spendCents
|
|
case spendError
|
|
case status
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(externalId, forKey: .externalId)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(platform, forKey: .platform)
|
|
try container.encodeIfPresent(spendCents, forKey: .spendCents)
|
|
try container.encodeIfPresent(spendError, forKey: .spendError)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
}
|
|
}
|
|
|