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.539.1
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}
27
28impl TokenResponse {
29    pub fn new(access_token: String) -> TokenResponse {
30        TokenResponse {
31            access_token,
32            expires_in: None,
33            refresh_token: None,
34            scope: None,
35            grant_type: None,
36        }
37    }
38}
39