/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VaultSettings {
    /// HashiCorp Vault server address (e.g., https://vault.company.com:8200)
    #[serde(rename = "address")]
    pub address: String,
    /// KV v2 secrets engine mount path (e.g., orvanta)
    #[serde(rename = "mount_path")]
    pub mount_path: String,
    /// Vault JWT auth role name for Orvanta (optional, if not provided token auth is used)
    #[serde(rename = "jwt_role", skip_serializing_if = "Option::is_none")]
    pub jwt_role: Option<String>,
    /// Vault Enterprise namespace (optional)
    #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    /// Static Vault token for testing/development (optional, if provided this is used instead of JWT authentication)
    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
    pub token: Option<String>,
    /// Skip TLS certificate verification when connecting to Vault. Only use for self-signed certificates in development environments.
    #[serde(rename = "skip_ssl_verify", skip_serializing_if = "Option::is_none")]
    pub skip_ssl_verify: Option<bool>,
}

impl VaultSettings {
    pub fn new(address: String, mount_path: String) -> VaultSettings {
        VaultSettings {
            address,
            mount_path,
            jwt_role: None,
            namespace: None,
            token: None,
            skip_ssl_verify: None,
        }
    }
}

