/*
 * 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 ExecuteComponentRequest {
    #[serde(rename = "component")]
    pub component: String,
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
    pub version: Option<i32>,
    #[serde(rename = "args", deserialize_with = "Option::deserialize")]
    pub args: Option<serde_json::Value>,
    #[serde(rename = "raw_code", skip_serializing_if = "Option::is_none")]
    pub raw_code: Option<Box<models::ExecuteComponentRequestRawCode>>,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    #[serde(rename = "force_viewer_static_fields", skip_serializing_if = "Option::is_none")]
    pub force_viewer_static_fields: Option<serde_json::Value>,
    #[serde(rename = "force_viewer_one_of_fields", skip_serializing_if = "Option::is_none")]
    pub force_viewer_one_of_fields: Option<serde_json::Value>,
    #[serde(rename = "force_viewer_allow_user_resources", skip_serializing_if = "Option::is_none")]
    pub force_viewer_allow_user_resources: Option<Vec<String>>,
    #[serde(rename = "force_viewer_sensitive_inputs", skip_serializing_if = "Option::is_none")]
    pub force_viewer_sensitive_inputs: Option<Vec<String>>,
    #[serde(rename = "force_viewer_delete_after_secs", skip_serializing_if = "Option::is_none")]
    pub force_viewer_delete_after_secs: Option<i32>,
    /// Runnable query parameters
    #[serde(rename = "run_query_params", skip_serializing_if = "Option::is_none")]
    pub run_query_params: Option<serde_json::Value>,
}

impl ExecuteComponentRequest {
    pub fn new(component: String, args: Option<serde_json::Value>) -> ExecuteComponentRequest {
        ExecuteComponentRequest {
            component,
            path: None,
            version: None,
            args,
            raw_code: None,
            id: None,
            force_viewer_static_fields: None,
            force_viewer_one_of_fields: None,
            force_viewer_allow_user_resources: None,
            force_viewer_sensitive_inputs: None,
            force_viewer_delete_after_secs: None,
            run_query_params: None,
        }
    }
}

