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
                                      */

use crate::google_rest_apis::sqladmin_v1::models;

/// LocationPreference : Preferred location. This specifies where a Cloud SQL instance is located. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LocationPreference {
    /// The App Engine application to follow, it must be in the same region as the Cloud SQL instance. WARNING: Changing this might restart the instance.
    #[serde(
        rename = "followGaeApplication",
        skip_serializing_if = "Option::is_none"
    )]
    pub follow_gae_application: Option<String>,
    /// This is always `sql#locationPreference`.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The preferred Compute Engine zone for the secondary/failover (for example: us-central1-a, us-central1-b, etc.).
    #[serde(rename = "secondaryZone", skip_serializing_if = "Option::is_none")]
    pub secondary_zone: Option<String>,
    /// The preferred Compute Engine zone (for example: us-central1-a, us-central1-b, etc.). WARNING: Changing this might restart the instance.
    #[serde(rename = "zone", skip_serializing_if = "Option::is_none")]
    pub zone: Option<String>,
}

impl LocationPreference {
    /// Preferred location. This specifies where a Cloud SQL instance is located. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified.
    pub fn new() -> LocationPreference {
        LocationPreference {
            follow_gae_application: None,
            kind: None,
            secondary_zone: None,
            zone: None,
        }
    }
}
