windmill_api/models/
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.500.2
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 Resource {
16    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
17    pub workspace_id: Option<String>,
18    #[serde(rename = "path")]
19    pub path: String,
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    #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub value: Option<Option<serde_json::Value>>,
26    #[serde(rename = "is_oauth")]
27    pub is_oauth: bool,
28    #[serde(rename = "extra_perms", skip_serializing_if = "Option::is_none")]
29    pub extra_perms: Option<std::collections::HashMap<String, bool>>,
30    #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
31    pub created_by: Option<String>,
32    #[serde(rename = "edited_at", skip_serializing_if = "Option::is_none")]
33    pub edited_at: Option<String>,
34}
35
36impl Resource {
37    pub fn new(path: String, resource_type: String, is_oauth: bool) -> Resource {
38        Resource {
39            workspace_id: None,
40            path,
41            description: None,
42            resource_type,
43            value: None,
44            is_oauth,
45            extra_perms: None,
46            created_by: None,
47            edited_at: None,
48        }
49    }
50}
51