Files
swift-sdk/Sources/Hanzo/Models/ProjectsUploadGrant.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

51 lines
2.3 KiB
Swift

//
// ProjectsUploadGrant.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct ProjectsUploadGrant: Sendable, Codable, ParameterConvertible, Hashable {
/** ExpiresAt is when the grant stops being accepted, as Unix seconds. It is short-lived by design and is handed out ONCE, on the response that queues the deployment — a later read of that deployment does not carry it, so a grant cannot be fetched again after the build it was minted for. */
public var expiresAt: Int64?
/** Fields are form values every POST must carry VERBATIM, alongside `key` and `file`. The signature covers them, so altering any one of them — including widening the key to reach outside the prefix — invalidates the grant rather than extending it. */
public var fields: [String: String]?
/** MaxBytes bounds ONE object, not the upload as a whole. */
public var maxBytes: Int64?
/** Prefix is the only place this grant can write: the deployment's own key prefix. It authorizes WRITES ONLY, which is why completing a deployment reconciles the prefix against a manifest instead of letting CI delete. */
public var _prefix: String?
/** URL is the address to POST each object to. It is signed for the PUBLIC endpoint, because the signature covers the host and CI posts from outside the cluster. */
public var url: String?
public init(expiresAt: Int64? = nil, fields: [String: String]? = nil, maxBytes: Int64? = nil, _prefix: String? = nil, url: String? = nil) {
self.expiresAt = expiresAt
self.fields = fields
self.maxBytes = maxBytes
self._prefix = _prefix
self.url = url
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case expiresAt
case fields
case maxBytes
case _prefix = "prefix"
case url
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(expiresAt, forKey: .expiresAt)
try container.encodeIfPresent(fields, forKey: .fields)
try container.encodeIfPresent(maxBytes, forKey: .maxBytes)
try container.encodeIfPresent(_prefix, forKey: ._prefix)
try container.encodeIfPresent(url, forKey: .url)
}
}