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.
64 lines
3.0 KiB
Swift
64 lines
3.0 KiB
Swift
//
|
|
// PatchSyncIn.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct PatchSyncIn: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Actor is the loop-guard identity the sync writes as. Omitted, the stored actor stands. */
|
|
public var actor: String?
|
|
/** Direction is both, pull, push or off. Omitted, the stored direction stands. */
|
|
public var direction: String?
|
|
/** ID is the sync to update, from the path. */
|
|
public var id: String?
|
|
/** Kind names a different kind of sync, and is refused, for the same reason. */
|
|
public var kind: String?
|
|
/** Source, Target and Kind are DECLARED HERE IN ORDER TO BE REFUSED. They are immutable by design — re-pointing a sync is a delete and a create, so a link can never silently start syncing somewhere else — but an UNDECLARED field is dropped by the binder before the handler sees it, so a request asking to repoint answered 200, changed nothing, and said nothing. The operator then believes a moved repository has been repointed and it has not. Live: a sync still naming github.com/hanzoai/cloud after the repository moved to hanzo-inc/cloud failed every reconcile with \"Repository not found\", and the PATCH that appeared to fix it did nothing at all. Declaring the fields is what lets the documented immutability actually answer. Source names a new upstream, and is refused. Delete this sync and create the one you want. */
|
|
public var source: EndpointReq?
|
|
/** Target names a new native repository, and is refused, for the same reason. */
|
|
public var target: EndpointReq?
|
|
/** Trigger is webhook, poll or manual. Omitted, the stored trigger stands. */
|
|
public var trigger: String?
|
|
|
|
public init(actor: String? = nil, direction: String? = nil, id: String? = nil, kind: String? = nil, source: EndpointReq? = nil, target: EndpointReq? = nil, trigger: String? = nil) {
|
|
self.actor = actor
|
|
self.direction = direction
|
|
self.id = id
|
|
self.kind = kind
|
|
self.source = source
|
|
self.target = target
|
|
self.trigger = trigger
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case actor
|
|
case direction
|
|
case id
|
|
case kind
|
|
case source
|
|
case target
|
|
case trigger
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(actor, forKey: .actor)
|
|
try container.encodeIfPresent(direction, forKey: .direction)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(source, forKey: .source)
|
|
try container.encodeIfPresent(target, forKey: .target)
|
|
try container.encodeIfPresent(trigger, forKey: .trigger)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension PatchSyncIn: Identifiable {}
|