/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

/// FlowModuleSuspend : Configuration for approval/resume steps that wait for user input
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowModuleSuspend {
    /// Number of approvals required before continuing
    #[serde(rename = "required_events", skip_serializing_if = "Option::is_none")]
    pub required_events: Option<i32>,
    /// Timeout in seconds before auto-continuing or canceling
    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
    pub timeout: Option<i32>,
    #[serde(rename = "resume_form", skip_serializing_if = "Option::is_none")]
    pub resume_form: Option<Box<models::FlowModuleSuspendResumeForm>>,
    /// If true, only authenticated users can approve
    #[serde(rename = "user_auth_required", skip_serializing_if = "Option::is_none")]
    pub user_auth_required: Option<bool>,
    #[serde(rename = "user_groups_required", skip_serializing_if = "Option::is_none")]
    pub user_groups_required: Option<Box<models::InputTransform>>,
    /// If true, the user who started the flow cannot approve
    #[serde(rename = "self_approval_disabled", skip_serializing_if = "Option::is_none")]
    pub self_approval_disabled: Option<bool>,
    /// If true, hide the cancel button on the approval form
    #[serde(rename = "hide_cancel", skip_serializing_if = "Option::is_none")]
    pub hide_cancel: Option<bool>,
    /// If true, continue flow on timeout instead of canceling
    #[serde(rename = "continue_on_disapprove_timeout", skip_serializing_if = "Option::is_none")]
    pub continue_on_disapprove_timeout: Option<bool>,
}

impl FlowModuleSuspend {
    /// Configuration for approval/resume steps that wait for user input
    pub fn new() -> FlowModuleSuspend {
        FlowModuleSuspend {
            required_events: None,
            timeout: None,
            resume_form: None,
            user_auth_required: None,
            user_groups_required: None,
            self_approval_disabled: None,
            hide_cancel: None,
            continue_on_disapprove_timeout: None,
        }
    }
}

