hanzo_client/models/deployment_view.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 DeploymentView {
16 /// ApplicationID is the app this deployed — the app's `id`, not its slug.
17 #[serde(rename = "applicationId", skip_serializing_if = "Option::is_none")]
18 pub application_id: Option<String>,
19 /// BuildID is the build record behind a git deploy, whose logs and status live at /v1/platform/builds. Empty for an image deploy.
20 #[serde(rename = "buildId", skip_serializing_if = "Option::is_none")]
21 pub build_id: Option<String>,
22 /// Commit is the git ref this built — the commit a deploy or a push named, else the app's branch. Empty for an image deploy, which builds nothing.
23 #[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
24 pub commit: Option<String>,
25 /// CreatedAt is when the attempt was recorded, unix seconds.
26 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
27 pub created_at: Option<i32>,
28 /// ID is the deployment's id (`dep_…`), minted when the attempt is recorded. The app's currentDeploymentId points at one of these.
29 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
30 pub id: Option<String>,
31 /// Image is the full `repo:tag` this deployment put in the CR. For a git deploy it is the ref the in-cluster build pushes to, known before the build runs.
32 #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
33 pub image: Option<String>,
34 /// Message is why this attempt is not live: the failure, or the note that a newer deployment went live before this build finished. Empty while it is fine.
35 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
36 pub message: Option<String>,
37 /// Org is the tenant the deployment belongs to, from the validated identity.
38 #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
39 pub org: Option<String>,
40 /// Source is which lane produced it: `git` (built from the repo) or `image` (an already-built ref deployed as-is, including promote and rollback).
41 #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
42 pub source: Option<String>,
43 /// Status is where the attempt got to: `building` while its image is being built, `deploying` once its CR reached the cluster — which is the terminal success state, the app's own status is what turns `live` — `error` with the reason in Message, or `superseded` when a newer version went live first.
44 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
45 pub status: Option<String>,
46 /// UpdatedAt is its last transition, unix seconds — so for a terminal deployment it is when it reached that state.
47 #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
48 pub updated_at: Option<i32>,
49 /// Version counts this app's deployments, from 1 and monotonically. It is what ORDERS them: a deploy only goes live if no higher version already is, so a build that finishes late is superseded instead of overwriting a newer one.
50 #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
51 pub version: Option<i32>,
52}
53
54impl DeploymentView {
55 pub fn new() -> DeploymentView {
56 DeploymentView {
57 application_id: None,
58 build_id: None,
59 commit: None,
60 created_at: None,
61 id: None,
62 image: None,
63 message: None,
64 org: None,
65 source: None,
66 status: None,
67 updated_at: None,
68 version: None,
69 }
70 }
71}
72