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

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

/// OpenFlow : Top-level flow definition containing metadata, configuration, and the flow structure
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OpenFlow {
    /// Short description of what this flow does
    #[serde(rename = "summary")]
    pub summary: String,
    /// Detailed documentation for this flow
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "value")]
    pub value: Box<models::FlowValue>,
    /// JSON Schema for flow inputs. Use this to define input parameters, their types, defaults, and validation. For resource inputs, set type to 'object' and format to 'resource-<type>' (e.g., 'resource-stripe')
    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
    pub schema: Option<serde_json::Value>,
    /// The flow will be run with the permissions of the user with this email.
    #[serde(rename = "on_behalf_of_email", skip_serializing_if = "Option::is_none")]
    pub on_behalf_of_email: Option<String>,
}

impl OpenFlow {
    /// Top-level flow definition containing metadata, configuration, and the flow structure
    pub fn new(summary: String, value: models::FlowValue) -> OpenFlow {
        OpenFlow {
            summary,
            description: None,
            value: Box::new(value),
            schema: None,
            on_behalf_of_email: None,
        }
    }
}

