1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
* Hanzo Cloud API
*
* 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/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppView {
/// BuildType is how a git app builds: `pack`, the zero-config default that detects the project, or `dockerfile`. An image app carries `image`, which means it never builds.
#[serde(rename = "buildType", skip_serializing_if = "Option::is_none")]
pub build_type: Option<String>,
/// CreatedAt is when the app was created, unix seconds.
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<i32>,
/// CurrentDeploymentID is the deployment that is live — the pointer a deploy advances monotonically by version, so it never regresses to an older one. Empty until the first deploy reaches the cluster.
#[serde(rename = "currentDeploymentId", skip_serializing_if = "Option::is_none")]
pub current_deployment_id: Option<String>,
/// Description is free text about what the app is. Nothing derives from it.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Dockerfile is the path inside the repo to build from, for buildType `dockerfile`. The build path keys off its presence, and it is validated at create against the same allowlist the privileged build enforces.
#[serde(rename = "dockerfile", skip_serializing_if = "Option::is_none")]
pub dockerfile: Option<String>,
/// Domains are the ingress hosts rendered into the app's CR, its own `<slug>.<org>.<sites host>` first. That one is seeded at create and cannot be removed; a custom host joins only after add-domain and DNS verification.
#[serde(rename = "domains", skip_serializing_if = "Option::is_none")]
pub domains: Option<Vec<String>>,
/// Env is the app's environment variables, with every SECRET value masked to \"\" — the plaintext is in KMS and this surface never echoes it. That masking is why an empty secret value means \"keep what is sealed\" when posted back.
#[serde(rename = "env", skip_serializing_if = "Option::is_none")]
pub env: Option<Vec<models::EnvVarJson>>,
/// Environment is the deploy target this app names, `production` when none was given. It is a LABEL: /v1/platform/environments derives the environment list from the apps that name one, so an environment exists as long as an app points at it and no route creates or deletes one.
#[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
pub environment: Option<String>,
/// Health rolls ready-vs-desired replicas up to a colour: green (all ready), yellow (some ready, or deliberately scaled to zero), red (none), or \"\" when the cluster reports no replica counts at all — unknown, never a guessed green.
#[serde(rename = "health", skip_serializing_if = "Option::is_none")]
pub health: Option<String>,
/// ID is the server-minted application id (`app_…`). Routes address an app by project and slug; this is the key its deployments and builds carry.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Image is the image a source `image` app runs. For a git app only the tag is filled, stamped by the deploy that went live; the built ref is on the deployment.
#[serde(rename = "image", skip_serializing_if = "Option::is_none")]
pub image: Option<Box<models::ImageView>>,
/// Name is the display name. It is not an address — the slug is.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Namespace is where the app's cluster objects live, `tenant-<org>`. It is derived from the validated org and is never accepted from a request.
#[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
pub namespace: Option<String>,
/// Org is the tenant that owns the app. It comes from the validated identity, never from the request, and it is the boundary every route is scoped to.
#[serde(rename = "org", skip_serializing_if = "Option::is_none")]
pub org: Option<String>,
/// Phase is the operator's own `status.phase` for the app's Service CR, read from the cluster on this request. Empty when there is no CR yet or the cluster could not be read.
#[serde(rename = "phase", skip_serializing_if = "Option::is_none")]
pub phase: Option<String>,
/// Port is the container port traffic is sent to. 8080 when the create asked for none, or for one outside 1–65535.
#[serde(rename = "port", skip_serializing_if = "Option::is_none")]
pub port: Option<i32>,
/// ProjectID is the IAM project the app lives under, and it is that project's NAME — the (org,name) key IAM identifies it by, which is also what the `:project` path segment carries. There is no platform-minted project id.
#[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
pub project_id: Option<String>,
/// Replicas is how many copies the CR declares. It is CLAMPED to the deployment's ceiling rather than refused, so it can be below what was asked.
#[serde(rename = "replicas", skip_serializing_if = "Option::is_none")]
pub replicas: Option<i32>,
/// Repo is the git origin a source `git` app builds from, and the repo+branch a landed push has to match to build it.
#[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
pub repo: Option<Box<models::GitSource>>,
/// SecretSync is how far the app's secret env has got into the cluster: \"\"|pending|syncing|ready|failed (secrets.go). It is best-effort and never fails a deploy, so `pending` is ordinary right after one.
#[serde(rename = "secretSync", skip_serializing_if = "Option::is_none")]
pub secret_sync: Option<String>,
/// SecretSyncDetail is the honest reason when the sync is not ready — a missing CRD, an RBAC grant, a per-tenant credential. Empty when it is.
#[serde(rename = "secretSyncDetail", skip_serializing_if = "Option::is_none")]
pub secret_sync_detail: Option<String>,
/// Slug is the app's identity in the cluster: the operator CR's name, the first label of its default host, and the `:app` path segment. Unique per project.
#[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
pub slug: Option<String>,
/// Source is what the app deploys FROM: `git`, which builds Repo, or `image`, which runs Image as it is. It decides whether a deploy builds at all.
#[serde(rename = "source", skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
/// Status is the lifecycle THIS store records: draft (created, nothing in the cluster yet), building, deploying, live, stopped or error. What the cluster itself says is Phase and Health.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// StorageGB is the persistent volume size in GiB. Absent means stateless — no volume at all — and it is clamped like Replicas.
#[serde(rename = "storageGb", skip_serializing_if = "Option::is_none")]
pub storage_gb: Option<i32>,
/// UpdatedAt is when it last changed, unix seconds. Every lifecycle transition moves it, so it tracks deploys as well as edits.
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<i32>,
}
impl AppView {
pub fn new() -> AppView {
AppView {
build_type: None,
created_at: None,
current_deployment_id: None,
description: None,
dockerfile: None,
domains: None,
env: None,
environment: None,
health: None,
id: None,
image: None,
name: None,
namespace: None,
org: None,
phase: None,
port: None,
project_id: None,
replicas: None,
repo: None,
secret_sync: None,
secret_sync_detail: None,
slug: None,
source: None,
status: None,
storage_gb: None,
updated_at: None,
}
}
}