Skip to main content

windmill_api/models/
get_approval_info_200_response.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.815.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 GetApprovalInfo200Response {
16    #[serde(rename = "flow_id")]
17    pub flow_id: uuid::Uuid,
18    /// form schema for the approval step
19    #[serde(rename = "form_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub form_schema: Option<Option<serde_json::Value>>,
21    /// description of the approval step
22    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub description: Option<Option<serde_json::Value>>,
24    #[serde(rename = "approval_conditions", skip_serializing_if = "Option::is_none")]
25    pub approval_conditions: Option<Box<models::GetApprovalInfo200ResponseApprovalConditions>>,
26    /// whether the current user/token holder can approve
27    #[serde(rename = "can_approve")]
28    pub can_approve: bool,
29    /// whether user authentication is required to approve
30    #[serde(rename = "user_auth_required")]
31    pub user_auth_required: bool,
32    /// whether to hide the cancel button in the UI
33    #[serde(rename = "hide_cancel", skip_serializing_if = "Option::is_none")]
34    pub hide_cancel: Option<bool>,
35    /// how the approval page presents the request
36    #[serde(rename = "skin")]
37    pub skin: Skin,
38    /// summary of the approval step, for the page title
39    #[serde(rename = "step_summary", skip_serializing_if = "Option::is_none")]
40    pub step_summary: Option<String>,
41    /// summary of the flow or workflow the approval belongs to
42    #[serde(rename = "flow_summary", skip_serializing_if = "Option::is_none")]
43    pub flow_summary: Option<String>,
44    #[serde(rename = "approvers")]
45    pub approvers: Vec<models::GetApprovalInfo200ResponseApproversInner>,
46    /// Share-read-link token for the flow. An authenticated workspace member can append it as a `view_token` query param on the run page to read a flow they don't otherwise have access to.
47    #[serde(rename = "view_token", skip_serializing_if = "Option::is_none")]
48    pub view_token: Option<String>,
49}
50
51impl GetApprovalInfo200Response {
52    pub fn new(flow_id: uuid::Uuid, can_approve: bool, user_auth_required: bool, skin: Skin, approvers: Vec<models::GetApprovalInfo200ResponseApproversInner>) -> GetApprovalInfo200Response {
53        GetApprovalInfo200Response {
54            flow_id,
55            form_schema: None,
56            description: None,
57            approval_conditions: None,
58            can_approve,
59            user_auth_required,
60            hide_cancel: None,
61            skin,
62            step_summary: None,
63            flow_summary: None,
64            approvers,
65            view_token: None,
66        }
67    }
68}
69/// how the approval page presents the request
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum Skin {
72    #[serde(rename = "detailed")]
73    Detailed,
74    #[serde(rename = "minimal")]
75    Minimal,
76}
77
78impl Default for Skin {
79    fn default() -> Skin {
80        Self::Detailed
81    }
82}
83