Skip to main content

windmill_api/models/
create_resource.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.840.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 CreateResource {
16    /// The path to the resource
17    #[serde(rename = "path")]
18    pub path: String,
19    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
20    pub value: Option<serde_json::Value>,
21    /// The description of the resource
22    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
23    pub description: Option<String>,
24    /// The resource_type associated with the resource
25    #[serde(rename = "resource_type")]
26    pub resource_type: String,
27    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
28    pub labels: Option<Vec<String>>,
29    #[serde(rename = "ws_specific", skip_serializing_if = "Option::is_none")]
30    pub ws_specific: Option<bool>,
31    /// ai_agent only. Keep the identity `value.on_behalf_of` names (`u/<username>`, `g/<group>`) rather than the caller's own. Honoured for admins and members of wm_deployers; otherwise every write of an agent sets it to the caller.
32    #[serde(rename = "preserve_on_behalf_of", skip_serializing_if = "Option::is_none")]
33    pub preserve_on_behalf_of: Option<bool>,
34}
35
36impl CreateResource {
37    pub fn new(path: String, value: Option<serde_json::Value>, resource_type: String) -> CreateResource {
38        CreateResource {
39            path,
40            value,
41            description: None,
42            resource_type,
43            labels: None,
44            ws_specific: None,
45            preserve_on_behalf_of: None,
46        }
47    }
48}
49