Skip to main content

tapis_authenticator/models/
token_response.rs

1/*
2 * Authenticator
3 *
4 * REST API and web server providing authentication for a Tapis v3 instance.
5 *
6 * The version of the OpenAPI document: 1
7 * Contact: cicsupport@tacc.utexas.edu
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: Box<models::TokenResponseAccessToken>,
18    #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")]
19    pub refresh_token: Option<Box<models::TokenResponseRefreshToken>>,
20}
21
22impl TokenResponse {
23    pub fn new(access_token: models::TokenResponseAccessToken) -> TokenResponse {
24        TokenResponse {
25            access_token: Box::new(access_token),
26            refresh_token: None,
27        }
28    }
29}