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;

/// SqlInstancesVerifyExternalSyncSettingsRequest : Instance verify external sync settings request.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
    #[serde(rename = "mysqlSyncConfig", skip_serializing_if = "Option::is_none")]
    pub mysql_sync_config: Option<Box<models::MySqlSyncConfig>>,
    /// External sync mode
    #[serde(rename = "syncMode", skip_serializing_if = "Option::is_none")]
    pub sync_mode: Option<SyncMode>,
    /// Flag to enable verifying connection only
    #[serde(
        rename = "verifyConnectionOnly",
        skip_serializing_if = "Option::is_none"
    )]
    pub verify_connection_only: Option<bool>,
    /// Optional. Flag to verify settings required by replication setup only
    #[serde(
        rename = "verifyReplicationOnly",
        skip_serializing_if = "Option::is_none"
    )]
    pub verify_replication_only: Option<bool>,
}

impl SqlInstancesVerifyExternalSyncSettingsRequest {
    /// Instance verify external sync settings request.
    pub fn new() -> SqlInstancesVerifyExternalSyncSettingsRequest {
        SqlInstancesVerifyExternalSyncSettingsRequest {
            mysql_sync_config: None,
            sync_mode: None,
            verify_connection_only: None,
            verify_replication_only: None,
        }
    }
}
/// External sync mode
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SyncMode {
    #[serde(rename = "EXTERNAL_SYNC_MODE_UNSPECIFIED")]
    ExternalSyncModeUnspecified,
    #[serde(rename = "ONLINE")]
    Online,
    #[serde(rename = "OFFLINE")]
    Offline,
}

impl Default for SyncMode {
    fn default() -> SyncMode {
        Self::ExternalSyncModeUnspecified
    }
}
