Skip to main content

hanzo_client/models/
runner_build_req.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct RunnerBuildReq {
16    /// Arch is the target architecture for the artifact lane.
17    #[serde(rename = "arch", skip_serializing_if = "Option::is_none")]
18    pub arch: Option<String>,
19    /// Args are --build-arg values. They are what lets several images off ONE Dockerfile mean different things — the sandbox classes are three entries differing only by STAGE. Validated at the k8s choke point, with VERSION and REVISION taking precedence: those are receipts the builder derives from the tag and the commit, and a caller that could overwrite them could make an image lie about which commit it is.
20    #[serde(rename = "args", skip_serializing_if = "Option::is_none")]
21    pub args: Option<std::collections::HashMap<String, String>>,
22    /// Binaries selects the ARTIFACT lane (artifact.go): build what the repo's hanzo.yml `binaries:` block declares — a Go binary, an npm tarball, a Rust binary — and publish it to hanzoai/s3 instead of pushing an image. It is the same recipe hanzoai/ci reads, sent verbatim, so `image` is meaningless here and must be absent.
23    #[serde(rename = "binaries", skip_serializing_if = "Option::is_none")]
24    pub binaries: Option<Vec<models::BinarySpec>>,
25    /// Branch is the branch to build when no SHA or Ref is given.
26    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
27    pub branch: Option<String>,
28    /// Bucket mirrors hanzo.yml's `bucket:` — where the artifact lane publishes.
29    #[serde(rename = "bucket", skip_serializing_if = "Option::is_none")]
30    pub bucket: Option<String>,
31    /// Context is the build context path within the repo.
32    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
33    pub context: Option<String>,
34    /// DockerTarget is the multi-stage build target to stop at.
35    #[serde(rename = "dockerTarget", skip_serializing_if = "Option::is_none")]
36    pub docker_target: Option<String>,
37    /// Dockerfile is the path to build from; empty uses the zero-config frontend.
38    #[serde(rename = "dockerfile", skip_serializing_if = "Option::is_none")]
39    pub dockerfile: Option<String>,
40    /// Image is the output image ref to push. Required on the image lane, and it must target a registry namespace the caller's org owns.
41    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
42    pub image: Option<String>,
43    /// OS is the target operating system for the artifact lane.
44    #[serde(rename = "os", skip_serializing_if = "Option::is_none")]
45    pub os: Option<String>,
46    /// Ref is the git ref to build when no SHA is given.
47    #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
48    pub r#ref: Option<String>,
49    /// Repo is the repository clone URL to build. Required on the image lane.
50    #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
51    pub repo: Option<String>,
52    /// SHA is the commit to pin; it wins over Ref and Branch.
53    #[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
54    pub sha: Option<String>,
55    /// Tag is the publish path segment, so both entry points write ONE index at ONE URL. It defaults to the pinned ref, and must be named explicitly for a branch.
56    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
57    pub tag: Option<String>,
58}
59
60impl RunnerBuildReq {
61    pub fn new() -> RunnerBuildReq {
62        RunnerBuildReq {
63            arch: None,
64            args: None,
65            binaries: None,
66            branch: None,
67            bucket: None,
68            context: None,
69            docker_target: None,
70            dockerfile: None,
71            image: None,
72            os: None,
73            r#ref: None,
74            repo: None,
75            sha: None,
76            tag: None,
77        }
78    }
79}
80