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.
99 lines
3.7 KiB
Swift
99 lines
3.7 KiB
Swift
//
|
|
// Trial.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Trial: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** when it started assigning */
|
|
public var createdAt: String?
|
|
/** the credential that registered it */
|
|
public var createdBy: String?
|
|
/** when the promotion took effect */
|
|
public var decidedAt: String?
|
|
/** the credential that promoted the winner */
|
|
public var decidedBy: String?
|
|
/** the event that enrols a subject — the analysis denominator */
|
|
public var exposureEvent: String?
|
|
/** the assignment flag this experiment drives */
|
|
public var flagKey: String?
|
|
/** the experiment's slug, unique within the project */
|
|
public var id: String?
|
|
/** the event that counts as a conversion — the numerator */
|
|
public var metricEvent: String?
|
|
/** free text for a reader */
|
|
public var name: String?
|
|
/** the sub-scope within the org, stamped from the principal */
|
|
public var project: String?
|
|
/** running while it assigns and measures, decided once a winner is promoted */
|
|
public var status: String?
|
|
/** the unit assigned and measured: user, org, session or audience */
|
|
public var subjectKind: String?
|
|
/** the arms, weighted, one of them the control */
|
|
public var variants: [Arm]?
|
|
/** the arm promoted to the whole rollout */
|
|
public var winner: String?
|
|
|
|
public init(createdAt: String? = nil, createdBy: String? = nil, decidedAt: String? = nil, decidedBy: String? = nil, exposureEvent: String? = nil, flagKey: String? = nil, id: String? = nil, metricEvent: String? = nil, name: String? = nil, project: String? = nil, status: String? = nil, subjectKind: String? = nil, variants: [Arm]? = nil, winner: String? = nil) {
|
|
self.createdAt = createdAt
|
|
self.createdBy = createdBy
|
|
self.decidedAt = decidedAt
|
|
self.decidedBy = decidedBy
|
|
self.exposureEvent = exposureEvent
|
|
self.flagKey = flagKey
|
|
self.id = id
|
|
self.metricEvent = metricEvent
|
|
self.name = name
|
|
self.project = project
|
|
self.status = status
|
|
self.subjectKind = subjectKind
|
|
self.variants = variants
|
|
self.winner = winner
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case createdAt
|
|
case createdBy
|
|
case decidedAt
|
|
case decidedBy
|
|
case exposureEvent
|
|
case flagKey
|
|
case id
|
|
case metricEvent
|
|
case name
|
|
case project
|
|
case status
|
|
case subjectKind
|
|
case variants
|
|
case winner
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(createdBy, forKey: .createdBy)
|
|
try container.encodeIfPresent(decidedAt, forKey: .decidedAt)
|
|
try container.encodeIfPresent(decidedBy, forKey: .decidedBy)
|
|
try container.encodeIfPresent(exposureEvent, forKey: .exposureEvent)
|
|
try container.encodeIfPresent(flagKey, forKey: .flagKey)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(metricEvent, forKey: .metricEvent)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(project, forKey: .project)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(subjectKind, forKey: .subjectKind)
|
|
try container.encodeIfPresent(variants, forKey: .variants)
|
|
try container.encodeIfPresent(winner, forKey: .winner)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Trial: Identifiable {}
|