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.
74 lines
3.0 KiB
Swift
74 lines
3.0 KiB
Swift
//
|
|
// Enrollment.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Enrollment: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Address is the normalized (lower-cased, trimmed) recipient. */
|
|
public var address: String?
|
|
/** Channel is the delivery surface the steps go out on. */
|
|
public var channel: String?
|
|
/** CurrentStep is the index of the step that sends next. */
|
|
public var currentStep: Int64?
|
|
/** EnrolledAt is unix seconds when the contact joined the walk, and orders the enrollment list (newest first). */
|
|
public var enrolledAt: Int64?
|
|
/** ID is the server-assigned enrollment id (\"enr_\" + 128 random bits). */
|
|
public var id: String?
|
|
/** NextRunAt is the unix time the current step comes due; 0 once the walk has ended. It IS the schedule — durable in SQLite, so it survives restarts. */
|
|
public var nextRunAt: Int64?
|
|
/** SequenceID is the sequence being walked. */
|
|
public var sequenceId: String?
|
|
/** Status is active, completed or canceled. */
|
|
public var status: String?
|
|
/** UpdatedAt is unix seconds of the last move: the drip engine writes it each time it advances the walk a step, completes it or cancels it. Together with Status it says when the walk last did anything, which is how a stalled enrollment is told from a finished one. */
|
|
public var updatedAt: Int64?
|
|
|
|
public init(address: String? = nil, channel: String? = nil, currentStep: Int64? = nil, enrolledAt: Int64? = nil, id: String? = nil, nextRunAt: Int64? = nil, sequenceId: String? = nil, status: String? = nil, updatedAt: Int64? = nil) {
|
|
self.address = address
|
|
self.channel = channel
|
|
self.currentStep = currentStep
|
|
self.enrolledAt = enrolledAt
|
|
self.id = id
|
|
self.nextRunAt = nextRunAt
|
|
self.sequenceId = sequenceId
|
|
self.status = status
|
|
self.updatedAt = updatedAt
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case address
|
|
case channel
|
|
case currentStep
|
|
case enrolledAt
|
|
case id
|
|
case nextRunAt
|
|
case sequenceId
|
|
case status
|
|
case updatedAt
|
|
}
|
|
|
|
// 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(currentStep, forKey: .currentStep)
|
|
try container.encodeIfPresent(enrolledAt, forKey: .enrolledAt)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(nextRunAt, forKey: .nextRunAt)
|
|
try container.encodeIfPresent(sequenceId, forKey: .sequenceId)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Enrollment: Identifiable {}
|