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