use serde::{Deserialize, Serialize}; /*
                                      * Cloud SQL Admin API
                                      *
                                      * API for Cloud SQL database instance management
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

/// ConnectSettings : Connect settings retrieval response.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ConnectSettings {
    /// `SECOND_GEN`: Cloud SQL database instance. `EXTERNAL`: A database server that is not managed by Google. This property is read-only; use the `tier` property in the `settings` object to determine the database type.
    #[serde(rename = "backendType", skip_serializing_if = "Option::is_none")]
    pub backend_type: Option<BackendType>,
    /// The database engine type and version. The `databaseVersion` field cannot be changed after instance creation. MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default), or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`. SQL Server instances: `SQLSERVER_2017_STANDARD` (default), `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or `SQLSERVER_2019_WEB`.
    #[serde(rename = "databaseVersion", skip_serializing_if = "Option::is_none")]
    pub database_version: Option<DatabaseVersion>,
    /// The assigned IP addresses for the instance.
    #[serde(rename = "ipAddresses", skip_serializing_if = "Option::is_none")]
    pub ip_addresses: Option<Vec<crate::google_rest_apis::sqladmin_v1::models::IpMapping>>,
    /// This is always `sql#connectSettings`.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The cloud region for the instance. For example, `us-central1`, `europe-west1`. The region cannot be changed after instance creation.
    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
    pub region: Option<String>,
    #[serde(rename = "serverCaCert", skip_serializing_if = "Option::is_none")]
    pub server_ca_cert: Option<Box<crate::google_rest_apis::sqladmin_v1::models::SslCert>>,
}

impl ConnectSettings {
    /// Connect settings retrieval response.
    pub fn new() -> ConnectSettings {
        ConnectSettings {
            backend_type: None,
            database_version: None,
            ip_addresses: None,
            kind: None,
            region: None,
            server_ca_cert: None,
        }
    }
}

/// `SECOND_GEN`: Cloud SQL database instance. `EXTERNAL`: A database server that is not managed by Google. This property is read-only; use the `tier` property in the `settings` object to determine the database type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BackendType {
    #[serde(rename = "SQL_BACKEND_TYPE_UNSPECIFIED")]
    SqlBackendTypeUnspecified,
    #[serde(rename = "FIRST_GEN")]
    FirstGen,
    #[serde(rename = "SECOND_GEN")]
    SecondGen,
    #[serde(rename = "EXTERNAL")]
    External,
}

impl Default for BackendType {
    fn default() -> BackendType {
        Self::SqlBackendTypeUnspecified
    }
}
/// The database engine type and version. The `databaseVersion` field cannot be changed after instance creation. MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default), or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`. SQL Server instances: `SQLSERVER_2017_STANDARD` (default), `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or `SQLSERVER_2019_WEB`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DatabaseVersion {
    #[serde(rename = "SQL_DATABASE_VERSION_UNSPECIFIED")]
    SqlDatabaseVersionUnspecified,
    #[serde(rename = "MYSQL_5_1")]
    Mysql51,
    #[serde(rename = "MYSQL_5_5")]
    Mysql55,
    #[serde(rename = "MYSQL_5_6")]
    Mysql56,
    #[serde(rename = "MYSQL_5_7")]
    Mysql57,
    #[serde(rename = "SQLSERVER_2017_STANDARD")]
    Sqlserver2017Standard,
    #[serde(rename = "SQLSERVER_2017_ENTERPRISE")]
    Sqlserver2017Enterprise,
    #[serde(rename = "SQLSERVER_2017_EXPRESS")]
    Sqlserver2017Express,
    #[serde(rename = "SQLSERVER_2017_WEB")]
    Sqlserver2017Web,
    #[serde(rename = "POSTGRES_9_6")]
    Postgres96,
    #[serde(rename = "POSTGRES_10")]
    Postgres10,
    #[serde(rename = "POSTGRES_11")]
    Postgres11,
    #[serde(rename = "POSTGRES_12")]
    Postgres12,
    #[serde(rename = "POSTGRES_13")]
    Postgres13,
    #[serde(rename = "POSTGRES_14")]
    Postgres14,
    #[serde(rename = "MYSQL_8_0")]
    Mysql80,
    #[serde(rename = "MYSQL_8_0_18")]
    Mysql8018,
    #[serde(rename = "MYSQL_8_0_26")]
    Mysql8026,
    #[serde(rename = "MYSQL_8_0_27")]
    Mysql8027,
    #[serde(rename = "MYSQL_8_0_28")]
    Mysql8028,
    #[serde(rename = "MYSQL_8_0_29")]
    Mysql8029,
    #[serde(rename = "MYSQL_8_0_30")]
    Mysql8030,
    #[serde(rename = "MYSQL_8_0_31")]
    Mysql8031,
    #[serde(rename = "SQLSERVER_2019_STANDARD")]
    Sqlserver2019Standard,
    #[serde(rename = "SQLSERVER_2019_ENTERPRISE")]
    Sqlserver2019Enterprise,
    #[serde(rename = "SQLSERVER_2019_EXPRESS")]
    Sqlserver2019Express,
    #[serde(rename = "SQLSERVER_2019_WEB")]
    Sqlserver2019Web,
}

impl Default for DatabaseVersion {
    fn default() -> DatabaseVersion {
        Self::SqlDatabaseVersionUnspecified
    }
}
