mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
41 lines
1.6 KiB
Swift
41 lines
1.6 KiB
Swift
//
|
|
// Unsubscribed.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Unsubscribed: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Address is the recipient now opted out, normalized (lower-cased, trimmed) to the form the send gate matches on — so it can differ in case from the address the link carried. */
|
|
public var address: String?
|
|
/** Channel is the ONE surface opted out of: email, sms, social, meta, google or tiktok. The other channels are untouched, and so is this address in every other org. */
|
|
public var channel: String?
|
|
/** Unsubscribed is always true here: the opt-out is idempotent, so a second click on the same link confirms the same thing rather than reporting nothing changed. A refused token never reaches this shape — it is a 403. */
|
|
public var unsubscribed: Bool?
|
|
|
|
public init(address: String? = nil, channel: String? = nil, unsubscribed: Bool? = nil) {
|
|
self.address = address
|
|
self.channel = channel
|
|
self.unsubscribed = unsubscribed
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case address
|
|
case channel
|
|
case unsubscribed
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(address, forKey: .address)
|
|
try container.encodeIfPresent(channel, forKey: .channel)
|
|
try container.encodeIfPresent(unsubscribed, forKey: .unsubscribed)
|
|
}
|
|
}
|
|
|