Skip to main content

hanzo_client/models/
declaration.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 Declaration {
16    /// Application is the CD Application name the generator mints: <org>-<name>. It is the join key against /v1/platform/cd.
17    #[serde(rename = "application", skip_serializing_if = "Option::is_none")]
18    pub application: Option<String>,
19    /// Automated is cd.automated: false means the Application reports drift and NOTHING moves. It is off by default for a new file on purpose.
20    #[serde(rename = "automated", skip_serializing_if = "Option::is_none")]
21    pub automated: Option<bool>,
22    /// image.digest — wins over tag
23    #[serde(rename = "digest", skip_serializing_if = "Option::is_none")]
24    pub digest: Option<String>,
25    /// Env is the declared container environment, as the chart's list of {name,value}. It is read back so a re-declare of an identical body is a no-op rather than a refusal — idempotency is what makes a retry safe.
26    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
27    pub env: Option<Vec<models::DeclareEnv>>,
28    /// ingress.hosts, both shapes flattened
29    #[serde(rename = "hosts", skip_serializing_if = "Option::is_none")]
30    pub hosts: Option<Vec<String>>,
31    /// the Helm release name — the file's basename
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// Org is the owner. It is ALSO the values directory and the destination namespace, because those are one value under one name — see the header.
35    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
36    pub org: Option<String>,
37    /// Path is the file, relative to the repository root.
38    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
39    pub path: Option<String>,
40    /// Project is the AppProject the sync is admitted under, derived from the directory exactly as the ApplicationSet derives it. It differs from Org for a reserved directory, which syncs under the platform fence.
41    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
42    pub project: Option<String>,
43    #[serde(rename = "replicas", skip_serializing_if = "Option::is_none")]
44    pub replicas: Option<i32>,
45    /// image.repository
46    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
47    pub repository: Option<String>,
48    /// image.tag
49    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
50    pub tag: Option<String>,
51}
52
53impl Declaration {
54    pub fn new() -> Declaration {
55        Declaration {
56            application: None,
57            automated: None,
58            digest: None,
59            env: None,
60            hosts: None,
61            name: None,
62            org: None,
63            path: None,
64            project: None,
65            replicas: None,
66            repository: None,
67            tag: None,
68        }
69    }
70}
71