windmill_api/models/
listable_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 ListableResource {
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 = "is_expired", skip_serializing_if = "Option::is_none")]
31    pub is_expired: Option<bool>,
32    #[serde(rename = "refresh_error", skip_serializing_if = "Option::is_none")]
33    pub refresh_error: Option<String>,
34    #[serde(rename = "is_linked")]
35    pub is_linked: bool,
36    #[serde(rename = "is_refreshed")]
37    pub is_refreshed: bool,
38    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
39    pub account: Option<f64>,
40    #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
41    pub created_by: Option<String>,
42    #[serde(rename = "edited_at", skip_serializing_if = "Option::is_none")]
43    pub edited_at: Option<String>,
44}
45
46impl ListableResource {
47    pub fn new(path: String, resource_type: String, is_oauth: bool, is_linked: bool, is_refreshed: bool) -> ListableResource {
48        ListableResource {
49            workspace_id: None,
50            path,
51            description: None,
52            resource_type,
53            value: None,
54            is_oauth,
55            extra_perms: None,
56            is_expired: None,
57            refresh_error: None,
58            is_linked,
59            is_refreshed,
60            account: None,
61            created_by: None,
62            edited_at: None,
63        }
64    }
65}
66