Skip to main content

windmill_api/models/
workspace_comparison.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.776.0
7 * Contact: contact@windmill.dev
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 WorkspaceComparison {
16    /// All items with changes ahead are visible by the user of the request.
17    #[serde(rename = "all_ahead_items_visible")]
18    pub all_ahead_items_visible: bool,
19    /// All items with changes behind are visible by the user of the request.
20    #[serde(rename = "all_behind_items_visible")]
21    pub all_behind_items_visible: bool,
22    /// Whether the comparison was skipped. This happens with old forks that where not being kept track of
23    #[serde(rename = "skipped_comparison")]
24    pub skipped_comparison: bool,
25    /// List of differences found between workspaces
26    #[serde(rename = "diffs")]
27    pub diffs: Vec<models::WorkspaceItemDiff>,
28    #[serde(rename = "summary")]
29    pub summary: Box<models::CompareSummary>,
30    #[serde(rename = "hidden_ahead")]
31    pub hidden_ahead: Box<models::HiddenItemsSummary>,
32    #[serde(rename = "hidden_behind")]
33    pub hidden_behind: Box<models::HiddenItemsSummary>,
34    /// For a pair outside the fork lineage, when its candidate set was last seeded by an explicit full scan. Absent when the pair has never been scanned (an empty `diffs` then says nothing about whether the workspaces agree) or when the pair is a lineage pair, which the tally keeps current.
35    #[serde(rename = "full_scan_at", skip_serializing_if = "Option::is_none")]
36    pub full_scan_at: Option<String>,
37}
38
39impl WorkspaceComparison {
40    pub fn new(all_ahead_items_visible: bool, all_behind_items_visible: bool, skipped_comparison: bool, diffs: Vec<models::WorkspaceItemDiff>, summary: models::CompareSummary, hidden_ahead: models::HiddenItemsSummary, hidden_behind: models::HiddenItemsSummary) -> WorkspaceComparison {
41        WorkspaceComparison {
42            all_ahead_items_visible,
43            all_behind_items_visible,
44            skipped_comparison,
45            diffs,
46            summary: Box::new(summary),
47            hidden_ahead: Box::new(hidden_ahead),
48            hidden_behind: Box::new(hidden_behind),
49            full_scan_at: None,
50        }
51    }
52}
53