Skip to main content

windmill_api/models/
create_account_request.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateAccountRequest {
16    /// OAuth refresh token. For authorization_code flow, this contains the actual refresh token. For client_credentials flow, this must be set to an empty string.
17    #[serde(rename = "refresh_token")]
18    pub refresh_token: String,
19    #[serde(rename = "expires_in")]
20    pub expires_in: i32,
21    #[serde(rename = "client")]
22    pub client: String,
23    #[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
24    pub grant_type: Option<String>,
25    /// OAuth client ID for resource-level credentials (client_credentials flow only)
26    #[serde(rename = "cc_client_id", skip_serializing_if = "Option::is_none")]
27    pub cc_client_id: Option<String>,
28    /// OAuth client secret for resource-level credentials (client_credentials flow only)
29    #[serde(rename = "cc_client_secret", skip_serializing_if = "Option::is_none")]
30    pub cc_client_secret: Option<String>,
31    /// Instance name for built-in providers whose client-credentials token URL is instance-templated; substituted into the fixed-host registry template server-side (client_credentials flow only). The token URL is never caller-supplied.
32    #[serde(rename = "cc_instance", skip_serializing_if = "Option::is_none")]
33    pub cc_instance: Option<String>,
34    /// Bring-your-own token endpoint override (client_credentials flow only). Only honored together with cc_client_id/cc_client_secret and mutually exclusive with cc_instance; ignored/rejected on the shared-instance path.
35    #[serde(rename = "cc_token_url", skip_serializing_if = "Option::is_none")]
36    pub cc_token_url: Option<String>,
37    /// MCP server URL for MCP OAuth token refresh
38    #[serde(rename = "mcp_server_url", skip_serializing_if = "Option::is_none")]
39    pub mcp_server_url: Option<String>,
40    /// OAuth scopes to use for token refresh. Overrides instance-level scopes.
41    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
42    pub scopes: Option<Vec<String>>,
43    #[serde(rename = "variable", skip_serializing_if = "Option::is_none")]
44    pub variable: Option<Box<models::CreateVariable>>,
45    /// Issued by the workspace's own OAuth app, with `client` naming its service (google, github, nextcloud).
46    #[serde(rename = "is_workspace_integration", skip_serializing_if = "Option::is_none")]
47    pub is_workspace_integration: Option<bool>,
48    /// Reconnect: swap the token and account of the existing variable at variable.path in place, keeping its sharing and description.
49    #[serde(rename = "replace", skip_serializing_if = "Option::is_none")]
50    pub replace: Option<bool>,
51}
52
53impl CreateAccountRequest {
54    pub fn new(refresh_token: String, expires_in: i32, client: String) -> CreateAccountRequest {
55        CreateAccountRequest {
56            refresh_token,
57            expires_in,
58            client,
59            grant_type: None,
60            cc_client_id: None,
61            cc_client_secret: None,
62            cc_instance: None,
63            cc_token_url: None,
64            mcp_server_url: None,
65            scopes: None,
66            variable: None,
67            is_workspace_integration: None,
68            replace: None,
69        }
70    }
71}
72