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
4.7 KiB
Swift
101 lines
4.7 KiB
Swift
//
|
|
// CreateAppReq.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct CreateAppReq: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** BuildType is `pack` — the zero-config default that detects any project — or `dockerfile`, the explicit escape hatch. An image app never builds. */
|
|
public var buildType: String?
|
|
/** Description is free text about what the application is. */
|
|
public var description: String?
|
|
/** Dockerfile is the path to build from, for buildType `dockerfile`. */
|
|
public var dockerfile: String?
|
|
/** Domains are extra ingress hosts. The canonical default host is always attached; a bare custom host is refused here and must go through add-domain → verify first. */
|
|
public var domains: [String]?
|
|
/** Env is the application's environment. Keys must match `^[A-Za-z_][A-Za-z0-9_]*$`; a variable marked `secret: true` is sealed into KMS and its plaintext is never written to the database. */
|
|
public var env: [EnvVarJSON]?
|
|
/** Environment is the deploy target this app names (\"production\" by default). */
|
|
public var environment: String?
|
|
/** Image is the container image to run, for source `image`. */
|
|
public var image: ImageOrigin?
|
|
/** Name is the application's display name. Required; the slug is derived from it when none is given. */
|
|
public var name: String?
|
|
/** Port is the container port the app listens on. */
|
|
public var port: Int64?
|
|
/** Project is the project to create the application under, from the path. */
|
|
public var project: String?
|
|
/** Replicas is how many copies to run; clamped to the deployment's limit rather than refused. */
|
|
public var replicas: Int64?
|
|
/** Repo is the git source to build from, for source `git`. */
|
|
public var repo: GitOrigin?
|
|
/** Slug is the app's identity in the cluster — its CR name and part of its host. Given or derived from Name, it must match `^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$`, and one already used in this project is 409. */
|
|
public var slug: String?
|
|
/** Source is `git`, which requires repo.url, or `image`, which requires image.repository. Anything else is 400. */
|
|
public var source: String?
|
|
/** StorageGB is the persistent volume size in GiB; absent means stateless. Clamped to the deployment's limit rather than refused. */
|
|
public var storageGb: Int64?
|
|
|
|
public init(buildType: String? = nil, description: String? = nil, dockerfile: String? = nil, domains: [String]? = nil, env: [EnvVarJSON]? = nil, environment: String? = nil, image: ImageOrigin? = nil, name: String? = nil, port: Int64? = nil, project: String? = nil, replicas: Int64? = nil, repo: GitOrigin? = nil, slug: String? = nil, source: String? = nil, storageGb: Int64? = nil) {
|
|
self.buildType = buildType
|
|
self.description = description
|
|
self.dockerfile = dockerfile
|
|
self.domains = domains
|
|
self.env = env
|
|
self.environment = environment
|
|
self.image = image
|
|
self.name = name
|
|
self.port = port
|
|
self.project = project
|
|
self.replicas = replicas
|
|
self.repo = repo
|
|
self.slug = slug
|
|
self.source = source
|
|
self.storageGb = storageGb
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case buildType
|
|
case description
|
|
case dockerfile
|
|
case domains
|
|
case env
|
|
case environment
|
|
case image
|
|
case name
|
|
case port
|
|
case project
|
|
case replicas
|
|
case repo
|
|
case slug
|
|
case source
|
|
case storageGb
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(buildType, forKey: .buildType)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encodeIfPresent(dockerfile, forKey: .dockerfile)
|
|
try container.encodeIfPresent(domains, forKey: .domains)
|
|
try container.encodeIfPresent(env, forKey: .env)
|
|
try container.encodeIfPresent(environment, forKey: .environment)
|
|
try container.encodeIfPresent(image, forKey: .image)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(port, forKey: .port)
|
|
try container.encodeIfPresent(project, forKey: .project)
|
|
try container.encodeIfPresent(replicas, forKey: .replicas)
|
|
try container.encodeIfPresent(repo, forKey: .repo)
|
|
try container.encodeIfPresent(slug, forKey: .slug)
|
|
try container.encodeIfPresent(source, forKey: .source)
|
|
try container.encodeIfPresent(storageGb, forKey: .storageGb)
|
|
}
|
|
}
|
|
|