Files
swift-sdk/Sources/Hanzo/Models/ProjectsDeployment.swift
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
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.
2026-09-05 18:55:38 -07:00

104 lines
4.9 KiB
Swift

//
// ProjectsDeployment.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct ProjectsDeployment: Sendable, Codable, ParameterConvertible, Hashable {
/** Bucket is the object-store bucket its files were written to. */
public var bucket: String?
/** Bytes is their total size in bytes. */
public var bytes: Int64?
/** Commit is the revision that was built, for a deployment that came from a repository. Absent for an uploaded artifact, which has no revision. */
public var commit: String?
/** CreatedAt is when the deployment was queued, as Unix seconds. */
public var createdAt: Int64?
/** Files is how many objects the deployment published. */
public var files: Int64?
/** ID identifies this one deployment attempt, and is what CI quotes back to complete it. */
public var id: String?
/** LiveURL is where this deployment serves, once it is live. */
public var liveUrl: String?
/** Message is what happened, in words — the build's own note, or on a failure why it failed. */
public var message: String?
/** Prefix is the key prefix within that bucket holding EXACTLY this deployment's objects — the unit an upload grant is scoped to, so a grant for one deployment cannot write over another. */
public var _prefix: String?
/** ProjectID is the project this deployment belongs to. */
public var projectId: String?
/** Source is what caused the deployment — a git push, an uploaded artifact, a generated site. */
public var source: String?
/** Status is where the attempt got to — queued, live, or failed. A deployment that is live is not necessarily the one SERVING: the project's own currentDeploymentId says which is. */
public var status: String?
/** UpdatedAt is when it last changed state, as Unix seconds — so the gap between the two is how long the build took. */
public var updatedAt: Int64?
/** Upload is the prefix-scoped, short-lived S3 write grant handed to CI with a queued git deployment, so it needs no bucket credential (grant.go). Present ONLY on the 202 that creates the deployment — it is never stored and never replayed on a later read, so a grant cannot outlive the build it was minted for by being fetched again. */
public var upload: ProjectsUploadGrant?
/** Version counts deployments of this project from 1, so the history reads as an ordered sequence rather than by timestamp. It is per project, not global. */
public var version: Int64?
public init(bucket: String? = nil, bytes: Int64? = nil, commit: String? = nil, createdAt: Int64? = nil, files: Int64? = nil, id: String? = nil, liveUrl: String? = nil, message: String? = nil, _prefix: String? = nil, projectId: String? = nil, source: String? = nil, status: String? = nil, updatedAt: Int64? = nil, upload: ProjectsUploadGrant? = nil, version: Int64? = nil) {
self.bucket = bucket
self.bytes = bytes
self.commit = commit
self.createdAt = createdAt
self.files = files
self.id = id
self.liveUrl = liveUrl
self.message = message
self._prefix = _prefix
self.projectId = projectId
self.source = source
self.status = status
self.updatedAt = updatedAt
self.upload = upload
self.version = version
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case bucket
case bytes
case commit
case createdAt
case files
case id
case liveUrl
case message
case _prefix = "prefix"
case projectId
case source
case status
case updatedAt
case upload
case version
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(bucket, forKey: .bucket)
try container.encodeIfPresent(bytes, forKey: .bytes)
try container.encodeIfPresent(commit, forKey: .commit)
try container.encodeIfPresent(createdAt, forKey: .createdAt)
try container.encodeIfPresent(files, forKey: .files)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(liveUrl, forKey: .liveUrl)
try container.encodeIfPresent(message, forKey: .message)
try container.encodeIfPresent(_prefix, forKey: ._prefix)
try container.encodeIfPresent(projectId, forKey: .projectId)
try container.encodeIfPresent(source, forKey: .source)
try container.encodeIfPresent(status, forKey: .status)
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
try container.encodeIfPresent(upload, forKey: .upload)
try container.encodeIfPresent(version, forKey: .version)
}
}
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
extension ProjectsDeployment: Identifiable {}