1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.730.0
* Contact: contact@windmill.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateAccountRequest {
/// 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.
#[serde(rename = "refresh_token")]
pub refresh_token: String,
#[serde(rename = "expires_in")]
pub expires_in: i32,
#[serde(rename = "client")]
pub client: String,
#[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
pub grant_type: Option<String>,
/// OAuth client ID for resource-level credentials (client_credentials flow only)
#[serde(rename = "cc_client_id", skip_serializing_if = "Option::is_none")]
pub cc_client_id: Option<String>,
/// OAuth client secret for resource-level credentials (client_credentials flow only)
#[serde(rename = "cc_client_secret", skip_serializing_if = "Option::is_none")]
pub cc_client_secret: Option<String>,
/// 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.
#[serde(rename = "cc_instance", skip_serializing_if = "Option::is_none")]
pub cc_instance: Option<String>,
/// MCP server URL for MCP OAuth token refresh
#[serde(rename = "mcp_server_url", skip_serializing_if = "Option::is_none")]
pub mcp_server_url: Option<String>,
/// OAuth scopes to use for token refresh. Overrides instance-level scopes.
#[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
}
impl CreateAccountRequest {
pub fn new(refresh_token: String, expires_in: i32, client: String) -> CreateAccountRequest {
CreateAccountRequest {
refresh_token,
expires_in,
client,
grant_type: None,
cc_client_id: None,
cc_client_secret: None,
cc_instance: None,
mcp_server_url: None,
scopes: None,
}
}
}