/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetApprovalInfo200Response {
    #[serde(rename = "flow_id")]
    pub flow_id: uuid::Uuid,
    /// 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>>,
    /// description of the approval step
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<serde_json::Value>>,
    #[serde(rename = "approval_conditions", skip_serializing_if = "Option::is_none")]
    pub approval_conditions: Option<Box<models::GetApprovalInfo200ResponseApprovalConditions>>,
    /// whether the current user/token holder can approve
    #[serde(rename = "can_approve")]
    pub can_approve: bool,
    /// whether user authentication is required to approve
    #[serde(rename = "user_auth_required")]
    pub user_auth_required: bool,
    /// whether to hide the cancel button in the UI
    #[serde(rename = "hide_cancel", skip_serializing_if = "Option::is_none")]
    pub hide_cancel: Option<bool>,
    #[serde(rename = "approvers")]
    pub approvers: Vec<models::GetApprovalInfo200ResponseApproversInner>,
}

impl GetApprovalInfo200Response {
    pub fn new(flow_id: uuid::Uuid, can_approve: bool, user_auth_required: bool, approvers: Vec<models::GetApprovalInfo200ResponseApproversInner>) -> GetApprovalInfo200Response {
        GetApprovalInfo200Response {
            flow_id,
            form_schema: None,
            description: None,
            approval_conditions: None,
            can_approve,
            user_auth_required,
            hide_cancel: None,
            approvers,
        }
    }
}

