Skip to main content

windmill_api/models/
execute_component_request.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.841.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ExecuteComponentRequest {
16    #[serde(rename = "component")]
17    pub component: String,
18    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
19    pub path: Option<String>,
20    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
21    pub version: Option<i32>,
22    #[serde(rename = "args", deserialize_with = "Option::deserialize")]
23    pub args: Option<serde_json::Value>,
24    #[serde(rename = "raw_code", skip_serializing_if = "Option::is_none")]
25    pub raw_code: Option<Box<models::ExecuteComponentRequestRawCode>>,
26    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
27    pub id: Option<i32>,
28    #[serde(rename = "force_viewer_static_fields", skip_serializing_if = "Option::is_none")]
29    pub force_viewer_static_fields: Option<serde_json::Value>,
30    #[serde(rename = "force_viewer_one_of_fields", skip_serializing_if = "Option::is_none")]
31    pub force_viewer_one_of_fields: Option<serde_json::Value>,
32    #[serde(rename = "force_viewer_allow_user_resources", skip_serializing_if = "Option::is_none")]
33    pub force_viewer_allow_user_resources: Option<Vec<String>>,
34    #[serde(rename = "force_viewer_sensitive_inputs", skip_serializing_if = "Option::is_none")]
35    pub force_viewer_sensitive_inputs: Option<Vec<String>>,
36    #[serde(rename = "force_viewer_delete_after_secs", skip_serializing_if = "Option::is_none")]
37    pub force_viewer_delete_after_secs: Option<i32>,
38    /// Runnable query parameters
39    #[serde(rename = "run_query_params", skip_serializing_if = "Option::is_none")]
40    pub run_query_params: Option<serde_json::Value>,
41    /// 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.
42    #[serde(rename = "temp_script_refs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub temp_script_refs: Option<Option<std::collections::HashMap<String, String>>>,
44    /// 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.
45    #[serde(rename = "on_behalf_of", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub on_behalf_of: Option<Option<String>>,
47    /// Preview mode only: the inline runnable's viewer_data_access policy setting (run mode reads it from the deployed policy).
48    #[serde(rename = "viewer_data_access", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub viewer_data_access: Option<Option<bool>>,
50}
51
52impl ExecuteComponentRequest {
53    pub fn new(component: String, args: Option<serde_json::Value>) -> ExecuteComponentRequest {
54        ExecuteComponentRequest {
55            component,
56            path: None,
57            version: None,
58            args,
59            raw_code: None,
60            id: None,
61            force_viewer_static_fields: None,
62            force_viewer_one_of_fields: None,
63            force_viewer_allow_user_resources: None,
64            force_viewer_sensitive_inputs: None,
65            force_viewer_delete_after_secs: None,
66            run_query_params: None,
67            temp_script_refs: None,
68            on_behalf_of: None,
69            viewer_data_access: None,
70        }
71    }
72}
73