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.
46 lines
1.6 KiB
Swift
46 lines
1.6 KiB
Swift
//
|
|
// Suppression.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Suppression: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Address is the recipient, normalized (lower-cased, trimmed) so an opt-out cannot be slipped past on a case or whitespace difference. Required. */
|
|
public var address: String?
|
|
/** Channel is the surface opted out of: email, sms, social, meta, google or tiktok. Empty means email. Opting out of one leaves the others reachable. */
|
|
public var channel: String?
|
|
/** CreatedAt is unix seconds, server-assigned. */
|
|
public var createdAt: Int64?
|
|
/** Reason is a free-text note, capped at 1024 bytes. The public one-click endpoint records \"one-click unsubscribe\". */
|
|
public var reason: String?
|
|
|
|
public init(address: String? = nil, channel: String? = nil, createdAt: Int64? = nil, reason: String? = nil) {
|
|
self.address = address
|
|
self.channel = channel
|
|
self.createdAt = createdAt
|
|
self.reason = reason
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case address
|
|
case channel
|
|
case createdAt
|
|
case reason
|
|
}
|
|
|
|
// 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(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(reason, forKey: .reason)
|
|
}
|
|
}
|
|
|