Skip to main content

windmill_api/models/
token_response.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.848.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 TokenResponse {
16    #[serde(rename = "access_token")]
17    pub access_token: String,
18    #[serde(rename = "expires_in", skip_serializing_if = "Option::is_none")]
19    pub expires_in: Option<i32>,
20    #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")]
21    pub refresh_token: Option<String>,
22    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
23    pub scope: Option<Vec<String>>,
24    #[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
25    pub grant_type: Option<String>,
26    /// Resource fields the provider's `connect_fields` picked on connect (Salesforce's instance_url, Docusign's account_id and base_uri, QuickBooks' realmId), for the connect dialog to prefill. 
27    #[serde(rename = "resource_fields", skip_serializing_if = "Option::is_none")]
28    pub resource_fields: Option<std::collections::HashMap<String, serde_json::Value>>,
29}
30
31impl TokenResponse {
32    pub fn new(access_token: String) -> TokenResponse {
33        TokenResponse {
34            access_token,
35            expires_in: None,
36            refresh_token: None,
37            scope: None,
38            grant_type: None,
39            resource_fields: None,
40        }
41    }
42}
43