Skip to main content

hanzo_client/models/
git_ops_app.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 GitOpsApp {
16    /// Automated is whether CD applies new commits without being asked. It reads the PRESENCE of spec.syncPolicy.automated, which is a block rather than a boolean; false means drift is reported and nothing moves.
17    #[serde(rename = "automated", skip_serializing_if = "Option::is_none")]
18    pub automated: Option<bool>,
19    /// Health is CD's verdict on the objects it manages, verbatim: Healthy, Progressing, Degraded, Suspended, Missing or Unknown.
20    #[serde(rename = "health", skip_serializing_if = "Option::is_none")]
21    pub health: Option<String>,
22    /// History is the recent deploy log, NEWEST FIRST and capped at ten. CD appends oldest-first and bounds the list itself; the reversal happens here so a caller never has to know the storage order to show what shipped last. Empty (never null) for an Application that has deployed nothing.
23    #[serde(rename = "history", skip_serializing_if = "Option::is_none")]
24    pub history: Option<Vec<models::GitOpsDeploy>>,
25    /// Name is what CD calls this tracked source, not the workload it deploys — the Application CR's own metadata.name. The fleet ApplicationSet mints these as <namespace>-<app>.
26    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
27    pub name: Option<String>,
28    /// Namespace is where the Application OBJECT lives: CD's own controller namespace, which is the same one for every row here. It is NOT the destination the workloads land in — this endpoint lists cluster-wide and never reads spec.destination.
29    #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
30    pub namespace: Option<String>,
31    /// Operation is the last sync attempt and how it ended. Absent when CD has run none, which is the honest gap between \"never tried\" and \"tried and failed\".
32    #[serde(rename = "operation", skip_serializing_if = "Option::is_none")]
33    pub operation: Option<Box<models::GitOpsOperation>>,
34    /// Path is the directory inside that repository CD renders, relative to its root.
35    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
36    pub path: Option<String>,
37    /// Project is the AppProject fence the sync is admitted under: which repos this Application may pull from and which destinations it may write to. Empty when the CR declares none.
38    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
39    pub project: Option<String>,
40    /// ReconciledAt is when CD last COMPARED this Application against git, RFC 3339. It moves on every comparison, including ones that applied nothing.
41    #[serde(rename = "reconciledAt", skip_serializing_if = "Option::is_none")]
42    pub reconciled_at: Option<String>,
43    /// RepoURL is the git repository CD polls for this Application's desired state.
44    #[serde(rename = "repoURL", skip_serializing_if = "Option::is_none")]
45    pub repo_url: Option<String>,
46    /// Resources is how MANY objects CD manages for this Application (len(status.resources)) — a count, not the objects. Zero for an Application CD has not reconciled.
47    #[serde(rename = "resources", skip_serializing_if = "Option::is_none")]
48    pub resources: Option<i32>,
49    /// Revision is the commit CD last APPLIED (status.sync.revision). Empty means it has applied none — never read that as the head of TargetRevision.
50    #[serde(rename = "revision", skip_serializing_if = "Option::is_none")]
51    pub revision: Option<String>,
52    /// SelfHeal is whether CD also reverts changes made directly in the cluster (syncPolicy.automated.selfHeal). Meaningless unless Automated.
53    #[serde(rename = "selfHeal", skip_serializing_if = "Option::is_none")]
54    pub self_heal: Option<bool>,
55    /// Sync is CD's verdict on git versus cluster, verbatim: Synced, OutOfSync or Unknown. It is about the applied REVISION, so an Application can be Synced to a commit that is several behind the branch it tracks.
56    #[serde(rename = "sync", skip_serializing_if = "Option::is_none")]
57    pub sync: Option<String>,
58    /// TargetRevision is the git ref CD TRACKS — usually a branch such as \"main\". It is what CD aims at; Revision is what it has reached.
59    #[serde(rename = "targetRevision", skip_serializing_if = "Option::is_none")]
60    pub target_revision: Option<String>,
61}
62
63impl GitOpsApp {
64    pub fn new() -> GitOpsApp {
65        GitOpsApp {
66            automated: None,
67            health: None,
68            history: None,
69            name: None,
70            namespace: None,
71            operation: None,
72            path: None,
73            project: None,
74            reconciled_at: None,
75            repo_url: None,
76            resources: None,
77            revision: None,
78            self_heal: None,
79            sync: None,
80            target_revision: None,
81        }
82    }
83}
84