/*
 * 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 TenantConfig {
    /// JSON-serializable list of allowable grant types
    #[serde(
        rename = "allowable_grant_types",
        skip_serializing_if = "Option::is_none"
    )]
    pub allowable_grant_types: Option<Vec<String>>,
    /// whether to use the LDAP configured in the Tenants API for this tenant.
    #[serde(rename = "use_ldap", skip_serializing_if = "Option::is_none")]
    pub use_ldap: Option<bool>,
    /// whether to make the Authenticator token web app available
    #[serde(rename = "use_token_webapp", skip_serializing_if = "Option::is_none")]
    pub use_token_webapp: Option<bool>,
    /// JSON-serializable object which includes various details such as which MFA system to use (e.g., TACC MFA or another MFA) and configurations for it.
    #[serde(rename = "mfa_config", skip_serializing_if = "Option::is_none")]
    pub mfa_config: Option<serde_json::Value>,
    /// The access token TTL, in seconds, for standard grant types, such as authorization code.
    #[serde(
        rename = "default_access_token_ttl",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_access_token_ttl: Option<i32>,
    /// The refresh token TTL, in seconds, for standard grant types, such as authorization code.
    #[serde(
        rename = "default_refresh_token_ttl",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_refresh_token_ttl: Option<i32>,
    /// The maxiumum access token TTL, in seconds, for grant types that allow the caller to specify the TTL.
    #[serde(
        rename = "max_access_token_ttl",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_access_token_ttl: Option<i32>,
    /// The maxiumum refresh token TTL, in seconds, for grant types that allow the caller to specify the TTL.
    #[serde(
        rename = "max_refresh_token_ttl",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_refresh_token_ttl: Option<i32>,
    /// JSON-serializable object which includes various configuration details for tenants using an IdP that is not LDAP/AD.
    #[serde(
        rename = "custom_idp_configuration",
        skip_serializing_if = "Option::is_none"
    )]
    pub custom_idp_configuration: Option<serde_json::Value>,
    /// Token URL endpoint for generating v2 token
    #[serde(rename = "token_url", skip_serializing_if = "Option::is_none")]
    pub token_url: Option<String>,
    /// Client ID for impersonation
    #[serde(
        rename = "impers_oauth_client_id",
        skip_serializing_if = "Option::is_none"
    )]
    pub impers_oauth_client_id: Option<String>,
    /// Client secret for impersonation
    #[serde(
        rename = "impers_oauth_client_secret",
        skip_serializing_if = "Option::is_none"
    )]
    pub impers_oauth_client_secret: Option<String>,
    /// Impersonation username for impersonation
    #[serde(
        rename = "impersadmin_username",
        skip_serializing_if = "Option::is_none"
    )]
    pub impersadmin_username: Option<String>,
    /// Impersonation password for impersonation
    #[serde(
        rename = "impersadmin_password",
        skip_serializing_if = "Option::is_none"
    )]
    pub impersadmin_password: Option<String>,
}

impl TenantConfig {
    pub fn new() -> TenantConfig {
        TenantConfig {
            allowable_grant_types: None,
            use_ldap: None,
            use_token_webapp: None,
            mfa_config: None,
            default_access_token_ttl: None,
            default_refresh_token_ttl: None,
            max_access_token_ttl: None,
            max_refresh_token_ttl: None,
            custom_idp_configuration: None,
            token_url: None,
            impers_oauth_client_id: None,
            impers_oauth_client_secret: None,
            impersadmin_username: None,
            impersadmin_password: None,
        }
    }
}
