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.675.1
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}
30
31impl CreateResource {
32    pub fn new(path: String, value: Option<serde_json::Value>, resource_type: String) -> CreateResource {
33        CreateResource {
34            path,
35            value,
36            description: None,
37            resource_type,
38            labels: None,
39        }
40    }
41}
42