Skip to main content

tapis_authenticator/models/
new_token.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 NewToken {
16    /// The username being authenticated (for password grant).
17    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
18    pub username: Option<String>,
19    /// The password assoicated with the username being authenticated (for password grant).
20    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
21    pub password: Option<String>,
22    /// The client_id being authenticated (for device_code grant).
23    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
24    pub client_id: Option<String>,
25    /// The client_key being authenticated (optional for authorization_code grant).
26    #[serde(rename = "client_key", skip_serializing_if = "Option::is_none")]
27    pub client_key: Option<String>,
28    /// The OAuth2 grant type being used; either password, authorization_code or refresh_token.
29    #[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
30    pub grant_type: Option<String>,
31    /// The client's redirect URI (for authorization_code grant).
32    #[serde(rename = "redirect_uri", skip_serializing_if = "Option::is_none")]
33    pub redirect_uri: Option<String>,
34    /// The authorization code associated with the request (for authorization_code grant).
35    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
36    pub code: Option<String>,
37    /// The device code associated with the request (for device_code grant)
38    #[serde(rename = "device_code", skip_serializing_if = "Option::is_none")]
39    pub device_code: Option<String>,
40    /// The refresh token associated with the request (for refresh_token grant).
41    #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")]
42    pub refresh_token: Option<String>,
43}
44
45impl NewToken {
46    pub fn new() -> NewToken {
47        NewToken {
48            username: None,
49            password: None,
50            client_id: None,
51            client_key: None,
52            grant_type: None,
53            redirect_uri: None,
54            code: None,
55            device_code: None,
56            refresh_token: None,
57        }
58    }
59}