Skip to main content

hanzo_client/models/
report_run_in.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 ReportRunIn {
16    /// Branch, CommitSha and Diffstat describe what the run produced; Error is the failure when OK is false. Each is clamped, never rejected.
17    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
18    pub branch: Option<String>,
19    /// Changed says whether the run produced any commit. It is INDEPENDENT of OK: a run can succeed and change nothing (there was nothing to do), and a run can fail after committing some of its work. Two questions, two booleans.
20    #[serde(rename = "changed", skip_serializing_if = "Option::is_none")]
21    pub changed: Option<bool>,
22    /// CommitSha is the tip the run pushed, clamped to 128 characters. Empty when it pushed nothing, which is the same case Changed reports false for.
23    #[serde(rename = "commitSha", skip_serializing_if = "Option::is_none")]
24    pub commit_sha: Option<String>,
25    /// Diffstat is the run's own summary of what it changed, as text, clamped to 64 KiB. Free-form: it is shown, never parsed.
26    #[serde(rename = "diffstat", skip_serializing_if = "Option::is_none")]
27    pub diffstat: Option<String>,
28    /// Error is why the run failed, clamped to 64 KiB. It is CLAMPED rather than refused — a truncated reason is worth more than a rejected report, because a rejected report leaves the durable workflow waiting forever.
29    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
30    pub error: Option<String>,
31    /// ID is the machine reporting, from the path.
32    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
33    pub id: Option<String>,
34    /// OK is whether the run succeeded; Changed whether it produced any commit.
35    #[serde(rename = "ok", skip_serializing_if = "Option::is_none")]
36    pub ok: Option<bool>,
37    /// RunID is the routed run being completed, from the path.
38    #[serde(rename = "runId", skip_serializing_if = "Option::is_none")]
39    pub run_id: Option<String>,
40}
41
42impl ReportRunIn {
43    pub fn new() -> ReportRunIn {
44        ReportRunIn {
45            branch: None,
46            changed: None,
47            commit_sha: None,
48            diffstat: None,
49            error: None,
50            id: None,
51            ok: None,
52            run_id: None,
53        }
54    }
55}
56