windmill-api 1.841.0

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.841.0
 * 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 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>,
    /// Map of relative-import script path -> temp storage hash. Only honored for inline-script (raw_code) execution so app dev resolves those imports from not-yet-deployed local content.
    #[serde(rename = "temp_script_refs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub temp_script_refs: Option<Option<std::collections::HashMap<String, String>>>,
    /// Preview mode (force_viewer_static_fields set) only: run as this identity (an email, `u/<username>` or `g/<group>`) instead of the caller. Naming anyone other than yourself requires being an admin or a member of wm_deployers.
    #[serde(rename = "on_behalf_of", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub on_behalf_of: Option<Option<String>>,
    /// Preview mode only: the inline runnable's viewer_data_access policy setting (run mode reads it from the deployed policy).
    #[serde(rename = "viewer_data_access", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub viewer_data_access: Option<Option<bool>>,
}

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,
            temp_script_refs: None,
            on_behalf_of: None,
            viewer_data_access: None,
        }
    }
}