/*
 * Authenticator
 *
 * REST API and web server providing authentication for a Tapis v3 instance.
 *
 * The version of the OpenAPI document: 1
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewToken {
    /// The username being authenticated (for password grant).
    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
    /// The password assoicated with the username being authenticated (for password grant).
    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,
    /// The client_id being authenticated (for device_code grant).
    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
    pub client_id: Option<String>,
    /// The client_key being authenticated (optional for authorization_code grant).
    #[serde(rename = "client_key", skip_serializing_if = "Option::is_none")]
    pub client_key: Option<String>,
    /// The OAuth2 grant type being used; either password, authorization_code or refresh_token.
    #[serde(rename = "grant_type", skip_serializing_if = "Option::is_none")]
    pub grant_type: Option<String>,
    /// The client's redirect URI (for authorization_code grant).
    #[serde(rename = "redirect_uri", skip_serializing_if = "Option::is_none")]
    pub redirect_uri: Option<String>,
    /// The authorization code associated with the request (for authorization_code grant).
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// The device code associated with the request (for device_code grant)
    #[serde(rename = "device_code", skip_serializing_if = "Option::is_none")]
    pub device_code: Option<String>,
    /// The refresh token associated with the request (for refresh_token grant).
    #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")]
    pub refresh_token: Option<String>,
}

impl NewToken {
    pub fn new() -> NewToken {
        NewToken {
            username: None,
            password: None,
            client_id: None,
            client_key: None,
            grant_type: None,
            redirect_uri: None,
            code: None,
            device_code: None,
            refresh_token: None,
        }
    }
}
