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.548.3
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    /// OAuth token URL override for resource-level authentication (client_credentials flow only)
32    #[serde(rename = "cc_token_url", skip_serializing_if = "Option::is_none")]
33    pub cc_token_url: Option<String>,
34}
35
36impl CreateAccountRequest {
37    pub fn new(refresh_token: String, expires_in: i32, client: String) -> CreateAccountRequest {
38        CreateAccountRequest {
39            refresh_token,
40            expires_in,
41            client,
42            grant_type: None,
43            cc_client_id: None,
44            cc_client_secret: None,
45            cc_token_url: None,
46        }
47    }
48}
49