alpaca-authx-client-rs 0.1.0

Unofficial, use at own risk. Generated from alpacas open api specs using openapi cli
Documentation
/*
 * Authentication API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TokenResponse {
    /// Access token
    #[serde(rename = "access_token")]
    pub access_token: String,
    /// Time in seconds until the token expires
    #[serde(rename = "expires_in")]
    pub expires_in: i32,
    /// Type of the token (e.g., Bearer)
    #[serde(rename = "token_type")]
    pub token_type: TokenType,
}

impl TokenResponse {
    pub fn new(access_token: String, expires_in: i32, token_type: TokenType) -> TokenResponse {
        TokenResponse {
            access_token,
            expires_in,
            token_type,
        }
    }
}
/// Type of the token (e.g., Bearer)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TokenType {
    #[serde(rename = "Bearer")]
    Bearer,
}

impl Default for TokenType {
    fn default() -> TokenType {
        Self::Bearer
    }
}