hanzo_client/models/projects_deployment.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 ProjectsDeployment {
16 /// Bucket is the object-store bucket its files were written to.
17 #[serde(rename = "bucket", skip_serializing_if = "Option::is_none")]
18 pub bucket: Option<String>,
19 /// Bytes is their total size in bytes.
20 #[serde(rename = "bytes", skip_serializing_if = "Option::is_none")]
21 pub bytes: Option<i32>,
22 /// Commit is the revision that was built, for a deployment that came from a repository. Absent for an uploaded artifact, which has no revision.
23 #[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
24 pub commit: Option<String>,
25 /// CreatedAt is when the deployment was queued, as Unix seconds.
26 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
27 pub created_at: Option<i32>,
28 /// Files is how many objects the deployment published.
29 #[serde(rename = "files", skip_serializing_if = "Option::is_none")]
30 pub files: Option<i32>,
31 /// ID identifies this one deployment attempt, and is what CI quotes back to complete it.
32 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
33 pub id: Option<String>,
34 /// LiveURL is where this deployment serves, once it is live.
35 #[serde(rename = "liveUrl", skip_serializing_if = "Option::is_none")]
36 pub live_url: Option<String>,
37 /// Message is what happened, in words — the build's own note, or on a failure why it failed.
38 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
39 pub message: Option<String>,
40 /// Prefix is the key prefix within that bucket holding EXACTLY this deployment's objects — the unit an upload grant is scoped to, so a grant for one deployment cannot write over another.
41 #[serde(rename = "prefix", skip_serializing_if = "Option::is_none")]
42 pub prefix: Option<String>,
43 /// ProjectID is the project this deployment belongs to.
44 #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
45 pub project_id: Option<String>,
46 /// Source is what caused the deployment — a git push, an uploaded artifact, a generated site.
47 #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
48 pub source: Option<String>,
49 /// Status is where the attempt got to — queued, live, or failed. A deployment that is live is not necessarily the one SERVING: the project's own currentDeploymentId says which is.
50 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
51 pub status: Option<String>,
52 /// UpdatedAt is when it last changed state, as Unix seconds — so the gap between the two is how long the build took.
53 #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
54 pub updated_at: Option<i32>,
55 /// Upload is the prefix-scoped, short-lived S3 write grant handed to CI with a queued git deployment, so it needs no bucket credential (grant.go). Present ONLY on the 202 that creates the deployment — it is never stored and never replayed on a later read, so a grant cannot outlive the build it was minted for by being fetched again.
56 #[serde(rename = "upload", skip_serializing_if = "Option::is_none")]
57 pub upload: Option<Box<models::ProjectsUploadGrant>>,
58 /// Version counts deployments of this project from 1, so the history reads as an ordered sequence rather than by timestamp. It is per project, not global.
59 #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
60 pub version: Option<i32>,
61}
62
63impl ProjectsDeployment {
64 pub fn new() -> ProjectsDeployment {
65 ProjectsDeployment {
66 bucket: None,
67 bytes: None,
68 commit: None,
69 created_at: None,
70 files: None,
71 id: None,
72 live_url: None,
73 message: None,
74 prefix: None,
75 project_id: None,
76 source: None,
77 status: None,
78 updated_at: None,
79 upload: None,
80 version: None,
81 }
82 }
83}
84