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.505.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    #[serde(rename = "path")]
17    pub path: String,
18    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
19    pub value: Option<serde_json::Value>,
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    #[serde(rename = "resource_type")]
23    pub resource_type: String,
24}
25
26impl CreateResource {
27    pub fn new(path: String, value: Option<serde_json::Value>, resource_type: String) -> CreateResource {
28        CreateResource {
29            path,
30            value,
31            description: None,
32            resource_type,
33        }
34    }
35}
36