windmill-api 1.881.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.881.1
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetApprovalStepDetail200Response {
    #[serde(rename = "flow_id")]
    pub flow_id: uuid::Uuid,
    #[serde(rename = "step_id")]
    pub step_id: String,
    /// not_reached: the step's own script has not finished yet. failed: the step failed before asking for approval. waiting: the run is suspended on this step. resumed: the run moved past this step. not_resumed: the run ended while waiting (denied, timed out or cancelled). 
    #[serde(rename = "status")]
    pub status: Status,
    /// the job of the approval step, once it ran
    #[serde(rename = "step_job", skip_serializing_if = "Option::is_none")]
    pub step_job: Option<uuid::Uuid>,
    #[serde(rename = "step_summary", skip_serializing_if = "Option::is_none")]
    pub step_summary: Option<String>,
    /// number of approvals required to resume
    #[serde(rename = "required_events")]
    pub required_events: i32,
    /// seconds the run waits for approvals
    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
    pub timeout: Option<i32>,
    /// when the wait times out, while waiting
    #[serde(rename = "suspended_until", skip_serializing_if = "Option::is_none")]
    pub suspended_until: Option<String>,
    /// form schema for the approval step
    #[serde(rename = "form_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub form_schema: Option<Option<serde_json::Value>>,
    #[serde(rename = "hide_cancel")]
    pub hide_cancel: bool,
    #[serde(rename = "continue_on_disapprove_timeout")]
    pub continue_on_disapprove_timeout: bool,
    #[serde(rename = "skin")]
    pub skin: Skin,
    #[serde(rename = "approval_conditions", skip_serializing_if = "Option::is_none")]
    pub approval_conditions: Option<Box<models::GetApprovalStepDetail200ResponseApprovalConditions>>,
    /// whether the caller can approve, set only while waiting
    #[serde(rename = "can_approve", skip_serializing_if = "Option::is_none")]
    pub can_approve: Option<bool>,
    /// description returned by the approval step's script
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<serde_json::Value>>,
    /// default form values returned by the approval step's script
    #[serde(rename = "default_args", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub default_args: Option<Option<serde_json::Value>>,
    /// form enums returned by the approval step's script
    #[serde(rename = "enums", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub enums: Option<Option<serde_json::Value>>,
    /// approvals received. approved, value and created_at are known only while the run is live; a finished run keeps approver names alone. 
    #[serde(rename = "approvals")]
    pub approvals: Vec<models::GetApprovalStepDetail200ResponseApprovalsInner>,
    /// the run's error, when status is not_resumed
    #[serde(rename = "error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error: Option<Option<serde_json::Value>>,
}

impl GetApprovalStepDetail200Response {
    pub fn new(flow_id: uuid::Uuid, step_id: String, status: Status, required_events: i32, hide_cancel: bool, continue_on_disapprove_timeout: bool, skin: Skin, approvals: Vec<models::GetApprovalStepDetail200ResponseApprovalsInner>) -> GetApprovalStepDetail200Response {
        GetApprovalStepDetail200Response {
            flow_id,
            step_id,
            status,
            step_job: None,
            step_summary: None,
            required_events,
            timeout: None,
            suspended_until: None,
            form_schema: None,
            hide_cancel,
            continue_on_disapprove_timeout,
            skin,
            approval_conditions: None,
            can_approve: None,
            description: None,
            default_args: None,
            enums: None,
            approvals,
            error: None,
        }
    }
}
/// not_reached: the step's own script has not finished yet. failed: the step failed before asking for approval. waiting: the run is suspended on this step. resumed: the run moved past this step. not_resumed: the run ended while waiting (denied, timed out or cancelled). 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "not_reached")]
    NotReached,
    #[serde(rename = "skipped")]
    Skipped,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "waiting")]
    Waiting,
    #[serde(rename = "resumed")]
    Resumed,
    #[serde(rename = "not_resumed")]
    NotResumed,
}

impl Default for Status {
    fn default() -> Status {
        Self::NotReached
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Skin {
    #[serde(rename = "detailed")]
    Detailed,
    #[serde(rename = "minimal")]
    Minimal,
}

impl Default for Skin {
    fn default() -> Skin {
        Self::Detailed
    }
}