Skip to main content

windmill_api/models/
native_trigger_connection.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.896.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// NativeTriggerConnection : An account connected for native triggers, stored as an OAuth resource
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NativeTriggerConnection {
17    /// Path of the resource and variable holding the connection
18    #[serde(rename = "path")]
19    pub path: String,
20    /// Username of whoever connected the account, when the caller can read its resource
21    #[serde(rename = "owner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub owner: Option<Option<String>>,
23    /// Whether this is the workspace connection, which every member may use
24    #[serde(rename = "workspace")]
25    pub workspace: bool,
26    /// Scopes the account was connected with; absent when unknown
27    #[serde(rename = "scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub scopes: Option<Option<Vec<String>>>,
29    /// Scopes the service's triggers need that the account lacks; absent when unknown
30    #[serde(rename = "missing_scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub missing_scopes: Option<Option<Vec<String>>>,
32}
33
34impl NativeTriggerConnection {
35    /// An account connected for native triggers, stored as an OAuth resource
36    pub fn new(path: String, workspace: bool) -> NativeTriggerConnection {
37        NativeTriggerConnection {
38            path,
39            owner: None,
40            workspace,
41            scopes: None,
42            missing_scopes: None,
43        }
44    }
45}
46