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.
101 lines
5.6 KiB
Swift
101 lines
5.6 KiB
Swift
//
|
|
// GitOpsApp.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct GitOpsApp: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Automated is whether CD applies new commits without being asked. It reads the PRESENCE of spec.syncPolicy.automated, which is a block rather than a boolean; false means drift is reported and nothing moves. */
|
|
public var automated: Bool?
|
|
/** Health is CD's verdict on the objects it manages, verbatim: Healthy, Progressing, Degraded, Suspended, Missing or Unknown. */
|
|
public var health: String?
|
|
/** History is the recent deploy log, NEWEST FIRST and capped at ten. CD appends oldest-first and bounds the list itself; the reversal happens here so a caller never has to know the storage order to show what shipped last. Empty (never null) for an Application that has deployed nothing. */
|
|
public var history: [GitOpsDeploy]?
|
|
/** Name is what CD calls this tracked source, not the workload it deploys — the Application CR's own metadata.name. The fleet ApplicationSet mints these as <namespace>-<app>. */
|
|
public var name: String?
|
|
/** Namespace is where the Application OBJECT lives: CD's own controller namespace, which is the same one for every row here. It is NOT the destination the workloads land in — this endpoint lists cluster-wide and never reads spec.destination. */
|
|
public var namespace: String?
|
|
/** Operation is the last sync attempt and how it ended. Absent when CD has run none, which is the honest gap between \"never tried\" and \"tried and failed\". */
|
|
public var operation: GitOpsOperation?
|
|
/** Path is the directory inside that repository CD renders, relative to its root. */
|
|
public var path: String?
|
|
/** Project is the AppProject fence the sync is admitted under: which repos this Application may pull from and which destinations it may write to. Empty when the CR declares none. */
|
|
public var project: String?
|
|
/** ReconciledAt is when CD last COMPARED this Application against git, RFC 3339. It moves on every comparison, including ones that applied nothing. */
|
|
public var reconciledAt: String?
|
|
/** RepoURL is the git repository CD polls for this Application's desired state. */
|
|
public var repoURL: String?
|
|
/** Resources is how MANY objects CD manages for this Application (len(status.resources)) — a count, not the objects. Zero for an Application CD has not reconciled. */
|
|
public var resources: Int64?
|
|
/** Revision is the commit CD last APPLIED (status.sync.revision). Empty means it has applied none — never read that as the head of TargetRevision. */
|
|
public var revision: String?
|
|
/** SelfHeal is whether CD also reverts changes made directly in the cluster (syncPolicy.automated.selfHeal). Meaningless unless Automated. */
|
|
public var selfHeal: Bool?
|
|
/** Sync is CD's verdict on git versus cluster, verbatim: Synced, OutOfSync or Unknown. It is about the applied REVISION, so an Application can be Synced to a commit that is several behind the branch it tracks. */
|
|
public var sync: String?
|
|
/** TargetRevision is the git ref CD TRACKS — usually a branch such as \"main\". It is what CD aims at; Revision is what it has reached. */
|
|
public var targetRevision: String?
|
|
|
|
public init(automated: Bool? = nil, health: String? = nil, history: [GitOpsDeploy]? = nil, name: String? = nil, namespace: String? = nil, operation: GitOpsOperation? = nil, path: String? = nil, project: String? = nil, reconciledAt: String? = nil, repoURL: String? = nil, resources: Int64? = nil, revision: String? = nil, selfHeal: Bool? = nil, sync: String? = nil, targetRevision: String? = nil) {
|
|
self.automated = automated
|
|
self.health = health
|
|
self.history = history
|
|
self.name = name
|
|
self.namespace = namespace
|
|
self.operation = operation
|
|
self.path = path
|
|
self.project = project
|
|
self.reconciledAt = reconciledAt
|
|
self.repoURL = repoURL
|
|
self.resources = resources
|
|
self.revision = revision
|
|
self.selfHeal = selfHeal
|
|
self.sync = sync
|
|
self.targetRevision = targetRevision
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case automated
|
|
case health
|
|
case history
|
|
case name
|
|
case namespace
|
|
case operation
|
|
case path
|
|
case project
|
|
case reconciledAt
|
|
case repoURL
|
|
case resources
|
|
case revision
|
|
case selfHeal
|
|
case sync
|
|
case targetRevision
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(automated, forKey: .automated)
|
|
try container.encodeIfPresent(health, forKey: .health)
|
|
try container.encodeIfPresent(history, forKey: .history)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(namespace, forKey: .namespace)
|
|
try container.encodeIfPresent(operation, forKey: .operation)
|
|
try container.encodeIfPresent(path, forKey: .path)
|
|
try container.encodeIfPresent(project, forKey: .project)
|
|
try container.encodeIfPresent(reconciledAt, forKey: .reconciledAt)
|
|
try container.encodeIfPresent(repoURL, forKey: .repoURL)
|
|
try container.encodeIfPresent(resources, forKey: .resources)
|
|
try container.encodeIfPresent(revision, forKey: .revision)
|
|
try container.encodeIfPresent(selfHeal, forKey: .selfHeal)
|
|
try container.encodeIfPresent(sync, forKey: .sync)
|
|
try container.encodeIfPresent(targetRevision, forKey: .targetRevision)
|
|
}
|
|
}
|
|
|