/*
 * Pescheck API
 *
 * Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
 *
 * The version of the OpenAPI document: 2.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// JwtResponse : Serializer for JWT token response
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JwtResponse {
    /// JWT access token
    #[serde(rename = "access_token")]
    pub access_token: String,
    /// JWT refresh token
    #[serde(rename = "refresh_token")]
    pub refresh_token: String,
    #[serde(rename = "token_type", skip_serializing_if = "Option::is_none")]
    pub token_type: Option<String>,
    /// Access token expiration in seconds
    #[serde(rename = "expires_in")]
    pub expires_in: i32,
    /// Organization name
    #[serde(rename = "organisation")]
    pub organisation: String,
    /// Organization ID
    #[serde(rename = "organisation_id")]
    pub organisation_id: uuid::Uuid,
}

impl JwtResponse {
    /// Serializer for JWT token response
    pub fn new(access_token: String, refresh_token: String, expires_in: i32, organisation: String, organisation_id: uuid::Uuid) -> JwtResponse {
        JwtResponse {
            access_token,
            refresh_token,
            token_type: None,
            expires_in,
            organisation,
            organisation_id,
        }
    }
}

