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.866.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    /// Whether the integration trigger connect flow made it. Any other connection is a resource connected from Resources, which triggers can use but only Resources can replace or delete.
27    #[serde(rename = "managed")]
28    pub managed: bool,
29    /// Scopes the account was connected with; absent when unknown
30    #[serde(rename = "scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub scopes: Option<Option<Vec<String>>>,
32    /// Scopes the service's triggers need that the account lacks; absent when unknown
33    #[serde(rename = "missing_scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub missing_scopes: Option<Option<Vec<String>>>,
35}
36
37impl NativeTriggerConnection {
38    /// An account connected for native triggers, stored as an OAuth resource
39    pub fn new(path: String, workspace: bool, managed: bool) -> NativeTriggerConnection {
40        NativeTriggerConnection {
41            path,
42            owner: None,
43            workspace,
44            managed,
45            scopes: None,
46            missing_scopes: None,
47        }
48    }
49}
50