#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_rpc;
extern crate google_cloud_type;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlBackupRunsDeleteRequest {
pub id: i64,
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlBackupRunsDeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlBackupRunsDeleteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlBackupRunsGetRequest {
pub id: i64,
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlBackupRunsGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlBackupRunsGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlBackupRunsInsertRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::BackupRun>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlBackupRunsInsertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupRun>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupRun>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlBackupRunsInsertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlBackupRunsListRequest {
pub instance: std::string::String,
pub max_results: i32,
pub page_token: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlBackupRunsListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_results = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlBackupRunsListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupRun {
pub kind: std::string::String,
pub status: crate::model::SqlBackupRunStatus,
pub enqueued_time: std::option::Option<wkt::Timestamp>,
pub id: i64,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub error: std::option::Option<crate::model::OperationError>,
pub r#type: crate::model::SqlBackupRunType,
pub description: std::string::String,
pub window_start_time: std::option::Option<wkt::Timestamp>,
pub instance: std::string::String,
pub self_link: std::string::String,
pub location: std::string::String,
pub database_version: crate::model::SqlDatabaseVersion,
pub disk_encryption_configuration:
std::option::Option<crate::model::DiskEncryptionConfiguration>,
pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
pub backup_kind: crate::model::SqlBackupKind,
pub time_zone: std::string::String,
pub max_chargeable_bytes: std::option::Option<i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
mut self,
v: T,
) -> Self {
self.status = v.into();
self
}
pub fn set_enqueued_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.enqueued_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.enqueued_time = v.map(|x| x.into());
self
}
pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationError>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationError>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_window_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.window_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.window_start_time = v.map(|x| x.into());
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
mut self,
v: T,
) -> Self {
self.database_version = v.into();
self
}
pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
{
self.disk_encryption_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_encryption_configuration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
{
self.disk_encryption_configuration = v.map(|x| x.into());
self
}
pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionStatus>,
{
self.disk_encryption_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionStatus>,
{
self.disk_encryption_status = v.map(|x| x.into());
self
}
pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
mut self,
v: T,
) -> Self {
self.backup_kind = v.into();
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.max_chargeable_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.max_chargeable_bytes = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BackupRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BackupRun"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupRunsListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::BackupRun>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupRunsListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BackupRun>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for BackupRunsListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for BackupRunsListResponse {
type PageItem = crate::model::BackupRun;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.items
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupRequest {
pub parent: std::string::String,
pub backup: std::option::Option<crate::model::Backup>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBackupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListBackupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsResponse {
pub backups: std::vec::Vec<crate::model::Backup>,
pub next_page_token: std::string::String,
pub warnings: std::vec::Vec<crate::model::ApiWarning>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Backup>,
{
use std::iter::Iterator;
self.backups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ApiWarning>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListBackupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
type PageItem = crate::model::Backup;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.backups
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBackupRequest {
pub backup: std::option::Option<crate::model::Backup>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBackupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Backup {
pub name: std::string::String,
pub kind: std::string::String,
pub self_link: std::string::String,
pub r#type: crate::model::backup::SqlBackupType,
pub description: std::string::String,
pub instance: std::string::String,
pub location: std::string::String,
pub backup_interval: std::option::Option<google_cloud_type::model::Interval>,
pub state: crate::model::backup::SqlBackupState,
pub error: std::option::Option<crate::model::OperationError>,
pub kms_key: std::string::String,
pub kms_key_version: std::string::String,
pub backup_kind: crate::model::SqlBackupKind,
pub time_zone: std::string::String,
pub database_version: crate::model::SqlDatabaseVersion,
pub max_chargeable_bytes: std::option::Option<i64>,
pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
pub backup_run: std::string::String,
pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
pub expiration: std::option::Option<crate::model::backup::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Backup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_backup_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.backup_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.backup_interval = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationError>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationError>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_version = v.into();
self
}
pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
mut self,
v: T,
) -> Self {
self.backup_kind = v.into();
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
mut self,
v: T,
) -> Self {
self.database_version = v.into();
self
}
pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.max_chargeable_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.max_chargeable_bytes = v.map(|x| x.into());
self
}
pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.instance_deletion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.instance_deletion_time = v.map(|x| x.into());
self
}
pub fn set_instance_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.instance_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.instance_settings = v.map(|x| x.into());
self
}
pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_run = v.into();
self
}
pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzs = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzs = v.map(|x| x.into());
self
}
pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzi = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzi = v.map(|x| x.into());
self
}
pub fn set_expiration<
T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn ttl_days(&self) -> std::option::Option<&i64> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.expiration =
std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
self
}
pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration =
std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
self
}
}
impl wkt::message::Message for Backup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Backup"
}
}
pub mod backup {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlBackupType {
Unspecified,
Automated,
OnDemand,
Final,
UnknownValue(sql_backup_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_backup_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlBackupType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Automated => std::option::Option::Some(1),
Self::OnDemand => std::option::Option::Some(2),
Self::Final => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
Self::Automated => std::option::Option::Some("AUTOMATED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::Final => std::option::Option::Some("FINAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlBackupType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlBackupType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlBackupType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Automated,
2 => Self::OnDemand,
3 => Self::Final,
_ => Self::UnknownValue(sql_backup_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlBackupType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
"AUTOMATED" => Self::Automated,
"ON_DEMAND" => Self::OnDemand,
"FINAL" => Self::Final,
_ => Self::UnknownValue(sql_backup_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlBackupType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Automated => serializer.serialize_i32(1),
Self::OnDemand => serializer.serialize_i32(2),
Self::Final => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
".google.cloud.sql.v1.Backup.SqlBackupType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlBackupState {
Unspecified,
Enqueued,
Running,
Failed,
Successful,
Deleting,
DeletionFailed,
UnknownValue(sql_backup_state::UnknownValue),
}
#[doc(hidden)]
pub mod sql_backup_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlBackupState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enqueued => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Successful => std::option::Option::Some(4),
Self::Deleting => std::option::Option::Some(5),
Self::DeletionFailed => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
Self::Enqueued => std::option::Option::Some("ENQUEUED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Successful => std::option::Option::Some("SUCCESSFUL"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlBackupState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlBackupState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlBackupState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enqueued,
2 => Self::Running,
3 => Self::Failed,
4 => Self::Successful,
5 => Self::Deleting,
6 => Self::DeletionFailed,
_ => Self::UnknownValue(sql_backup_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlBackupState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
"ENQUEUED" => Self::Enqueued,
"RUNNING" => Self::Running,
"FAILED" => Self::Failed,
"SUCCESSFUL" => Self::Successful,
"DELETING" => Self::Deleting,
"DELETION_FAILED" => Self::DeletionFailed,
_ => Self::UnknownValue(sql_backup_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlBackupState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Enqueued => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Successful => serializer.serialize_i32(4),
Self::Deleting => serializer.serialize_i32(5),
Self::DeletionFailed => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
".google.cloud.sql.v1.Backup.SqlBackupState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
TtlDays(i64),
ExpiryTime(std::boxed::Box<wkt::Timestamp>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConnectSettingsRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub read_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConnectSettingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_read_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.read_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.read_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GetConnectSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectSettings {
pub kind: std::string::String,
pub server_ca_cert: std::option::Option<crate::model::SslCert>,
pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
pub region: std::string::String,
pub database_version: crate::model::SqlDatabaseVersion,
pub backend_type: crate::model::SqlBackendType,
pub psc_enabled: bool,
pub dns_name: std::string::String,
pub server_ca_mode: crate::model::connect_settings::CaMode,
pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
pub node_count: std::option::Option<i32>,
pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.server_ca_cert = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.server_ca_cert = v.map(|x| x.into());
self
}
pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IpMapping>,
{
use std::iter::Iterator;
self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
mut self,
v: T,
) -> Self {
self.database_version = v.into();
self
}
pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
mut self,
v: T,
) -> Self {
self.backend_type = v.into();
self
}
pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.psc_enabled = v.into();
self
}
pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dns_name = v.into();
self
}
pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
mut self,
v: T,
) -> Self {
self.server_ca_mode = v.into();
self
}
pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_dns_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsNameMapping>,
{
use std::iter::Iterator;
self.dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_node_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.node_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.node_count = v.map(|x| x.into());
self
}
pub fn set_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
{
use std::iter::Iterator;
self.nodes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
{
use std::iter::Iterator;
self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ConnectSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
}
}
pub mod connect_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectPoolNodeConfig {
pub name: std::option::Option<std::string::String>,
pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
pub dns_name: std::option::Option<std::string::String>,
pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectPoolNodeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IpMapping>,
{
use std::iter::Iterator;
self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = v.map(|x| x.into());
self
}
pub fn set_dns_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsNameMapping>,
{
use std::iter::Iterator;
self.dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ConnectPoolNodeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CaMode {
Unspecified,
GoogleManagedInternalCa,
GoogleManagedCasCa,
CustomerManagedCasCa,
UnknownValue(ca_mode::UnknownValue),
}
#[doc(hidden)]
pub mod ca_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CaMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GoogleManagedInternalCa => std::option::Option::Some(1),
Self::GoogleManagedCasCa => std::option::Option::Some(2),
Self::CustomerManagedCasCa => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
Self::GoogleManagedInternalCa => {
std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
}
Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CaMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CaMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CaMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GoogleManagedInternalCa,
2 => Self::GoogleManagedCasCa,
3 => Self::CustomerManagedCasCa,
_ => Self::UnknownValue(ca_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CaMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CA_MODE_UNSPECIFIED" => Self::Unspecified,
"GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
"GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
"CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
_ => Self::UnknownValue(ca_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CaMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
Self::GoogleManagedCasCa => serializer.serialize_i32(2),
Self::CustomerManagedCasCa => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CaMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
".google.cloud.sql.v1.ConnectSettings.CaMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MdxProtocolSupport {
Unspecified,
ClientProtocolType,
UnknownValue(mdx_protocol_support::UnknownValue),
}
#[doc(hidden)]
pub mod mdx_protocol_support {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MdxProtocolSupport {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ClientProtocolType => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MdxProtocolSupport {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MdxProtocolSupport {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MdxProtocolSupport {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ClientProtocolType,
_ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MdxProtocolSupport {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
"CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
_ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MdxProtocolSupport {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ClientProtocolType => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateEphemeralCertRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub public_key: std::string::String,
pub access_token: std::string::String,
pub read_time: std::option::Option<wkt::Timestamp>,
pub valid_duration: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateEphemeralCertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_key = v.into();
self
}
pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.access_token = v.into();
self
}
pub fn set_read_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.read_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.read_time = v.map(|x| x.into());
self
}
pub fn set_valid_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.valid_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.valid_duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GenerateEphemeralCertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateEphemeralCertResponse {
pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateEphemeralCertResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.ephemeral_cert = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.ephemeral_cert = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GenerateEphemeralCertResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlDatabasesDeleteRequest {
pub database: std::string::String,
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlDatabasesDeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlDatabasesDeleteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlDatabasesGetRequest {
pub database: std::string::String,
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlDatabasesGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlDatabasesGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlDatabasesInsertRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::Database>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlDatabasesInsertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlDatabasesInsertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlDatabasesListRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlDatabasesListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlDatabasesListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlDatabasesUpdateRequest {
pub database: std::string::String,
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::Database>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlDatabasesUpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlDatabasesUpdateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabasesListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::Database>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabasesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Database>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DatabasesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlFlagsListRequest {
pub database_version: std::string::String,
pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlFlagsListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.database_version = v.into();
self
}
pub fn set_flag_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlFlagScope>,
{
self.flag_scope = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlFlagScope>,
{
self.flag_scope = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlFlagsListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FlagsListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::Flag>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FlagsListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Flag>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FlagsListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Flag {
pub name: std::string::String,
pub r#type: crate::model::SqlFlagType,
pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
pub allowed_string_values: std::vec::Vec<std::string::String>,
pub min_value: std::option::Option<wkt::Int64Value>,
pub max_value: std::option::Option<wkt::Int64Value>,
pub requires_restart: std::option::Option<wkt::BoolValue>,
pub kind: std::string::String,
pub in_beta: std::option::Option<wkt::BoolValue>,
pub allowed_int_values: std::vec::Vec<i64>,
pub flag_scope: crate::model::SqlFlagScope,
pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Flag {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_applies_to<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SqlDatabaseVersion>,
{
use std::iter::Iterator;
self.applies_to = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_min_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.min_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.min_value = v.map(|x| x.into());
self
}
pub fn set_max_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.max_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.max_value = v.map(|x| x.into());
self
}
pub fn set_requires_restart<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.requires_restart = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.requires_restart = v.map(|x| x.into());
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_in_beta<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.in_beta = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.in_beta = v.map(|x| x.into());
self
}
pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
mut self,
v: T,
) -> Self {
self.flag_scope = v.into();
self
}
pub fn set_recommended_value<
T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
>(
mut self,
v: T,
) -> Self {
self.recommended_value = v.into();
self
}
pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.recommended_value.as_ref().and_then(|v| match v {
crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.recommended_value = std::option::Option::Some(
crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
);
self
}
pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
#[allow(unreachable_patterns)]
self.recommended_value.as_ref().and_then(|v| match v {
crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
mut self,
v: T,
) -> Self {
self.recommended_value = std::option::Option::Some(
crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
);
self
}
}
impl wkt::message::Message for Flag {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Flag"
}
}
pub mod flag {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RecommendedValue {
RecommendedStringValue(std::string::String),
RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesAddServerCaRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesAddServerCaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesAddServerCaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesAddServerCertificateRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesAddServerCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesAddEntraIdCertificateRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesAddEntraIdCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesCloneRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesCloneRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesCloneRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesCloneRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesCloneRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesCloneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesDeleteRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub enable_final_backup: std::option::Option<bool>,
pub final_backup_description: std::string::String,
pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesDeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_final_backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_final_backup = v.map(|x| x.into());
self
}
pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.final_backup_description = v.into();
self
}
pub fn set_expiration<
T: std::convert::Into<
std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.expiration = std::option::Option::Some(
crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
);
self
}
pub fn final_backup_expiry_time(
&self,
) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration = std::option::Option::Some(
crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
);
self
}
}
impl wkt::message::Message for SqlInstancesDeleteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
}
}
pub mod sql_instances_delete_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
FinalBackupTtlDays(i64),
FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesDemoteMasterRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesDemoteMasterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesDemoteRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesDemoteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesDemoteRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesDemoteRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesDemoteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesExportRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesExportRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesExportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesExportRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesExportRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesExportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesFailoverRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesFailoverRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesFailoverRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesFailoverRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesFailoverRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesGetRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesImportRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesImportRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesImportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesImportRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesImportRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesImportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesInsertRequest {
pub project: std::string::String,
pub body: std::option::Option<crate::model::DatabaseInstance>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesInsertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesInsertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesListRequest {
pub filter: std::string::String,
pub max_results: u32,
pub page_token: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
self.max_results = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesListServerCasRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesListServerCasRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesListServerCasRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesListServerCertificatesRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesListServerCertificatesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesListEntraIdCertificatesRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesListEntraIdCertificatesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesPatchRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::DatabaseInstance>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesPatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesPatchRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesPromoteReplicaRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub failover: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesPromoteReplicaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.failover = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesSwitchoverRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub db_timeout: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesSwitchoverRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_db_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.db_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.db_timeout = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesSwitchoverRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesResetSslConfigRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesResetSslConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_mode<
T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
}
}
pub mod sql_instances_reset_ssl_config_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResetSslMode {
Unspecified,
All,
SyncFromPrimary,
UnknownValue(reset_ssl_mode::UnknownValue),
}
#[doc(hidden)]
pub mod reset_ssl_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ResetSslMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::All => std::option::Option::Some(1),
Self::SyncFromPrimary => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
Self::All => std::option::Option::Some("ALL"),
Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ResetSslMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ResetSslMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ResetSslMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::All,
2 => Self::SyncFromPrimary,
_ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ResetSslMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
"ALL" => Self::All,
"SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
_ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ResetSslMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::All => serializer.serialize_i32(1),
Self::SyncFromPrimary => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRestartRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRestartRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesRestartRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRestoreBackupRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRestoreBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRotateServerCaRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRotateServerCaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRotateServerCertificateRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRotateServerCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRotateEntraIdCertificateRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRotateEntraIdCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesStartReplicaRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesStartReplicaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesStartReplicaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesStopReplicaRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesStopReplicaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesStopReplicaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesTruncateLogRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesTruncateLogRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesTruncateLogRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesPerformDiskShrinkRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesPerformDiskShrinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesUpdateRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::DatabaseInstance>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesUpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesUpdateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRescheduleMaintenanceRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRescheduleMaintenanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesReencryptRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesReencryptRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesReencryptRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesReencryptRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesReencryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesReencryptRequest {
pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesReencryptRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupReencryptionConfig>,
{
self.backup_reencryption_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupReencryptionConfig>,
{
self.backup_reencryption_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesReencryptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupReencryptionConfig {
pub backup_limit: std::option::Option<i32>,
pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupReencryptionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_limit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.backup_limit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.backup_limit = v.map(|x| x.into());
self
}
pub fn set_backup_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
{
self.backup_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
{
self.backup_type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BackupReencryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
}
}
pub mod backup_reencryption_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackupType {
Unspecified,
Automated,
OnDemand,
UnknownValue(backup_type::UnknownValue),
}
#[doc(hidden)]
pub mod backup_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackupType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Automated => std::option::Option::Some(1),
Self::OnDemand => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
Self::Automated => std::option::Option::Some("AUTOMATED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackupType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackupType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for BackupType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Automated,
2 => Self::OnDemand,
_ => Self::UnknownValue(backup_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackupType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
"AUTOMATED" => Self::Automated,
"ON_DEMAND" => Self::OnDemand,
_ => Self::UnknownValue(backup_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackupType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Automated => serializer.serialize_i32(1),
Self::OnDemand => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackupType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExternalSyncSelectedObject {
pub database: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExternalSyncSelectedObject {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
}
impl wkt::message::Message for ExternalSyncSelectedObject {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesGetDiskShrinkConfigRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesGetDiskShrinkConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub verify_connection_only: bool,
pub sync_mode:
crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
pub verify_replication_only: bool,
pub migration_type:
crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
pub sync_config: std::option::Option<
crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesVerifyExternalSyncSettingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verify_connection_only = v.into();
self
}
pub fn set_sync_mode<
T: std::convert::Into<
crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
>,
>(
mut self,
v: T,
) -> Self {
self.sync_mode = v.into();
self
}
pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verify_replication_only = v.into();
self
}
pub fn set_migration_type<
T: std::convert::Into<
crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
>,
>(
mut self,
v: T,
) -> Self {
self.migration_type = v.into();
self
}
pub fn set_sync_parallel_level<
T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
>(
mut self,
v: T,
) -> Self {
self.sync_parallel_level = v.into();
self
}
pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
{
use std::iter::Iterator;
self.selected_objects = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_sync_config<
T: std::convert::Into<
std::option::Option<
crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.sync_config = v.into();
self
}
pub fn mysql_sync_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
#[allow(unreachable_patterns)]
self.sync_config.as_ref().and_then(|v| match v {
crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_mysql_sync_config<
T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
>(
mut self,
v: T,
) -> Self {
self.sync_config = std::option::Option::Some(
crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
v.into()
)
);
self
}
}
impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
}
}
pub mod sql_instances_verify_external_sync_settings_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExternalSyncMode {
Unspecified,
Online,
Offline,
UnknownValue(external_sync_mode::UnknownValue),
}
#[doc(hidden)]
pub mod external_sync_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExternalSyncMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Online => std::option::Option::Some(1),
Self::Offline => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
Self::Online => std::option::Option::Some("ONLINE"),
Self::Offline => std::option::Option::Some("OFFLINE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExternalSyncMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExternalSyncMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExternalSyncMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Online,
2 => Self::Offline,
_ => Self::UnknownValue(external_sync_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExternalSyncMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
"ONLINE" => Self::Online,
"OFFLINE" => Self::Offline,
_ => Self::UnknownValue(external_sync_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExternalSyncMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Online => serializer.serialize_i32(1),
Self::Offline => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MigrationType {
Unspecified,
Logical,
Physical,
UnknownValue(migration_type::UnknownValue),
}
#[doc(hidden)]
pub mod migration_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MigrationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Logical => std::option::Option::Some(1),
Self::Physical => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
Self::Logical => std::option::Option::Some("LOGICAL"),
Self::Physical => std::option::Option::Some("PHYSICAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MigrationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MigrationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MigrationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Logical,
2 => Self::Physical,
_ => Self::UnknownValue(migration_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MigrationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"LOGICAL" => Self::Logical,
"PHYSICAL" => Self::Physical,
_ => Self::UnknownValue(migration_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MigrationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Logical => serializer.serialize_i32(1),
Self::Physical => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MigrationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SyncConfig {
MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesStartExternalSyncRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub sync_mode:
crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
pub skip_verification: bool,
pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
pub migration_type:
crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
pub replica_overwrite_enabled: bool,
pub sync_config:
std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesStartExternalSyncRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_sync_mode<
T: std::convert::Into<
crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
>,
>(
mut self,
v: T,
) -> Self {
self.sync_mode = v.into();
self
}
pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_verification = v.into();
self
}
pub fn set_sync_parallel_level<
T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
>(
mut self,
v: T,
) -> Self {
self.sync_parallel_level = v.into();
self
}
pub fn set_migration_type<
T: std::convert::Into<
crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
>,
>(
mut self,
v: T,
) -> Self {
self.migration_type = v.into();
self
}
pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.replica_overwrite_enabled = v.into();
self
}
pub fn set_sync_config<
T: std::convert::Into<
std::option::Option<
crate::model::sql_instances_start_external_sync_request::SyncConfig,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.sync_config = v.into();
self
}
pub fn mysql_sync_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
#[allow(unreachable_patterns)]
self.sync_config.as_ref().and_then(|v| match v {
crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_mysql_sync_config<
T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
>(
mut self,
v: T,
) -> Self {
self.sync_config = std::option::Option::Some(
crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
v.into(),
),
);
self
}
}
impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
}
}
pub mod sql_instances_start_external_sync_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SyncConfig {
MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesResetReplicaSizeRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesResetReplicaSizeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesCreateEphemeralCertRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesCreateEphemeralCertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesCloneRequest {
pub clone_context: std::option::Option<crate::model::CloneContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesCloneRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_clone_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloneContext>,
{
self.clone_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloneContext>,
{
self.clone_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesCloneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesDemoteMasterRequest {
pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesDemoteMasterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_demote_master_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DemoteMasterContext>,
{
self.demote_master_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DemoteMasterContext>,
{
self.demote_master_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesDemoteMasterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesDemoteRequest {
pub demote_context: std::option::Option<crate::model::DemoteContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesDemoteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_demote_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DemoteContext>,
{
self.demote_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DemoteContext>,
{
self.demote_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesDemoteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesExportRequest {
pub export_context: std::option::Option<crate::model::ExportContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesExportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_export_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExportContext>,
{
self.export_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExportContext>,
{
self.export_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesExportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesFailoverRequest {
pub failover_context: std::option::Option<crate::model::FailoverContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesFailoverRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_failover_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FailoverContext>,
{
self.failover_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FailoverContext>,
{
self.failover_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesFailoverRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslCertsCreateEphemeralRequest {
pub public_key: std::string::String,
pub access_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslCertsCreateEphemeralRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_key = v.into();
self
}
pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.access_token = v.into();
self
}
}
impl wkt::message::Message for SslCertsCreateEphemeralRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesImportRequest {
pub import_context: std::option::Option<crate::model::ImportContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesImportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_import_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImportContext>,
{
self.import_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImportContext>,
{
self.import_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesImportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesPreCheckMajorVersionUpgradeRequest {
pub pre_check_major_version_upgrade_context:
std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesPreCheckMajorVersionUpgradeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
{
self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
{
self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesListResponse {
pub kind: std::string::String,
pub warnings: std::vec::Vec<crate::model::ApiWarning>,
pub items: std::vec::Vec<crate::model::DatabaseInstance>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ApiWarning>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DatabaseInstance>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for InstancesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
type PageItem = crate::model::DatabaseInstance;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.items
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesListServerCasResponse {
pub certs: std::vec::Vec<crate::model::SslCert>,
pub active_version: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesListServerCasResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SslCert>,
{
use std::iter::Iterator;
self.certs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.active_version = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for InstancesListServerCasResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesListServerCertificatesResponse {
pub ca_certs: std::vec::Vec<crate::model::SslCert>,
pub server_certs: std::vec::Vec<crate::model::SslCert>,
pub active_version: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesListServerCertificatesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SslCert>,
{
use std::iter::Iterator;
self.ca_certs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_server_certs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SslCert>,
{
use std::iter::Iterator;
self.server_certs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.active_version = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for InstancesListServerCertificatesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesListEntraIdCertificatesResponse {
pub certs: std::vec::Vec<crate::model::SslCert>,
pub active_version: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesListEntraIdCertificatesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SslCert>,
{
use std::iter::Iterator;
self.certs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.active_version = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesRestoreBackupRequest {
pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
pub backup: std::string::String,
pub backupdr_backup: std::string::String,
pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesRestoreBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RestoreBackupContext>,
{
self.restore_backup_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RestoreBackupContext>,
{
self.restore_backup_context = v.map(|x| x.into());
self
}
pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup = v.into();
self
}
pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backupdr_backup = v.into();
self
}
pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.restore_instance_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseInstance>,
{
self.restore_instance_settings = v.map(|x| x.into());
self
}
pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.restore_instance_clear_overrides_field_names =
v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for InstancesRestoreBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesRotateServerCaRequest {
pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesRotateServerCaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RotateServerCaContext>,
{
self.rotate_server_ca_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RotateServerCaContext>,
{
self.rotate_server_ca_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesRotateServerCaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesRotateServerCertificateRequest {
pub rotate_server_certificate_context:
std::option::Option<crate::model::RotateServerCertificateContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesRotateServerCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RotateServerCertificateContext>,
{
self.rotate_server_certificate_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rotate_server_certificate_context<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::RotateServerCertificateContext>,
{
self.rotate_server_certificate_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesRotateServerCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesRotateEntraIdCertificateRequest {
pub rotate_entra_id_certificate_context:
std::option::Option<crate::model::RotateEntraIdCertificateContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesRotateEntraIdCertificateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
{
self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
{
self.rotate_entra_id_certificate_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesTruncateLogRequest {
pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesTruncateLogRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TruncateLogContext>,
{
self.truncate_log_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TruncateLogContext>,
{
self.truncate_log_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesTruncateLogRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstancesAcquireSsrsLeaseRequest {
pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstancesAcquireSsrsLeaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
{
self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
{
self.acquire_ssrs_lease_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
pub kind: std::string::String,
pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesVerifyExternalSyncSettingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
{
use std::iter::Iterator;
self.errors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesGetDiskShrinkConfigResponse {
pub kind: std::string::String,
pub minimal_target_size_gb: i64,
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesGetDiskShrinkConfigResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.minimal_target_size_gb = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesGetLatestRecoveryTimeRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesGetLatestRecoveryTimeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.source_instance_deletion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_instance_deletion_time<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.source_instance_deletion_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesGetLatestRecoveryTimeResponse {
pub kind: std::string::String,
pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesGetLatestRecoveryTimeResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_recovery_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_recovery_time = v.map(|x| x.into());
self
}
pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.earliest_recovery_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.earliest_recovery_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloneContext {
pub kind: std::string::String,
pub pitr_timestamp_ms: i64,
pub destination_instance_name: std::string::String,
pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
pub point_in_time: std::option::Option<wkt::Timestamp>,
pub allocated_ip_range: std::string::String,
pub database_names: std::vec::Vec<std::string::String>,
pub preferred_zone: std::option::Option<std::string::String>,
pub preferred_secondary_zone: std::option::Option<std::string::String>,
pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
pub destination_project: std::option::Option<std::string::String>,
pub destination_network: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloneContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.pitr_timestamp_ms = v.into();
self
}
pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_instance_name = v.into();
self
}
pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BinLogCoordinates>,
{
self.bin_log_coordinates = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BinLogCoordinates>,
{
self.bin_log_coordinates = v.map(|x| x.into());
self
}
pub fn set_point_in_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.point_in_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.point_in_time = v.map(|x| x.into());
self
}
pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.allocated_ip_range = v.into();
self
}
pub fn set_database_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.database_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_preferred_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_zone = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_zone = v.map(|x| x.into());
self
}
pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_secondary_zone = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_secondary_zone = v.map(|x| x.into());
self
}
pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.source_instance_deletion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_instance_deletion_time<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.source_instance_deletion_time = v.map(|x| x.into());
self
}
pub fn set_destination_project<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.destination_project = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.destination_project = v.map(|x| x.into());
self
}
pub fn set_destination_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.destination_network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.destination_network = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CloneContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.CloneContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PointInTimeRestoreContext {
pub datasource: std::option::Option<std::string::String>,
pub point_in_time: std::option::Option<wkt::Timestamp>,
pub target_instance: std::option::Option<std::string::String>,
pub private_network: std::option::Option<std::string::String>,
pub allocated_ip_range: std::option::Option<std::string::String>,
pub preferred_zone: std::option::Option<std::string::String>,
pub preferred_secondary_zone: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PointInTimeRestoreContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_datasource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.datasource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.datasource = v.map(|x| x.into());
self
}
pub fn set_point_in_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.point_in_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.point_in_time = v.map(|x| x.into());
self
}
pub fn set_target_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.target_instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.target_instance = v.map(|x| x.into());
self
}
pub fn set_private_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.private_network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.private_network = v.map(|x| x.into());
self
}
pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.allocated_ip_range = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.allocated_ip_range = v.map(|x| x.into());
self
}
pub fn set_preferred_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_zone = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_zone = v.map(|x| x.into());
self
}
pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_secondary_zone = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.preferred_secondary_zone = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PointInTimeRestoreContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BinLogCoordinates {
pub bin_log_file_name: std::string::String,
pub bin_log_position: i64,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BinLogCoordinates {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.bin_log_file_name = v.into();
self
}
pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.bin_log_position = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for BinLogCoordinates {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseInstance {
pub kind: std::string::String,
pub state: crate::model::database_instance::SqlInstanceState,
pub database_version: crate::model::SqlDatabaseVersion,
pub settings: std::option::Option<crate::model::Settings>,
pub etag: std::string::String,
pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
pub master_instance_name: std::string::String,
pub replica_names: std::vec::Vec<std::string::String>,
#[deprecated]
pub max_disk_size: std::option::Option<wkt::Int64Value>,
#[deprecated]
pub current_disk_size: std::option::Option<wkt::Int64Value>,
pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
pub server_ca_cert: std::option::Option<crate::model::SslCert>,
pub instance_type: crate::model::SqlInstanceType,
pub project: std::string::String,
#[deprecated]
pub ipv6_address: std::string::String,
pub service_account_email_address: std::string::String,
pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
pub backend_type: crate::model::SqlBackendType,
pub self_link: std::string::String,
pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
pub connection_name: std::string::String,
pub name: std::string::String,
pub region: std::string::String,
pub gce_zone: std::string::String,
pub secondary_gce_zone: std::string::String,
pub disk_encryption_configuration:
std::option::Option<crate::model::DiskEncryptionConfiguration>,
pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
pub root_password: std::string::String,
pub scheduled_maintenance:
std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
pub database_installed_version: std::string::String,
pub out_of_disk_report:
std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub available_maintenance_versions: std::vec::Vec<std::string::String>,
pub maintenance_version: std::string::String,
pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
pub sql_network_architecture:
std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
pub psc_service_attachment_link: std::option::Option<std::string::String>,
pub dns_name: std::option::Option<std::string::String>,
#[deprecated]
pub primary_dns_name: std::option::Option<std::string::String>,
pub write_endpoint: std::option::Option<std::string::String>,
pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub node_count: std::option::Option<i32>,
pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabaseInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
mut self,
v: T,
) -> Self {
self.database_version = v.into();
self
}
pub fn set_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Settings>,
{
self.settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Settings>,
{
self.settings = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_failover_replica<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
{
self.failover_replica = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
{
self.failover_replica = v.map(|x| x.into());
self
}
pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.master_instance_name = v.into();
self
}
pub fn set_replica_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.replica_names = v.into_iter().map(|i| i.into()).collect();
self
}
#[deprecated]
pub fn set_max_disk_size<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.max_disk_size = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.max_disk_size = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_current_disk_size<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.current_disk_size = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.current_disk_size = v.map(|x| x.into());
self
}
pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IpMapping>,
{
use std::iter::Iterator;
self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.server_ca_cert = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.server_ca_cert = v.map(|x| x.into());
self
}
pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
mut self,
v: T,
) -> Self {
self.instance_type = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
#[deprecated]
pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ipv6_address = v.into();
self
}
pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_account_email_address = v.into();
self
}
pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OnPremisesConfiguration>,
{
self.on_premises_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OnPremisesConfiguration>,
{
self.on_premises_configuration = v.map(|x| x.into());
self
}
pub fn set_replica_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReplicaConfiguration>,
{
self.replica_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReplicaConfiguration>,
{
self.replica_configuration = v.map(|x| x.into());
self
}
pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
mut self,
v: T,
) -> Self {
self.backend_type = v.into();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SqlSuspensionReason>,
{
use std::iter::Iterator;
self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connection_name = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.gce_zone = v.into();
self
}
pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.secondary_gce_zone = v.into();
self
}
pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
{
self.disk_encryption_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_encryption_configuration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
{
self.disk_encryption_configuration = v.map(|x| x.into());
self
}
pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionStatus>,
{
self.disk_encryption_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskEncryptionStatus>,
{
self.disk_encryption_status = v.map(|x| x.into());
self
}
pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.root_password = v.into();
self
}
pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
{
self.scheduled_maintenance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
{
self.scheduled_maintenance = v.map(|x| x.into());
self
}
pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzs = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzs = v.map(|x| x.into());
self
}
pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.database_installed_version = v.into();
self
}
pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
{
self.out_of_disk_report = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
{
self.out_of_disk_report = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.maintenance_version = v.into();
self
}
pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
{
use std::iter::Iterator;
self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
{
self.sql_network_architecture = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
{
self.sql_network_architecture = v.map(|x| x.into());
self
}
pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.psc_service_attachment_link = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.psc_service_attachment_link = v.map(|x| x.into());
self
}
pub fn set_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.primary_dns_name = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.primary_dns_name = v.map(|x| x.into());
self
}
pub fn set_write_endpoint<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.write_endpoint = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.write_endpoint = v.map(|x| x.into());
self
}
pub fn set_replication_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReplicationCluster>,
{
self.replication_cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReplicationCluster>,
{
self.replication_cluster = v.map(|x| x.into());
self
}
pub fn set_gemini_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GeminiInstanceConfig>,
{
self.gemini_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GeminiInstanceConfig>,
{
self.gemini_config = v.map(|x| x.into());
self
}
pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzi = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.satisfies_pzi = v.map(|x| x.into());
self
}
pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
self
}
pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
self
}
pub fn set_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_node_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.node_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.node_count = v.map(|x| x.into());
self
}
pub fn set_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
{
use std::iter::Iterator;
self.nodes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_dns_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsNameMapping>,
{
use std::iter::Iterator;
self.dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DatabaseInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
}
}
pub mod database_instance {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlFailoverReplica {
pub name: std::string::String,
pub available: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlFailoverReplica {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_available<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.available = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.available = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlFailoverReplica {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlScheduledMaintenance {
pub start_time: std::option::Option<wkt::Timestamp>,
#[deprecated]
pub can_defer: bool,
pub can_reschedule: bool,
pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlScheduledMaintenance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.can_defer = v.into();
self
}
pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.can_reschedule = v.into();
self
}
pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.schedule_deadline_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.schedule_deadline_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlScheduledMaintenance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlOutOfDiskReport {
pub sql_out_of_disk_state: std::option::Option<
crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
>,
pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlOutOfDiskReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
>,
{
self.sql_out_of_disk_state = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
>,
{
self.sql_out_of_disk_state = v.map(|x| x.into());
self
}
pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlOutOfDiskReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
}
}
pub mod sql_out_of_disk_report {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlOutOfDiskState {
Unspecified,
Normal,
SoftShutdown,
UnknownValue(sql_out_of_disk_state::UnknownValue),
}
#[doc(hidden)]
pub mod sql_out_of_disk_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlOutOfDiskState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Normal => std::option::Option::Some(1),
Self::SoftShutdown => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
}
Self::Normal => std::option::Option::Some("NORMAL"),
Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlOutOfDiskState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlOutOfDiskState {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlOutOfDiskState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Normal,
2 => Self::SoftShutdown,
_ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlOutOfDiskState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
"NORMAL" => Self::Normal,
"SOFT_SHUTDOWN" => Self::SoftShutdown,
_ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlOutOfDiskState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Normal => serializer.serialize_i32(1),
Self::SoftShutdown => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PoolNodeConfig {
pub name: std::option::Option<std::string::String>,
pub gce_zone: std::option::Option<std::string::String>,
pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
pub dns_name: std::option::Option<std::string::String>,
pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
pub psc_service_attachment_link: std::option::Option<std::string::String>,
pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PoolNodeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
pub fn set_gce_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.gce_zone = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.gce_zone = v.map(|x| x.into());
self
}
pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IpMapping>,
{
use std::iter::Iterator;
self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = v.map(|x| x.into());
self
}
pub fn set_state<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
{
self.state = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
{
self.state = v.map(|x| x.into());
self
}
pub fn set_dns_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsNameMapping>,
{
use std::iter::Iterator;
self.dns_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.psc_service_attachment_link = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_psc_service_attachment_link<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.psc_service_attachment_link = v.map(|x| x.into());
self
}
pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
{
use std::iter::Iterator;
self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PoolNodeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlInstanceState {
Unspecified,
Runnable,
Suspended,
PendingDelete,
PendingCreate,
Maintenance,
Failed,
#[deprecated]
OnlineMaintenance,
Repairing,
UnknownValue(sql_instance_state::UnknownValue),
}
#[doc(hidden)]
pub mod sql_instance_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlInstanceState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Runnable => std::option::Option::Some(1),
Self::Suspended => std::option::Option::Some(2),
Self::PendingDelete => std::option::Option::Some(3),
Self::PendingCreate => std::option::Option::Some(4),
Self::Maintenance => std::option::Option::Some(5),
Self::Failed => std::option::Option::Some(6),
Self::OnlineMaintenance => std::option::Option::Some(7),
Self::Repairing => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
Self::Runnable => std::option::Option::Some("RUNNABLE"),
Self::Suspended => std::option::Option::Some("SUSPENDED"),
Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
Self::Repairing => std::option::Option::Some("REPAIRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlInstanceState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlInstanceState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlInstanceState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Runnable,
2 => Self::Suspended,
3 => Self::PendingDelete,
4 => Self::PendingCreate,
5 => Self::Maintenance,
6 => Self::Failed,
7 => Self::OnlineMaintenance,
8 => Self::Repairing,
_ => Self::UnknownValue(sql_instance_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlInstanceState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
"RUNNABLE" => Self::Runnable,
"SUSPENDED" => Self::Suspended,
"PENDING_DELETE" => Self::PendingDelete,
"PENDING_CREATE" => Self::PendingCreate,
"MAINTENANCE" => Self::Maintenance,
"FAILED" => Self::Failed,
"ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
"REPAIRING" => Self::Repairing,
_ => Self::UnknownValue(sql_instance_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlInstanceState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Runnable => serializer.serialize_i32(1),
Self::Suspended => serializer.serialize_i32(2),
Self::PendingDelete => serializer.serialize_i32(3),
Self::PendingCreate => serializer.serialize_i32(4),
Self::Maintenance => serializer.serialize_i32(5),
Self::Failed => serializer.serialize_i32(6),
Self::OnlineMaintenance => serializer.serialize_i32(7),
Self::Repairing => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlNetworkArchitecture {
Unspecified,
NewNetworkArchitecture,
OldNetworkArchitecture,
UnknownValue(sql_network_architecture::UnknownValue),
}
#[doc(hidden)]
pub mod sql_network_architecture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlNetworkArchitecture {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NewNetworkArchitecture => std::option::Option::Some(1),
Self::OldNetworkArchitecture => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
}
Self::NewNetworkArchitecture => {
std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
}
Self::OldNetworkArchitecture => {
std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlNetworkArchitecture {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlNetworkArchitecture {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlNetworkArchitecture {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NewNetworkArchitecture,
2 => Self::OldNetworkArchitecture,
_ => Self::UnknownValue(sql_network_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlNetworkArchitecture {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
"NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
"OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
_ => Self::UnknownValue(sql_network_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlNetworkArchitecture {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NewNetworkArchitecture => serializer.serialize_i32(1),
Self::OldNetworkArchitecture => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GeminiInstanceConfig {
pub entitled: std::option::Option<bool>,
pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
pub oom_session_cancel_enabled: std::option::Option<bool>,
pub active_query_enabled: std::option::Option<bool>,
pub index_advisor_enabled: std::option::Option<bool>,
pub flag_recommender_enabled: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GeminiInstanceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entitled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.entitled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.entitled = v.map(|x| x.into());
self
}
pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
self
}
pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.oom_session_cancel_enabled = v.map(|x| x.into());
self
}
pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.active_query_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.active_query_enabled = v.map(|x| x.into());
self
}
pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.index_advisor_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.index_advisor_enabled = v.map(|x| x.into());
self
}
pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.flag_recommender_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.flag_recommender_enabled = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GeminiInstanceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReplicationCluster {
pub psa_write_endpoint: std::string::String,
pub failover_dr_replica_name: std::string::String,
pub dr_replica: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicationCluster {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.psa_write_endpoint = v.into();
self
}
pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.failover_dr_replica_name = v.into();
self
}
pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.dr_replica = v.into();
self
}
}
impl wkt::message::Message for ReplicationCluster {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AvailableDatabaseVersion {
pub major_version: std::option::Option<std::string::String>,
pub name: std::option::Option<std::string::String>,
pub display_name: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AvailableDatabaseVersion {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_major_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.major_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.major_version = v.map(|x| x.into());
self
}
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
pub fn set_display_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.display_name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.display_name = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AvailableDatabaseVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesRescheduleMaintenanceRequestBody {
pub reschedule: std::option::Option<
crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesRescheduleMaintenanceRequestBody {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reschedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
>,
{
self.reschedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
>,
{
self.reschedule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
}
}
pub mod sql_instances_reschedule_maintenance_request_body {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Reschedule {
pub reschedule_type:
crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
pub schedule_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Reschedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reschedule_type<
T: std::convert::Into<
crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
>,
>(
mut self,
v: T,
) -> Self {
self.reschedule_type = v.into();
self
}
pub fn set_schedule_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.schedule_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.schedule_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Reschedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RescheduleType {
Unspecified,
Immediate,
NextAvailableWindow,
SpecificTime,
UnknownValue(reschedule_type::UnknownValue),
}
#[doc(hidden)]
pub mod reschedule_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RescheduleType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Immediate => std::option::Option::Some(1),
Self::NextAvailableWindow => std::option::Option::Some(2),
Self::SpecificTime => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
Self::Immediate => std::option::Option::Some("IMMEDIATE"),
Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RescheduleType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RescheduleType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RescheduleType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Immediate,
2 => Self::NextAvailableWindow,
3 => Self::SpecificTime,
_ => Self::UnknownValue(reschedule_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RescheduleType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
"IMMEDIATE" => Self::Immediate,
"NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
"SPECIFIC_TIME" => Self::SpecificTime,
_ => Self::UnknownValue(reschedule_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RescheduleType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Immediate => serializer.serialize_i32(1),
Self::NextAvailableWindow => serializer.serialize_i32(2),
Self::SpecificTime => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RescheduleType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DemoteMasterContext {
pub kind: std::string::String,
pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
pub master_instance_name: std::string::String,
pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
pub skip_replication_setup: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DemoteMasterContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.verify_gtid_consistency = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.verify_gtid_consistency = v.map(|x| x.into());
self
}
pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.master_instance_name = v.into();
self
}
pub fn set_replica_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
{
self.replica_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
{
self.replica_configuration = v.map(|x| x.into());
self
}
pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_replication_setup = v.into();
self
}
}
impl wkt::message::Message for DemoteMasterContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DemoteContext {
pub kind: std::string::String,
pub source_representative_instance_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DemoteContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_representative_instance_name = v.into();
self
}
}
impl wkt::message::Message for DemoteContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DemoteContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FailoverContext {
pub settings_version: i64,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FailoverContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.settings_version = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for FailoverContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.FailoverContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreBackupContext {
pub kind: std::string::String,
pub backup_run_id: i64,
pub instance_id: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreBackupContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.backup_run_id = v.into();
self
}
pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_id = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for RestoreBackupContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RotateServerCaContext {
pub kind: std::string::String,
pub next_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RotateServerCaContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_version = v.into();
self
}
}
impl wkt::message::Message for RotateServerCaContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RotateServerCertificateContext {
pub kind: std::string::String,
pub next_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RotateServerCertificateContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_version = v.into();
self
}
}
impl wkt::message::Message for RotateServerCertificateContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RotateEntraIdCertificateContext {
pub kind: std::string::String,
pub next_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RotateEntraIdCertificateContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_version = v.into();
self
}
}
impl wkt::message::Message for RotateEntraIdCertificateContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TruncateLogContext {
pub kind: std::string::String,
pub log_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TruncateLogContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_type = v.into();
self
}
}
impl wkt::message::Message for TruncateLogContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlExternalSyncSettingError {
pub kind: std::string::String,
pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
pub detail: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlExternalSyncSettingError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_type<
T: std::convert::Into<
crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.detail = v.into();
self
}
}
impl wkt::message::Message for SqlExternalSyncSettingError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
}
}
pub mod sql_external_sync_setting_error {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlExternalSyncSettingErrorType {
Unspecified,
ConnectionFailure,
BinlogNotEnabled,
IncompatibleDatabaseVersion,
ReplicaAlreadySetup,
InsufficientPrivilege,
UnsupportedMigrationType,
NoPglogicalInstalled,
PglogicalNodeAlreadyExists,
InvalidWalLevel,
InvalidSharedPreloadLibrary,
InsufficientMaxReplicationSlots,
InsufficientMaxWalSenders,
InsufficientMaxWorkerProcesses,
UnsupportedExtensions,
InvalidRdsLogicalReplication,
InvalidLoggingSetup,
InvalidDbParam,
UnsupportedGtidMode,
SqlserverAgentNotRunning,
UnsupportedTableDefinition,
UnsupportedDefiner,
SqlserverServernameMismatch,
PrimaryAlreadySetup,
UnsupportedBinlogFormat,
BinlogRetentionSetting,
UnsupportedStorageEngine,
LimitedSupportTables,
ExistingDataInReplica,
MissingOptionalPrivileges,
RiskyBackupAdminPrivilege,
InsufficientGcsPermissions,
InvalidFileInfo,
UnsupportedDatabaseSettings,
MysqlParallelImportInsufficientPrivilege,
LocalInfileOff,
TurnOnPitrAfterPromote,
IncompatibleDatabaseMinorVersion,
SourceMaxSubscriptions,
UnableToVerifyDefiners,
SubscriptionCalculationStatus,
PgSubscriptionCount,
PgSyncParallelLevel,
InsufficientDiskSize,
InsufficientMachineTier,
UnsupportedExtensionsNotMigrated,
ExtensionsNotMigrated,
PgCronFlagEnabledInReplica,
ExtensionsNotEnabledInReplica,
UnsupportedColumns,
UsersNotCreatedInReplica,
UnsupportedSystemObjects,
UnsupportedTablesWithReplicaIdentity,
SelectedObjectsNotExistOnSource,
PscOnlyInstanceWithNoNetworkAttachmentUri,
SelectedObjectsReferenceUnselectedObjects,
PromptDeleteExisting,
WillDeleteExisting,
PgDdlReplicationInsufficientPrivilege,
UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_external_sync_setting_error_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlExternalSyncSettingErrorType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ConnectionFailure => std::option::Option::Some(1),
Self::BinlogNotEnabled => std::option::Option::Some(2),
Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
Self::ReplicaAlreadySetup => std::option::Option::Some(4),
Self::InsufficientPrivilege => std::option::Option::Some(5),
Self::UnsupportedMigrationType => std::option::Option::Some(6),
Self::NoPglogicalInstalled => std::option::Option::Some(7),
Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
Self::InvalidWalLevel => std::option::Option::Some(9),
Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
Self::UnsupportedExtensions => std::option::Option::Some(14),
Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
Self::InvalidLoggingSetup => std::option::Option::Some(16),
Self::InvalidDbParam => std::option::Option::Some(17),
Self::UnsupportedGtidMode => std::option::Option::Some(18),
Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
Self::UnsupportedTableDefinition => std::option::Option::Some(20),
Self::UnsupportedDefiner => std::option::Option::Some(21),
Self::SqlserverServernameMismatch => std::option::Option::Some(22),
Self::PrimaryAlreadySetup => std::option::Option::Some(23),
Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
Self::BinlogRetentionSetting => std::option::Option::Some(25),
Self::UnsupportedStorageEngine => std::option::Option::Some(26),
Self::LimitedSupportTables => std::option::Option::Some(27),
Self::ExistingDataInReplica => std::option::Option::Some(28),
Self::MissingOptionalPrivileges => std::option::Option::Some(29),
Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
Self::InsufficientGcsPermissions => std::option::Option::Some(31),
Self::InvalidFileInfo => std::option::Option::Some(32),
Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
Self::LocalInfileOff => std::option::Option::Some(35),
Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
Self::SourceMaxSubscriptions => std::option::Option::Some(38),
Self::UnableToVerifyDefiners => std::option::Option::Some(39),
Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
Self::PgSubscriptionCount => std::option::Option::Some(41),
Self::PgSyncParallelLevel => std::option::Option::Some(42),
Self::InsufficientDiskSize => std::option::Option::Some(43),
Self::InsufficientMachineTier => std::option::Option::Some(44),
Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
Self::ExtensionsNotMigrated => std::option::Option::Some(46),
Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
Self::UnsupportedColumns => std::option::Option::Some(49),
Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
Self::UnsupportedSystemObjects => std::option::Option::Some(51),
Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
Self::PromptDeleteExisting => std::option::Option::Some(56),
Self::WillDeleteExisting => std::option::Option::Some(57),
Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
}
Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
Self::IncompatibleDatabaseVersion => {
std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
}
Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
Self::UnsupportedMigrationType => {
std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
}
Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
Self::PglogicalNodeAlreadyExists => {
std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
}
Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
Self::InvalidSharedPreloadLibrary => {
std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
}
Self::InsufficientMaxReplicationSlots => {
std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
}
Self::InsufficientMaxWalSenders => {
std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
}
Self::InsufficientMaxWorkerProcesses => {
std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
}
Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
Self::InvalidRdsLogicalReplication => {
std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
}
Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
Self::SqlserverAgentNotRunning => {
std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
}
Self::UnsupportedTableDefinition => {
std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
}
Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
Self::SqlserverServernameMismatch => {
std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
}
Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
Self::UnsupportedBinlogFormat => {
std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
}
Self::BinlogRetentionSetting => {
std::option::Option::Some("BINLOG_RETENTION_SETTING")
}
Self::UnsupportedStorageEngine => {
std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
}
Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
Self::ExistingDataInReplica => {
std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
}
Self::MissingOptionalPrivileges => {
std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
}
Self::RiskyBackupAdminPrivilege => {
std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
}
Self::InsufficientGcsPermissions => {
std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
}
Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
Self::UnsupportedDatabaseSettings => {
std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
}
Self::MysqlParallelImportInsufficientPrivilege => {
std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
}
Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
Self::TurnOnPitrAfterPromote => {
std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
}
Self::IncompatibleDatabaseMinorVersion => {
std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
}
Self::SourceMaxSubscriptions => {
std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
}
Self::UnableToVerifyDefiners => {
std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
}
Self::SubscriptionCalculationStatus => {
std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
}
Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
Self::InsufficientMachineTier => {
std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
}
Self::UnsupportedExtensionsNotMigrated => {
std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
}
Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
Self::PgCronFlagEnabledInReplica => {
std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
}
Self::ExtensionsNotEnabledInReplica => {
std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
}
Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
Self::UsersNotCreatedInReplica => {
std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
}
Self::UnsupportedSystemObjects => {
std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
}
Self::UnsupportedTablesWithReplicaIdentity => {
std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
}
Self::SelectedObjectsNotExistOnSource => {
std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
}
Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
}
Self::SelectedObjectsReferenceUnselectedObjects => {
std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
}
Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
Self::PgDdlReplicationInsufficientPrivilege => {
std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlExternalSyncSettingErrorType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlExternalSyncSettingErrorType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ConnectionFailure,
2 => Self::BinlogNotEnabled,
3 => Self::IncompatibleDatabaseVersion,
4 => Self::ReplicaAlreadySetup,
5 => Self::InsufficientPrivilege,
6 => Self::UnsupportedMigrationType,
7 => Self::NoPglogicalInstalled,
8 => Self::PglogicalNodeAlreadyExists,
9 => Self::InvalidWalLevel,
10 => Self::InvalidSharedPreloadLibrary,
11 => Self::InsufficientMaxReplicationSlots,
12 => Self::InsufficientMaxWalSenders,
13 => Self::InsufficientMaxWorkerProcesses,
14 => Self::UnsupportedExtensions,
15 => Self::InvalidRdsLogicalReplication,
16 => Self::InvalidLoggingSetup,
17 => Self::InvalidDbParam,
18 => Self::UnsupportedGtidMode,
19 => Self::SqlserverAgentNotRunning,
20 => Self::UnsupportedTableDefinition,
21 => Self::UnsupportedDefiner,
22 => Self::SqlserverServernameMismatch,
23 => Self::PrimaryAlreadySetup,
24 => Self::UnsupportedBinlogFormat,
25 => Self::BinlogRetentionSetting,
26 => Self::UnsupportedStorageEngine,
27 => Self::LimitedSupportTables,
28 => Self::ExistingDataInReplica,
29 => Self::MissingOptionalPrivileges,
30 => Self::RiskyBackupAdminPrivilege,
31 => Self::InsufficientGcsPermissions,
32 => Self::InvalidFileInfo,
33 => Self::UnsupportedDatabaseSettings,
34 => Self::MysqlParallelImportInsufficientPrivilege,
35 => Self::LocalInfileOff,
36 => Self::TurnOnPitrAfterPromote,
37 => Self::IncompatibleDatabaseMinorVersion,
38 => Self::SourceMaxSubscriptions,
39 => Self::UnableToVerifyDefiners,
40 => Self::SubscriptionCalculationStatus,
41 => Self::PgSubscriptionCount,
42 => Self::PgSyncParallelLevel,
43 => Self::InsufficientDiskSize,
44 => Self::InsufficientMachineTier,
45 => Self::UnsupportedExtensionsNotMigrated,
46 => Self::ExtensionsNotMigrated,
47 => Self::PgCronFlagEnabledInReplica,
48 => Self::ExtensionsNotEnabledInReplica,
49 => Self::UnsupportedColumns,
50 => Self::UsersNotCreatedInReplica,
51 => Self::UnsupportedSystemObjects,
52 => Self::UnsupportedTablesWithReplicaIdentity,
53 => Self::SelectedObjectsNotExistOnSource,
54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
55 => Self::SelectedObjectsReferenceUnselectedObjects,
56 => Self::PromptDeleteExisting,
57 => Self::WillDeleteExisting,
58 => Self::PgDdlReplicationInsufficientPrivilege,
_ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
"CONNECTION_FAILURE" => Self::ConnectionFailure,
"BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
"INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
"REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
"INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
"UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
"NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
"PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
"INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
"INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
"INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
"INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
"INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
"UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
"INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
"INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
"INVALID_DB_PARAM" => Self::InvalidDbParam,
"UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
"SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
"UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
"UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
"SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
"PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
"UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
"BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
"UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
"LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
"EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
"MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
"RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
"INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
"INVALID_FILE_INFO" => Self::InvalidFileInfo,
"UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
"MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
Self::MysqlParallelImportInsufficientPrivilege
}
"LOCAL_INFILE_OFF" => Self::LocalInfileOff,
"TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
"INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
"SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
"UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
"SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
"PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
"PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
"INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
"INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
"UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
"EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
"PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
"EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
"UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
"USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
"UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
"UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
Self::UnsupportedTablesWithReplicaIdentity
}
"SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
"PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
Self::PscOnlyInstanceWithNoNetworkAttachmentUri
}
"SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
Self::SelectedObjectsReferenceUnselectedObjects
}
"PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
"WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
"PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
Self::PgDdlReplicationInsufficientPrivilege
}
_ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ConnectionFailure => serializer.serialize_i32(1),
Self::BinlogNotEnabled => serializer.serialize_i32(2),
Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
Self::InsufficientPrivilege => serializer.serialize_i32(5),
Self::UnsupportedMigrationType => serializer.serialize_i32(6),
Self::NoPglogicalInstalled => serializer.serialize_i32(7),
Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
Self::InvalidWalLevel => serializer.serialize_i32(9),
Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
Self::UnsupportedExtensions => serializer.serialize_i32(14),
Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
Self::InvalidLoggingSetup => serializer.serialize_i32(16),
Self::InvalidDbParam => serializer.serialize_i32(17),
Self::UnsupportedGtidMode => serializer.serialize_i32(18),
Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
Self::UnsupportedDefiner => serializer.serialize_i32(21),
Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
Self::BinlogRetentionSetting => serializer.serialize_i32(25),
Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
Self::LimitedSupportTables => serializer.serialize_i32(27),
Self::ExistingDataInReplica => serializer.serialize_i32(28),
Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
Self::InvalidFileInfo => serializer.serialize_i32(32),
Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
Self::LocalInfileOff => serializer.serialize_i32(35),
Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
Self::PgSubscriptionCount => serializer.serialize_i32(41),
Self::PgSyncParallelLevel => serializer.serialize_i32(42),
Self::InsufficientDiskSize => serializer.serialize_i32(43),
Self::InsufficientMachineTier => serializer.serialize_i32(44),
Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
Self::UnsupportedColumns => serializer.serialize_i32(49),
Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
Self::PromptDeleteExisting => serializer.serialize_i32(56),
Self::WillDeleteExisting => serializer.serialize_i32(57),
Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<
SqlExternalSyncSettingErrorType,
>::new(
".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SelectedObjects {
pub database: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SelectedObjects {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
}
impl wkt::message::Message for SelectedObjects {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OnPremisesConfiguration {
pub host_port: std::string::String,
pub kind: std::string::String,
pub username: std::string::String,
pub password: std::string::String,
pub ca_certificate: std::string::String,
pub client_certificate: std::string::String,
pub client_key: std::string::String,
pub dump_file_path: std::string::String,
pub source_instance: std::option::Option<crate::model::InstanceReference>,
pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
pub ssl_option: crate::model::on_premises_configuration::SslOption,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OnPremisesConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host_port = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.password = v.into();
self
}
pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ca_certificate = v.into();
self
}
pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.client_certificate = v.into();
self
}
pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_key = v.into();
self
}
pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dump_file_path = v.into();
self
}
pub fn set_source_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceReference>,
{
self.source_instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceReference>,
{
self.source_instance = v.map(|x| x.into());
self
}
pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SelectedObjects>,
{
use std::iter::Iterator;
self.selected_objects = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_ssl_option<
T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
>(
mut self,
v: T,
) -> Self {
self.ssl_option = v.into();
self
}
}
impl wkt::message::Message for OnPremisesConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
}
}
pub mod on_premises_configuration {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SslOption {
Unspecified,
Disable,
Require,
VerifyCa,
UnknownValue(ssl_option::UnknownValue),
}
#[doc(hidden)]
pub mod ssl_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SslOption {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Disable => std::option::Option::Some(1),
Self::Require => std::option::Option::Some(2),
Self::VerifyCa => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
Self::Disable => std::option::Option::Some("DISABLE"),
Self::Require => std::option::Option::Some("REQUIRE"),
Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SslOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SslOption {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SslOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Disable,
2 => Self::Require,
3 => Self::VerifyCa,
_ => Self::UnknownValue(ssl_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SslOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
"DISABLE" => Self::Disable,
"REQUIRE" => Self::Require,
"VERIFY_CA" => Self::VerifyCa,
_ => Self::UnknownValue(ssl_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SslOption {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Disable => serializer.serialize_i32(1),
Self::Require => serializer.serialize_i32(2),
Self::VerifyCa => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SslOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReplicaConfiguration {
pub kind: std::string::String,
pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
pub failover_target: std::option::Option<wkt::BoolValue>,
pub cascadable_replica: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicaConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
{
self.mysql_replica_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
{
self.mysql_replica_configuration = v.map(|x| x.into());
self
}
pub fn set_failover_target<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.failover_target = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.failover_target = v.map(|x| x.into());
self
}
pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.cascadable_replica = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.cascadable_replica = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReplicaConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesExecuteSqlRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesExecuteSqlRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExecuteSqlPayload>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExecuteSqlPayload>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteSqlPayload {
pub user: std::string::String,
pub sql_statement: std::string::String,
pub database: std::string::String,
pub row_limit: i64,
pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
pub application: std::string::String,
pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteSqlPayload {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user = v.into();
self
}
pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_statement = v.into();
self
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.row_limit = v.into();
self
}
pub fn set_partial_result_mode<
T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
>(
mut self,
v: T,
) -> Self {
self.partial_result_mode = v.into();
self
}
pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.application = v.into();
self
}
pub fn set_user_password<
T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
>(
mut self,
v: T,
) -> Self {
self.user_password = v.into();
self
}
pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.user_password.as_ref().and_then(|v| match v {
crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.user_password = std::option::Option::Some(
crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
);
self
}
}
impl wkt::message::Message for ExecuteSqlPayload {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
}
}
pub mod execute_sql_payload {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PartialResultMode {
Unspecified,
FailPartialResult,
AllowPartialResult,
UnknownValue(partial_result_mode::UnknownValue),
}
#[doc(hidden)]
pub mod partial_result_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PartialResultMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FailPartialResult => std::option::Option::Some(1),
Self::AllowPartialResult => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PartialResultMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PartialResultMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PartialResultMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FailPartialResult,
2 => Self::AllowPartialResult,
_ => Self::UnknownValue(partial_result_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PartialResultMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
"FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
"ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
_ => Self::UnknownValue(partial_result_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PartialResultMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::FailPartialResult => serializer.serialize_i32(1),
Self::AllowPartialResult => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UserPassword {
AutoIamAuthn(bool),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesExecuteSqlResponse {
pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
pub metadata: std::option::Option<crate::model::Metadata>,
pub results: std::vec::Vec<crate::model::QueryResult>,
pub status: std::option::Option<google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesExecuteSqlResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Metadata>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Metadata>,
{
self.metadata = v.map(|x| x.into());
self
}
pub fn set_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::QueryResult>,
{
use std::iter::Iterator;
self.results = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
}
}
pub mod sql_instances_execute_sql_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Message {
pub message: std::option::Option<std::string::String>,
pub severity: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Message {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.message = v.map(|x| x.into());
self
}
pub fn set_severity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.severity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.severity = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Message {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryResult {
pub columns: std::vec::Vec<crate::model::Column>,
pub rows: std::vec::Vec<crate::model::Row>,
pub message: std::string::String,
pub partial_result: bool,
pub status: std::option::Option<google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_columns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Column>,
{
use std::iter::Iterator;
self.columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Row>,
{
use std::iter::Iterator;
self.rows = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.partial_result = v.into();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for QueryResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.QueryResult"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Column {
pub name: std::string::String,
pub r#type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Column {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for Column {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Column"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Row {
pub values: std::vec::Vec<crate::model::Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Row {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Value>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Row {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Row"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Value {
pub value: std::string::String,
pub null_value: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Value {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.null_value = v.into();
self
}
}
impl wkt::message::Message for Value {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Value"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Metadata {
pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Metadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.sql_statement_execution_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.sql_statement_execution_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Metadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Metadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesAcquireSsrsLeaseRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesAcquireSsrsLeaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesAcquireSsrsLeaseResponse {
pub operation_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesAcquireSsrsLeaseResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation_id = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesReleaseSsrsLeaseRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesReleaseSsrsLeaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesReleaseSsrsLeaseResponse {
pub operation_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesReleaseSsrsLeaseResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation_id = v.into();
self
}
}
impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlInstancesPointInTimeRestoreRequest {
pub parent: std::string::String,
pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlInstancesPointInTimeRestoreRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
{
self.context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
{
self.context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlOperationsGetRequest {
pub operation: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlOperationsGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlOperationsGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlOperationsListRequest {
pub instance: std::string::String,
pub max_results: u32,
pub page_token: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlOperationsListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
self.max_results = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlOperationsListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationsListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::Operation>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationsListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Operation>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for OperationsListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
type PageItem = crate::model::Operation;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.items
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlOperationsCancelRequest {
pub operation: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlOperationsCancelRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlOperationsCancelRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AclEntry {
pub value: std::string::String,
pub expiration_time: std::option::Option<wkt::Timestamp>,
pub name: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AclEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
pub fn set_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiration_time = v.map(|x| x.into());
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for AclEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.AclEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiWarning {
pub code: crate::model::api_warning::SqlApiWarningCode,
pub message: std::string::String,
pub region: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApiWarning {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
mut self,
v: T,
) -> Self {
self.code = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
}
impl wkt::message::Message for ApiWarning {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ApiWarning"
}
}
pub mod api_warning {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlApiWarningCode {
Unspecified,
RegionUnreachable,
MaxResultsExceedsLimit,
CompromisedCredentials,
InternalStateFailure,
UnknownValue(sql_api_warning_code::UnknownValue),
}
#[doc(hidden)]
pub mod sql_api_warning_code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlApiWarningCode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RegionUnreachable => std::option::Option::Some(1),
Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
Self::CompromisedCredentials => std::option::Option::Some(3),
Self::InternalStateFailure => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
Self::MaxResultsExceedsLimit => {
std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
}
Self::CompromisedCredentials => {
std::option::Option::Some("COMPROMISED_CREDENTIALS")
}
Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlApiWarningCode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlApiWarningCode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlApiWarningCode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RegionUnreachable,
2 => Self::MaxResultsExceedsLimit,
3 => Self::CompromisedCredentials,
4 => Self::InternalStateFailure,
_ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlApiWarningCode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
"REGION_UNREACHABLE" => Self::RegionUnreachable,
"MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
"COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
"INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
_ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlApiWarningCode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RegionUnreachable => serializer.serialize_i32(1),
Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
Self::CompromisedCredentials => serializer.serialize_i32(3),
Self::InternalStateFailure => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupRetentionSettings {
pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
pub retained_backups: std::option::Option<wkt::Int32Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupRetentionSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retention_unit<
T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
>(
mut self,
v: T,
) -> Self {
self.retention_unit = v.into();
self
}
pub fn set_retained_backups<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.retained_backups = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.retained_backups = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BackupRetentionSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
}
}
pub mod backup_retention_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RetentionUnit {
Unspecified,
Count,
UnknownValue(retention_unit::UnknownValue),
}
#[doc(hidden)]
pub mod retention_unit {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RetentionUnit {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Count => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
Self::Count => std::option::Option::Some("COUNT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RetentionUnit {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RetentionUnit {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RetentionUnit {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Count,
_ => Self::UnknownValue(retention_unit::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RetentionUnit {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
"COUNT" => Self::Count,
_ => Self::UnknownValue(retention_unit::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RetentionUnit {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Count => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupConfiguration {
pub start_time: std::string::String,
pub enabled: std::option::Option<wkt::BoolValue>,
pub kind: std::string::String,
pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
pub location: std::string::String,
pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
pub transactional_log_storage_state:
std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.start_time = v.into();
self
}
pub fn set_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enabled = v.map(|x| x.into());
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.binary_log_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.binary_log_enabled = v.map(|x| x.into());
self
}
pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication_log_archiving_enabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.replication_log_archiving_enabled = v.map(|x| x.into());
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_point_in_time_recovery_enabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.point_in_time_recovery_enabled = v.map(|x| x.into());
self
}
pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupRetentionSettings>,
{
self.backup_retention_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupRetentionSettings>,
{
self.backup_retention_settings = v.map(|x| x.into());
self
}
pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.transaction_log_retention_days = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transaction_log_retention_days<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.transaction_log_retention_days = v.map(|x| x.into());
self
}
pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
{
self.transactional_log_storage_state = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transactional_log_storage_state<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
{
self.transactional_log_storage_state = v.map(|x| x.into());
self
}
pub fn set_backup_tier<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
{
self.backup_tier = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
{
self.backup_tier = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BackupConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
}
}
pub mod backup_configuration {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransactionalLogStorageState {
Unspecified,
Disk,
SwitchingToCloudStorage,
SwitchedToCloudStorage,
CloudStorage,
UnknownValue(transactional_log_storage_state::UnknownValue),
}
#[doc(hidden)]
pub mod transactional_log_storage_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransactionalLogStorageState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Disk => std::option::Option::Some(1),
Self::SwitchingToCloudStorage => std::option::Option::Some(2),
Self::SwitchedToCloudStorage => std::option::Option::Some(3),
Self::CloudStorage => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
}
Self::Disk => std::option::Option::Some("DISK"),
Self::SwitchingToCloudStorage => {
std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
}
Self::SwitchedToCloudStorage => {
std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
}
Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransactionalLogStorageState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransactionalLogStorageState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TransactionalLogStorageState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Disk,
2 => Self::SwitchingToCloudStorage,
3 => Self::SwitchedToCloudStorage,
4 => Self::CloudStorage,
_ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransactionalLogStorageState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
"DISK" => Self::Disk,
"SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
"SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
"CLOUD_STORAGE" => Self::CloudStorage,
_ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransactionalLogStorageState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Disk => serializer.serialize_i32(1),
Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
Self::CloudStorage => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackupTier {
Unspecified,
Standard,
#[deprecated]
Advanced,
Enhanced,
UnknownValue(backup_tier::UnknownValue),
}
#[doc(hidden)]
pub mod backup_tier {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackupTier {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::Advanced => std::option::Option::Some(2),
Self::Enhanced => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::Advanced => std::option::Option::Some("ADVANCED"),
Self::Enhanced => std::option::Option::Some("ENHANCED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackupTier {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackupTier {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for BackupTier {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Advanced,
3 => Self::Enhanced,
_ => Self::UnknownValue(backup_tier::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackupTier {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"ADVANCED" => Self::Advanced,
"ENHANCED" => Self::Enhanced,
_ => Self::UnknownValue(backup_tier::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackupTier {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::Advanced => serializer.serialize_i32(2),
Self::Enhanced => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackupTier {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
".google.cloud.sql.v1.BackupConfiguration.BackupTier",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PerformDiskShrinkContext {
pub target_size_gb: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PerformDiskShrinkContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.target_size_gb = v.into();
self
}
}
impl wkt::message::Message for PerformDiskShrinkContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreCheckResponse {
pub message: std::option::Option<std::string::String>,
pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
pub actions_required: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PreCheckResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.message = v.map(|x| x.into());
self
}
pub fn set_message_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::pre_check_response::MessageType>,
{
self.message_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::pre_check_response::MessageType>,
{
self.message_type = v.map(|x| x.into());
self
}
pub fn set_actions_required<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.actions_required = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PreCheckResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
}
}
pub mod pre_check_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MessageType {
Unspecified,
Info,
Warning,
Error,
UnknownValue(message_type::UnknownValue),
}
#[doc(hidden)]
pub mod message_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MessageType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Info => std::option::Option::Some(1),
Self::Warning => std::option::Option::Some(2),
Self::Error => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
Self::Info => std::option::Option::Some("INFO"),
Self::Warning => std::option::Option::Some("WARNING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MessageType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MessageType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MessageType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Info,
2 => Self::Warning,
3 => Self::Error,
_ => Self::UnknownValue(message_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MessageType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"INFO" => Self::Info,
"WARNING" => Self::Warning,
"ERROR" => Self::Error,
_ => Self::UnknownValue(message_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MessageType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Info => serializer.serialize_i32(1),
Self::Warning => serializer.serialize_i32(2),
Self::Error => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MessageType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
".google.cloud.sql.v1.PreCheckResponse.MessageType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreCheckMajorVersionUpgradeContext {
pub target_database_version: crate::model::SqlDatabaseVersion,
pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PreCheckMajorVersionUpgradeContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
mut self,
v: T,
) -> Self {
self.target_database_version = v.into();
self
}
pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PreCheckResponse>,
{
use std::iter::Iterator;
self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupContext {
pub backup_id: i64,
pub kind: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.backup_id = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for BackupContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.BackupContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Database {
pub kind: std::string::String,
pub charset: std::string::String,
pub collation: std::string::String,
pub etag: std::string::String,
pub name: std::string::String,
pub instance: std::string::String,
pub self_link: std::string::String,
pub project: std::string::String,
pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Database {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.charset = v.into();
self
}
pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.collation = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_database_details<
T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
>(
mut self,
v: T,
) -> Self {
self.database_details = v.into();
self
}
pub fn sqlserver_database_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
#[allow(unreachable_patterns)]
self.database_details.as_ref().and_then(|v| match v {
crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_sqlserver_database_details<
T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
>(
mut self,
v: T,
) -> Self {
self.database_details = std::option::Option::Some(
crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
);
self
}
}
impl wkt::message::Message for Database {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Database"
}
}
pub mod database {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseDetails {
SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlServerDatabaseDetails {
pub compatibility_level: i32,
pub recovery_model: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlServerDatabaseDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.compatibility_level = v.into();
self
}
pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.recovery_model = v.into();
self
}
}
impl wkt::message::Message for SqlServerDatabaseDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseFlags {
pub name: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabaseFlags {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for DatabaseFlags {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MySqlSyncConfig {
pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MySqlSyncConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SyncFlags>,
{
use std::iter::Iterator;
self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MySqlSyncConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SyncFlags {
pub name: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SyncFlags {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for SyncFlags {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SyncFlags"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceReference {
pub name: std::string::String,
pub region: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for InstanceReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InstanceReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DemoteMasterConfiguration {
pub kind: std::string::String,
pub mysql_replica_configuration:
std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DemoteMasterConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
{
self.mysql_replica_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
{
self.mysql_replica_configuration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DemoteMasterConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DemoteMasterMySqlReplicaConfiguration {
pub kind: std::string::String,
pub username: std::string::String,
pub password: std::string::String,
pub client_key: std::string::String,
pub client_certificate: std::string::String,
pub ca_certificate: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DemoteMasterMySqlReplicaConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.password = v.into();
self
}
pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_key = v.into();
self
}
pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.client_certificate = v.into();
self
}
pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ca_certificate = v.into();
self
}
}
impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportContext {
pub uri: std::string::String,
pub databases: std::vec::Vec<std::string::String>,
pub kind: std::string::String,
pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
pub file_type: crate::model::SqlFileType,
pub offload: std::option::Option<wkt::BoolValue>,
pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_databases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.databases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_sql_export_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
{
self.sql_export_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
{
self.sql_export_options = v.map(|x| x.into());
self
}
pub fn set_csv_export_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
{
self.csv_export_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
{
self.csv_export_options = v.map(|x| x.into());
self
}
pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
self.file_type = v.into();
self
}
pub fn set_offload<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.offload = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.offload = v.map(|x| x.into());
self
}
pub fn set_bak_export_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
{
self.bak_export_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
{
self.bak_export_options = v.map(|x| x.into());
self
}
pub fn set_tde_export_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
{
self.tde_export_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
{
self.tde_export_options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExportContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext"
}
}
pub mod export_context {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlCsvExportOptions {
pub select_query: std::string::String,
pub escape_character: std::string::String,
pub quote_character: std::string::String,
pub fields_terminated_by: std::string::String,
pub lines_terminated_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlCsvExportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_select_query<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.select_query = v.into();
self
}
pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.escape_character = v.into();
self
}
pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.quote_character = v.into();
self
}
pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.fields_terminated_by = v.into();
self
}
pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.lines_terminated_by = v.into();
self
}
}
impl wkt::message::Message for SqlCsvExportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlExportOptions {
pub tables: std::vec::Vec<std::string::String>,
pub schema_only: std::option::Option<wkt::BoolValue>,
pub mysql_export_options: std::option::Option<
crate::model::export_context::sql_export_options::MysqlExportOptions,
>,
pub threads: std::option::Option<wkt::Int32Value>,
pub parallel: std::option::Option<wkt::BoolValue>,
pub postgres_export_options: std::option::Option<
crate::model::export_context::sql_export_options::PostgresExportOptions,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlExportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_schema_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.schema_only = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.schema_only = v.map(|x| x.into());
self
}
pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::export_context::sql_export_options::MysqlExportOptions,
>,
{
self.mysql_export_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::export_context::sql_export_options::MysqlExportOptions,
>,
{
self.mysql_export_options = v.map(|x| x.into());
self
}
pub fn set_threads<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.threads = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.threads = v.map(|x| x.into());
self
}
pub fn set_parallel<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.parallel = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.parallel = v.map(|x| x.into());
self
}
pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::export_context::sql_export_options::PostgresExportOptions,
>,
{
self.postgres_export_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::export_context::sql_export_options::PostgresExportOptions,
>,
{
self.postgres_export_options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlExportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
}
}
pub mod sql_export_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MysqlExportOptions {
pub master_data: std::option::Option<wkt::Int32Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MysqlExportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_master_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.master_data = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.master_data = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MysqlExportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostgresExportOptions {
pub clean: std::option::Option<wkt::BoolValue>,
pub if_exists: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostgresExportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_clean<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.clean = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.clean = v.map(|x| x.into());
self
}
pub fn set_if_exists<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.if_exists = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.if_exists = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostgresExportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlBakExportOptions {
pub striped: std::option::Option<wkt::BoolValue>,
pub stripe_count: std::option::Option<wkt::Int32Value>,
pub bak_type: crate::model::BakType,
#[deprecated]
pub copy_only: std::option::Option<wkt::BoolValue>,
pub differential_base: std::option::Option<wkt::BoolValue>,
pub export_log_start_time: std::option::Option<wkt::Timestamp>,
pub export_log_end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlBakExportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_striped<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.striped = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.striped = v.map(|x| x.into());
self
}
pub fn set_stripe_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.stripe_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.stripe_count = v.map(|x| x.into());
self
}
pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
self.bak_type = v.into();
self
}
#[deprecated]
pub fn set_copy_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.copy_only = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.copy_only = v.map(|x| x.into());
self
}
pub fn set_differential_base<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.differential_base = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.differential_base = v.map(|x| x.into());
self
}
pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.export_log_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.export_log_start_time = v.map(|x| x.into());
self
}
pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.export_log_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.export_log_end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlBakExportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlTdeExportOptions {
pub certificate_path: std::string::String,
pub private_key_path: std::string::String,
pub private_key_password: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlTdeExportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.certificate_path = v.into();
self
}
pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.private_key_path = v.into();
self
}
pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.private_key_password = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for SqlTdeExportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportContext {
pub uri: std::string::String,
pub database: std::string::String,
pub kind: std::string::String,
pub file_type: crate::model::SqlFileType,
pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
pub import_user: std::string::String,
pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
self.file_type = v.into();
self
}
pub fn set_csv_import_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
{
self.csv_import_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
{
self.csv_import_options = v.map(|x| x.into());
self
}
pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.import_user = v.into();
self
}
pub fn set_bak_import_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
{
self.bak_import_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
{
self.bak_import_options = v.map(|x| x.into());
self
}
pub fn set_sql_import_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
{
self.sql_import_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
{
self.sql_import_options = v.map(|x| x.into());
self
}
pub fn set_tde_import_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
{
self.tde_import_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
{
self.tde_import_options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ImportContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext"
}
}
pub mod import_context {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlImportOptions {
pub threads: std::option::Option<wkt::Int32Value>,
pub parallel: std::option::Option<wkt::BoolValue>,
pub postgres_import_options: std::option::Option<
crate::model::import_context::sql_import_options::PostgresImportOptions,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlImportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_threads<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.threads = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.threads = v.map(|x| x.into());
self
}
pub fn set_parallel<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.parallel = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.parallel = v.map(|x| x.into());
self
}
pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::import_context::sql_import_options::PostgresImportOptions,
>,
{
self.postgres_import_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::import_context::sql_import_options::PostgresImportOptions,
>,
{
self.postgres_import_options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlImportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
}
}
pub mod sql_import_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostgresImportOptions {
pub clean: std::option::Option<wkt::BoolValue>,
pub if_exists: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostgresImportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_clean<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.clean = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.clean = v.map(|x| x.into());
self
}
pub fn set_if_exists<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.if_exists = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.if_exists = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PostgresImportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlCsvImportOptions {
pub table: std::string::String,
pub columns: std::vec::Vec<std::string::String>,
pub escape_character: std::string::String,
pub quote_character: std::string::String,
pub fields_terminated_by: std::string::String,
pub lines_terminated_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlCsvImportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table = v.into();
self
}
pub fn set_columns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.escape_character = v.into();
self
}
pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.quote_character = v.into();
self
}
pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.fields_terminated_by = v.into();
self
}
pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.lines_terminated_by = v.into();
self
}
}
impl wkt::message::Message for SqlCsvImportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlBakImportOptions {
pub encryption_options: std::option::Option<
crate::model::import_context::sql_bak_import_options::EncryptionOptions,
>,
pub striped: std::option::Option<wkt::BoolValue>,
pub no_recovery: std::option::Option<wkt::BoolValue>,
pub recovery_only: std::option::Option<wkt::BoolValue>,
pub bak_type: crate::model::BakType,
pub stop_at: std::option::Option<wkt::Timestamp>,
pub stop_at_mark: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlBakImportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encryption_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::import_context::sql_bak_import_options::EncryptionOptions,
>,
{
self.encryption_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::import_context::sql_bak_import_options::EncryptionOptions,
>,
{
self.encryption_options = v.map(|x| x.into());
self
}
pub fn set_striped<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.striped = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.striped = v.map(|x| x.into());
self
}
pub fn set_no_recovery<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.no_recovery = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.no_recovery = v.map(|x| x.into());
self
}
pub fn set_recovery_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.recovery_only = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.recovery_only = v.map(|x| x.into());
self
}
pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
self.bak_type = v.into();
self
}
pub fn set_stop_at<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.stop_at = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.stop_at = v.map(|x| x.into());
self
}
pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.stop_at_mark = v.into();
self
}
}
impl wkt::message::Message for SqlBakImportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
}
}
pub mod sql_bak_import_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionOptions {
pub cert_path: std::string::String,
pub pvk_path: std::string::String,
pub pvk_password: std::string::String,
pub keep_encrypted: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cert_path = v.into();
self
}
pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.pvk_path = v.into();
self
}
pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.pvk_password = v.into();
self
}
pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.keep_encrypted = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.keep_encrypted = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EncryptionOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlTdeImportOptions {
pub certificate_path: std::string::String,
pub private_key_path: std::string::String,
pub private_key_password: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlTdeImportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.certificate_path = v.into();
self
}
pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.private_key_path = v.into();
self
}
pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.private_key_password = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for SqlTdeImportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IpConfiguration {
pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
pub private_network: std::string::String,
pub require_ssl: std::option::Option<wkt::BoolValue>,
pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
pub allocated_ip_range: std::string::String,
pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
pub ssl_mode: crate::model::ip_configuration::SslMode,
pub psc_config: std::option::Option<crate::model::PscConfig>,
pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
pub server_ca_pool: std::option::Option<std::string::String>,
pub server_certificate_rotation_mode:
std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IpConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.ipv4_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.ipv4_enabled = v.map(|x| x.into());
self
}
pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.private_network = v.into();
self
}
pub fn set_require_ssl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.require_ssl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.require_ssl = v.map(|x| x.into());
self
}
pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AclEntry>,
{
use std::iter::Iterator;
self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.allocated_ip_range = v.into();
self
}
pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
self
}
pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
mut self,
v: T,
) -> Self {
self.ssl_mode = v.into();
self
}
pub fn set_psc_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PscConfig>,
{
self.psc_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PscConfig>,
{
self.psc_config = v.map(|x| x.into());
self
}
pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ip_configuration::CaMode>,
{
self.server_ca_mode = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ip_configuration::CaMode>,
{
self.server_ca_mode = v.map(|x| x.into());
self
}
pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.server_ca_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.server_ca_pool = v.map(|x| x.into());
self
}
pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
{
self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_server_certificate_rotation_mode<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
{
self.server_certificate_rotation_mode = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IpConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
}
}
pub mod ip_configuration {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SslMode {
Unspecified,
AllowUnencryptedAndEncrypted,
EncryptedOnly,
TrustedClientCertificateRequired,
UnknownValue(ssl_mode::UnknownValue),
}
#[doc(hidden)]
pub mod ssl_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SslMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
Self::EncryptedOnly => std::option::Option::Some(2),
Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
Self::AllowUnencryptedAndEncrypted => {
std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
}
Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
Self::TrustedClientCertificateRequired => {
std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SslMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SslMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SslMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AllowUnencryptedAndEncrypted,
2 => Self::EncryptedOnly,
3 => Self::TrustedClientCertificateRequired,
_ => Self::UnknownValue(ssl_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SslMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SSL_MODE_UNSPECIFIED" => Self::Unspecified,
"ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
"ENCRYPTED_ONLY" => Self::EncryptedOnly,
"TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
_ => Self::UnknownValue(ssl_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SslMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
Self::EncryptedOnly => serializer.serialize_i32(2),
Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SslMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
".google.cloud.sql.v1.IpConfiguration.SslMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CaMode {
Unspecified,
GoogleManagedInternalCa,
GoogleManagedCasCa,
CustomerManagedCasCa,
UnknownValue(ca_mode::UnknownValue),
}
#[doc(hidden)]
pub mod ca_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CaMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GoogleManagedInternalCa => std::option::Option::Some(1),
Self::GoogleManagedCasCa => std::option::Option::Some(2),
Self::CustomerManagedCasCa => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
Self::GoogleManagedInternalCa => {
std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
}
Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CaMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CaMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CaMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GoogleManagedInternalCa,
2 => Self::GoogleManagedCasCa,
3 => Self::CustomerManagedCasCa,
_ => Self::UnknownValue(ca_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CaMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CA_MODE_UNSPECIFIED" => Self::Unspecified,
"GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
"GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
"CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
_ => Self::UnknownValue(ca_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CaMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
Self::GoogleManagedCasCa => serializer.serialize_i32(2),
Self::CustomerManagedCasCa => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CaMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
".google.cloud.sql.v1.IpConfiguration.CaMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServerCertificateRotationMode {
Unspecified,
NoAutomaticRotation,
AutomaticRotationDuringMaintenance,
UnknownValue(server_certificate_rotation_mode::UnknownValue),
}
#[doc(hidden)]
pub mod server_certificate_rotation_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ServerCertificateRotationMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NoAutomaticRotation => std::option::Option::Some(1),
Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
}
Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
Self::AutomaticRotationDuringMaintenance => {
std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ServerCertificateRotationMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ServerCertificateRotationMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ServerCertificateRotationMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NoAutomaticRotation,
2 => Self::AutomaticRotationDuringMaintenance,
_ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ServerCertificateRotationMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
"NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
"AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
_ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ServerCertificateRotationMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NoAutomaticRotation => serializer.serialize_i32(1),
Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PscConfig {
pub psc_enabled: std::option::Option<bool>,
pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
pub network_attachment_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PscConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_psc_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.psc_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.psc_enabled = v.map(|x| x.into());
self
}
pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
{
use std::iter::Iterator;
self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.network_attachment_uri = v.into();
self
}
}
impl wkt::message::Message for PscConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PscConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PscAutoConnectionConfig {
pub consumer_project: std::string::String,
pub consumer_network: std::string::String,
pub ip_address: std::option::Option<std::string::String>,
pub status: std::option::Option<std::string::String>,
pub consumer_network_status: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PscAutoConnectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consumer_project = v.into();
self
}
pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consumer_network = v.into();
self
}
pub fn set_ip_address<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ip_address = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ip_address = v.map(|x| x.into());
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.consumer_network_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.consumer_network_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PscAutoConnectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationPreference {
#[deprecated]
pub follow_gae_application: std::string::String,
pub zone: std::string::String,
pub secondary_zone: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocationPreference {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.follow_gae_application = v.into();
self
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.secondary_zone = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for LocationPreference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.LocationPreference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MaintenanceWindow {
pub hour: std::option::Option<wkt::Int32Value>,
pub day: std::option::Option<wkt::Int32Value>,
pub update_track: crate::model::SqlUpdateTrack,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MaintenanceWindow {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hour<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.hour = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.hour = v.map(|x| x.into());
self
}
pub fn set_day<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.day = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.day = v.map(|x| x.into());
self
}
pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
mut self,
v: T,
) -> Self {
self.update_track = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for MaintenanceWindow {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DenyMaintenancePeriod {
pub start_date: std::string::String,
pub end_date: std::string::String,
pub time: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DenyMaintenancePeriod {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.start_date = v.into();
self
}
pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.end_date = v.into();
self
}
pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time = v.into();
self
}
}
impl wkt::message::Message for DenyMaintenancePeriod {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InsightsConfig {
pub query_insights_enabled: bool,
pub record_client_address: bool,
pub record_application_tags: bool,
pub query_string_length: std::option::Option<wkt::Int32Value>,
pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InsightsConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.query_insights_enabled = v.into();
self
}
pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.record_client_address = v.into();
self
}
pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.record_application_tags = v.into();
self
}
pub fn set_query_string_length<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.query_string_length = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.query_string_length = v.map(|x| x.into());
self
}
pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.query_plans_per_minute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.query_plans_per_minute = v.map(|x| x.into());
self
}
pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enhanced_query_insights_enabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enhanced_query_insights_enabled = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InsightsConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MySqlReplicaConfiguration {
pub dump_file_path: std::string::String,
pub username: std::string::String,
pub password: std::string::String,
pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
pub ca_certificate: std::string::String,
pub client_certificate: std::string::String,
pub client_key: std::string::String,
pub ssl_cipher: std::string::String,
pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MySqlReplicaConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dump_file_path = v.into();
self
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.password = v.into();
self
}
pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.connect_retry_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.connect_retry_interval = v.map(|x| x.into());
self
}
pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.master_heartbeat_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.master_heartbeat_period = v.map(|x| x.into());
self
}
pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ca_certificate = v.into();
self
}
pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.client_certificate = v.into();
self
}
pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_key = v.into();
self
}
pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ssl_cipher = v.into();
self
}
pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.verify_server_certificate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.verify_server_certificate = v.map(|x| x.into());
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for MySqlReplicaConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskEncryptionConfiguration {
pub kms_key_name: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskEncryptionConfiguration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_name = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for DiskEncryptionConfiguration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskEncryptionStatus {
pub kms_key_version_name: std::string::String,
pub kind: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskEncryptionStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.kms_key_version_name = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
}
impl wkt::message::Message for DiskEncryptionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IpMapping {
pub r#type: crate::model::SqlIpAddressType,
pub ip_address: std::string::String,
pub time_to_retire: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IpMapping {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_address = v.into();
self
}
pub fn set_time_to_retire<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.time_to_retire = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.time_to_retire = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IpMapping {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.IpMapping"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlSubOperationType {
pub sub_operation_details:
std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlSubOperationType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sub_operation_details<
T: std::convert::Into<
std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
>,
>(
mut self,
v: T,
) -> Self {
self.sub_operation_details = v.into();
self
}
pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
#[allow(unreachable_patterns)]
self.sub_operation_details.as_ref().and_then(|v| match v {
crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
mut self,
v: T,
) -> Self {
self.sub_operation_details = std::option::Option::Some(
crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
);
self
}
}
impl wkt::message::Message for SqlSubOperationType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
}
}
pub mod sql_sub_operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SubOperationDetails {
MaintenanceType(crate::model::SqlMaintenanceType),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Operation {
pub kind: std::string::String,
pub target_link: std::string::String,
pub status: crate::model::operation::SqlOperationStatus,
pub user: std::string::String,
pub insert_time: std::option::Option<wkt::Timestamp>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub error: std::option::Option<crate::model::OperationErrors>,
pub api_warning: std::option::Option<crate::model::ApiWarning>,
pub operation_type: crate::model::operation::SqlOperationType,
pub import_context: std::option::Option<crate::model::ImportContext>,
pub export_context: std::option::Option<crate::model::ExportContext>,
pub backup_context: std::option::Option<crate::model::BackupContext>,
pub pre_check_major_version_upgrade_context:
std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
pub name: std::string::String,
pub target_id: std::string::String,
pub self_link: std::string::String,
pub target_project: std::string::String,
pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Operation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_link = v.into();
self
}
pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
mut self,
v: T,
) -> Self {
self.status = v.into();
self
}
pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user = v.into();
self
}
pub fn set_insert_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.insert_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.insert_time = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationErrors>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationErrors>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_api_warning<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApiWarning>,
{
self.api_warning = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApiWarning>,
{
self.api_warning = v.map(|x| x.into());
self
}
pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
mut self,
v: T,
) -> Self {
self.operation_type = v.into();
self
}
pub fn set_import_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImportContext>,
{
self.import_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImportContext>,
{
self.import_context = v.map(|x| x.into());
self
}
pub fn set_export_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExportContext>,
{
self.export_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExportContext>,
{
self.export_context = v.map(|x| x.into());
self
}
pub fn set_backup_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupContext>,
{
self.backup_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupContext>,
{
self.backup_context = v.map(|x| x.into());
self
}
pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
{
self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
{
self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_project = v.into();
self
}
pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
{
self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
{
self.acquire_ssrs_lease_context = v.map(|x| x.into());
self
}
pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlSubOperationType>,
{
self.sub_operation_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlSubOperationType>,
{
self.sub_operation_type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Operation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Operation"
}
}
pub mod operation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlOperationType {
Unspecified,
Import,
Export,
Create,
Update,
Delete,
Restart,
#[deprecated]
Backup,
#[deprecated]
Snapshot,
BackupVolume,
DeleteVolume,
RestoreVolume,
InjectUser,
Clone,
StopReplica,
StartReplica,
PromoteReplica,
CreateReplica,
CreateUser,
DeleteUser,
UpdateUser,
CreateDatabase,
DeleteDatabase,
UpdateDatabase,
Failover,
DeleteBackup,
RecreateReplica,
TruncateLog,
DemoteMaster,
Maintenance,
#[deprecated]
EnablePrivateIp,
#[deprecated]
DeferMaintenance,
#[deprecated]
CreateClone,
RescheduleMaintenance,
StartExternalSync,
LogCleanup,
AutoRestart,
Reencrypt,
Switchover,
UpdateBackup,
AcquireSsrsLease,
ReleaseSsrsLease,
ReconfigureOldPrimary,
#[deprecated]
ClusterMaintenance,
#[deprecated]
SelfServiceMaintenance,
SwitchoverToReplica,
MajorVersionUpgrade,
#[deprecated]
AdvancedBackup,
ManageBackup,
EnhancedBackup,
RepairReadPool,
CreateReadPool,
UnknownValue(sql_operation_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlOperationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Import => std::option::Option::Some(1),
Self::Export => std::option::Option::Some(2),
Self::Create => std::option::Option::Some(3),
Self::Update => std::option::Option::Some(4),
Self::Delete => std::option::Option::Some(5),
Self::Restart => std::option::Option::Some(6),
Self::Backup => std::option::Option::Some(7),
Self::Snapshot => std::option::Option::Some(8),
Self::BackupVolume => std::option::Option::Some(9),
Self::DeleteVolume => std::option::Option::Some(10),
Self::RestoreVolume => std::option::Option::Some(11),
Self::InjectUser => std::option::Option::Some(12),
Self::Clone => std::option::Option::Some(14),
Self::StopReplica => std::option::Option::Some(15),
Self::StartReplica => std::option::Option::Some(16),
Self::PromoteReplica => std::option::Option::Some(17),
Self::CreateReplica => std::option::Option::Some(18),
Self::CreateUser => std::option::Option::Some(19),
Self::DeleteUser => std::option::Option::Some(20),
Self::UpdateUser => std::option::Option::Some(21),
Self::CreateDatabase => std::option::Option::Some(22),
Self::DeleteDatabase => std::option::Option::Some(23),
Self::UpdateDatabase => std::option::Option::Some(24),
Self::Failover => std::option::Option::Some(25),
Self::DeleteBackup => std::option::Option::Some(26),
Self::RecreateReplica => std::option::Option::Some(27),
Self::TruncateLog => std::option::Option::Some(28),
Self::DemoteMaster => std::option::Option::Some(29),
Self::Maintenance => std::option::Option::Some(30),
Self::EnablePrivateIp => std::option::Option::Some(31),
Self::DeferMaintenance => std::option::Option::Some(32),
Self::CreateClone => std::option::Option::Some(33),
Self::RescheduleMaintenance => std::option::Option::Some(34),
Self::StartExternalSync => std::option::Option::Some(35),
Self::LogCleanup => std::option::Option::Some(36),
Self::AutoRestart => std::option::Option::Some(37),
Self::Reencrypt => std::option::Option::Some(38),
Self::Switchover => std::option::Option::Some(39),
Self::UpdateBackup => std::option::Option::Some(40),
Self::AcquireSsrsLease => std::option::Option::Some(42),
Self::ReleaseSsrsLease => std::option::Option::Some(43),
Self::ReconfigureOldPrimary => std::option::Option::Some(44),
Self::ClusterMaintenance => std::option::Option::Some(45),
Self::SelfServiceMaintenance => std::option::Option::Some(46),
Self::SwitchoverToReplica => std::option::Option::Some(47),
Self::MajorVersionUpgrade => std::option::Option::Some(48),
Self::AdvancedBackup => std::option::Option::Some(49),
Self::ManageBackup => std::option::Option::Some(50),
Self::EnhancedBackup => std::option::Option::Some(51),
Self::RepairReadPool => std::option::Option::Some(52),
Self::CreateReadPool => std::option::Option::Some(53),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
Self::Import => std::option::Option::Some("IMPORT"),
Self::Export => std::option::Option::Some("EXPORT"),
Self::Create => std::option::Option::Some("CREATE"),
Self::Update => std::option::Option::Some("UPDATE"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::Restart => std::option::Option::Some("RESTART"),
Self::Backup => std::option::Option::Some("BACKUP"),
Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
Self::InjectUser => std::option::Option::Some("INJECT_USER"),
Self::Clone => std::option::Option::Some("CLONE"),
Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
Self::StartReplica => std::option::Option::Some("START_REPLICA"),
Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
Self::CreateUser => std::option::Option::Some("CREATE_USER"),
Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
Self::Failover => std::option::Option::Some("FAILOVER"),
Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
Self::Switchover => std::option::Option::Some("SWITCHOVER"),
Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
Self::SelfServiceMaintenance => {
std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
}
Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlOperationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlOperationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlOperationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Import,
2 => Self::Export,
3 => Self::Create,
4 => Self::Update,
5 => Self::Delete,
6 => Self::Restart,
7 => Self::Backup,
8 => Self::Snapshot,
9 => Self::BackupVolume,
10 => Self::DeleteVolume,
11 => Self::RestoreVolume,
12 => Self::InjectUser,
14 => Self::Clone,
15 => Self::StopReplica,
16 => Self::StartReplica,
17 => Self::PromoteReplica,
18 => Self::CreateReplica,
19 => Self::CreateUser,
20 => Self::DeleteUser,
21 => Self::UpdateUser,
22 => Self::CreateDatabase,
23 => Self::DeleteDatabase,
24 => Self::UpdateDatabase,
25 => Self::Failover,
26 => Self::DeleteBackup,
27 => Self::RecreateReplica,
28 => Self::TruncateLog,
29 => Self::DemoteMaster,
30 => Self::Maintenance,
31 => Self::EnablePrivateIp,
32 => Self::DeferMaintenance,
33 => Self::CreateClone,
34 => Self::RescheduleMaintenance,
35 => Self::StartExternalSync,
36 => Self::LogCleanup,
37 => Self::AutoRestart,
38 => Self::Reencrypt,
39 => Self::Switchover,
40 => Self::UpdateBackup,
42 => Self::AcquireSsrsLease,
43 => Self::ReleaseSsrsLease,
44 => Self::ReconfigureOldPrimary,
45 => Self::ClusterMaintenance,
46 => Self::SelfServiceMaintenance,
47 => Self::SwitchoverToReplica,
48 => Self::MajorVersionUpgrade,
49 => Self::AdvancedBackup,
50 => Self::ManageBackup,
51 => Self::EnhancedBackup,
52 => Self::RepairReadPool,
53 => Self::CreateReadPool,
_ => Self::UnknownValue(sql_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlOperationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"IMPORT" => Self::Import,
"EXPORT" => Self::Export,
"CREATE" => Self::Create,
"UPDATE" => Self::Update,
"DELETE" => Self::Delete,
"RESTART" => Self::Restart,
"BACKUP" => Self::Backup,
"SNAPSHOT" => Self::Snapshot,
"BACKUP_VOLUME" => Self::BackupVolume,
"DELETE_VOLUME" => Self::DeleteVolume,
"RESTORE_VOLUME" => Self::RestoreVolume,
"INJECT_USER" => Self::InjectUser,
"CLONE" => Self::Clone,
"STOP_REPLICA" => Self::StopReplica,
"START_REPLICA" => Self::StartReplica,
"PROMOTE_REPLICA" => Self::PromoteReplica,
"CREATE_REPLICA" => Self::CreateReplica,
"CREATE_USER" => Self::CreateUser,
"DELETE_USER" => Self::DeleteUser,
"UPDATE_USER" => Self::UpdateUser,
"CREATE_DATABASE" => Self::CreateDatabase,
"DELETE_DATABASE" => Self::DeleteDatabase,
"UPDATE_DATABASE" => Self::UpdateDatabase,
"FAILOVER" => Self::Failover,
"DELETE_BACKUP" => Self::DeleteBackup,
"RECREATE_REPLICA" => Self::RecreateReplica,
"TRUNCATE_LOG" => Self::TruncateLog,
"DEMOTE_MASTER" => Self::DemoteMaster,
"MAINTENANCE" => Self::Maintenance,
"ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
"DEFER_MAINTENANCE" => Self::DeferMaintenance,
"CREATE_CLONE" => Self::CreateClone,
"RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
"START_EXTERNAL_SYNC" => Self::StartExternalSync,
"LOG_CLEANUP" => Self::LogCleanup,
"AUTO_RESTART" => Self::AutoRestart,
"REENCRYPT" => Self::Reencrypt,
"SWITCHOVER" => Self::Switchover,
"UPDATE_BACKUP" => Self::UpdateBackup,
"ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
"RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
"RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
"CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
"SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
"SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
"MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
"ADVANCED_BACKUP" => Self::AdvancedBackup,
"MANAGE_BACKUP" => Self::ManageBackup,
"ENHANCED_BACKUP" => Self::EnhancedBackup,
"REPAIR_READ_POOL" => Self::RepairReadPool,
"CREATE_READ_POOL" => Self::CreateReadPool,
_ => Self::UnknownValue(sql_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlOperationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Import => serializer.serialize_i32(1),
Self::Export => serializer.serialize_i32(2),
Self::Create => serializer.serialize_i32(3),
Self::Update => serializer.serialize_i32(4),
Self::Delete => serializer.serialize_i32(5),
Self::Restart => serializer.serialize_i32(6),
Self::Backup => serializer.serialize_i32(7),
Self::Snapshot => serializer.serialize_i32(8),
Self::BackupVolume => serializer.serialize_i32(9),
Self::DeleteVolume => serializer.serialize_i32(10),
Self::RestoreVolume => serializer.serialize_i32(11),
Self::InjectUser => serializer.serialize_i32(12),
Self::Clone => serializer.serialize_i32(14),
Self::StopReplica => serializer.serialize_i32(15),
Self::StartReplica => serializer.serialize_i32(16),
Self::PromoteReplica => serializer.serialize_i32(17),
Self::CreateReplica => serializer.serialize_i32(18),
Self::CreateUser => serializer.serialize_i32(19),
Self::DeleteUser => serializer.serialize_i32(20),
Self::UpdateUser => serializer.serialize_i32(21),
Self::CreateDatabase => serializer.serialize_i32(22),
Self::DeleteDatabase => serializer.serialize_i32(23),
Self::UpdateDatabase => serializer.serialize_i32(24),
Self::Failover => serializer.serialize_i32(25),
Self::DeleteBackup => serializer.serialize_i32(26),
Self::RecreateReplica => serializer.serialize_i32(27),
Self::TruncateLog => serializer.serialize_i32(28),
Self::DemoteMaster => serializer.serialize_i32(29),
Self::Maintenance => serializer.serialize_i32(30),
Self::EnablePrivateIp => serializer.serialize_i32(31),
Self::DeferMaintenance => serializer.serialize_i32(32),
Self::CreateClone => serializer.serialize_i32(33),
Self::RescheduleMaintenance => serializer.serialize_i32(34),
Self::StartExternalSync => serializer.serialize_i32(35),
Self::LogCleanup => serializer.serialize_i32(36),
Self::AutoRestart => serializer.serialize_i32(37),
Self::Reencrypt => serializer.serialize_i32(38),
Self::Switchover => serializer.serialize_i32(39),
Self::UpdateBackup => serializer.serialize_i32(40),
Self::AcquireSsrsLease => serializer.serialize_i32(42),
Self::ReleaseSsrsLease => serializer.serialize_i32(43),
Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
Self::ClusterMaintenance => serializer.serialize_i32(45),
Self::SelfServiceMaintenance => serializer.serialize_i32(46),
Self::SwitchoverToReplica => serializer.serialize_i32(47),
Self::MajorVersionUpgrade => serializer.serialize_i32(48),
Self::AdvancedBackup => serializer.serialize_i32(49),
Self::ManageBackup => serializer.serialize_i32(50),
Self::EnhancedBackup => serializer.serialize_i32(51),
Self::RepairReadPool => serializer.serialize_i32(52),
Self::CreateReadPool => serializer.serialize_i32(53),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
".google.cloud.sql.v1.Operation.SqlOperationType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlOperationStatus {
Unspecified,
Pending,
Running,
Done,
UnknownValue(sql_operation_status::UnknownValue),
}
#[doc(hidden)]
pub mod sql_operation_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlOperationStatus {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Done => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Done => std::option::Option::Some("DONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlOperationStatus {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlOperationStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlOperationStatus {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Done,
_ => Self::UnknownValue(sql_operation_status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlOperationStatus {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"DONE" => Self::Done,
_ => Self::UnknownValue(sql_operation_status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlOperationStatus {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Done => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
".google.cloud.sql.v1.Operation.SqlOperationStatus",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationError {
pub kind: std::string::String,
pub code: std::string::String,
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.code = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for OperationError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.OperationError"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationErrors {
pub kind: std::string::String,
pub errors: std::vec::Vec<crate::model::OperationError>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationErrors {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OperationError>,
{
use std::iter::Iterator;
self.errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for OperationErrors {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.OperationErrors"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PasswordValidationPolicy {
pub min_length: std::option::Option<wkt::Int32Value>,
pub complexity: crate::model::password_validation_policy::Complexity,
pub reuse_interval: std::option::Option<wkt::Int32Value>,
pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
pub password_change_interval: std::option::Option<wkt::Duration>,
pub enable_password_policy: std::option::Option<wkt::BoolValue>,
#[deprecated]
pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PasswordValidationPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_length<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.min_length = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.min_length = v.map(|x| x.into());
self
}
pub fn set_complexity<
T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
>(
mut self,
v: T,
) -> Self {
self.complexity = v.into();
self
}
pub fn set_reuse_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.reuse_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.reuse_interval = v.map(|x| x.into());
self
}
pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.disallow_username_substring = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.disallow_username_substring = v.map(|x| x.into());
self
}
pub fn set_password_change_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.password_change_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.password_change_interval = v.map(|x| x.into());
self
}
pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_password_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_password_policy = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.disallow_compromised_credentials = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_disallow_compromised_credentials<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.disallow_compromised_credentials = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PasswordValidationPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
}
}
pub mod password_validation_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Complexity {
Unspecified,
Default,
UnknownValue(complexity::UnknownValue),
}
#[doc(hidden)]
pub mod complexity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Complexity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Complexity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Complexity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Complexity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
_ => Self::UnknownValue(complexity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Complexity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
"COMPLEXITY_DEFAULT" => Self::Default,
_ => Self::UnknownValue(complexity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Complexity {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Default => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Complexity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataCacheConfig {
pub data_cache_enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataCacheConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.data_cache_enabled = v.into();
self
}
}
impl wkt::message::Message for DataCacheConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FinalBackupConfig {
pub enabled: std::option::Option<bool>,
pub retention_days: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FinalBackupConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = v.map(|x| x.into());
self
}
pub fn set_retention_days<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.retention_days = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.retention_days = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FinalBackupConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Settings {
pub settings_version: std::option::Option<wkt::Int64Value>,
#[deprecated]
pub authorized_gae_applications: std::vec::Vec<std::string::String>,
pub tier: std::string::String,
pub kind: std::string::String,
pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub availability_type: crate::model::SqlAvailabilityType,
pub pricing_plan: crate::model::SqlPricingPlan,
#[deprecated]
pub replication_type: crate::model::SqlReplicationType,
pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
pub activation_policy: crate::model::settings::SqlActivationPolicy,
pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
pub location_preference: std::option::Option<crate::model::LocationPreference>,
pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
pub data_disk_type: crate::model::SqlDataDiskType,
pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
#[deprecated]
pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
pub collation: std::string::String,
pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
pub insights_config: std::option::Option<crate::model::InsightsConfig>,
pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
pub edition: crate::model::settings::Edition,
pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
pub time_zone: std::string::String,
pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
pub data_disk_provisioned_iops: std::option::Option<i64>,
pub data_disk_provisioned_throughput: std::option::Option<i64>,
pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
pub auto_upgrade_enabled: std::option::Option<bool>,
pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Settings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_settings_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.settings_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.settings_version = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tier = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
mut self,
v: T,
) -> Self {
self.availability_type = v.into();
self
}
pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
mut self,
v: T,
) -> Self {
self.pricing_plan = v.into();
self
}
#[deprecated]
pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
mut self,
v: T,
) -> Self {
self.replication_type = v.into();
self
}
pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.storage_auto_resize_limit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.storage_auto_resize_limit = v.map(|x| x.into());
self
}
pub fn set_activation_policy<
T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
>(
mut self,
v: T,
) -> Self {
self.activation_policy = v.into();
self
}
pub fn set_ip_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::IpConfiguration>,
{
self.ip_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::IpConfiguration>,
{
self.ip_configuration = v.map(|x| x.into());
self
}
pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.storage_auto_resize = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.storage_auto_resize = v.map(|x| x.into());
self
}
pub fn set_location_preference<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LocationPreference>,
{
self.location_preference = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LocationPreference>,
{
self.location_preference = v.map(|x| x.into());
self
}
pub fn set_database_flags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DatabaseFlags>,
{
use std::iter::Iterator;
self.database_flags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
mut self,
v: T,
) -> Self {
self.data_disk_type = v.into();
self
}
pub fn set_maintenance_window<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MaintenanceWindow>,
{
self.maintenance_window = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MaintenanceWindow>,
{
self.maintenance_window = v.map(|x| x.into());
self
}
pub fn set_backup_configuration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupConfiguration>,
{
self.backup_configuration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupConfiguration>,
{
self.backup_configuration = v.map(|x| x.into());
self
}
pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.database_replication_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.database_replication_enabled = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_crash_safe_replication_enabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.crash_safe_replication_enabled = v.map(|x| x.into());
self
}
pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_disk_size_gb = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int64Value>,
{
self.data_disk_size_gb = v.map(|x| x.into());
self
}
pub fn set_active_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
{
self.active_directory_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
{
self.active_directory_config = v.map(|x| x.into());
self
}
pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.collation = v.into();
self
}
pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
{
use std::iter::Iterator;
self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_insights_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InsightsConfig>,
{
self.insights_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InsightsConfig>,
{
self.insights_config = v.map(|x| x.into());
self
}
pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PasswordValidationPolicy>,
{
self.password_validation_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PasswordValidationPolicy>,
{
self.password_validation_policy = v.map(|x| x.into());
self
}
pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlServerAuditConfig>,
{
self.sql_server_audit_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlServerAuditConfig>,
{
self.sql_server_audit_config = v.map(|x| x.into());
self
}
pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
mut self,
v: T,
) -> Self {
self.edition = v.into();
self
}
pub fn set_connector_enforcement<
T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
>(
mut self,
v: T,
) -> Self {
self.connector_enforcement = v.into();
self
}
pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.deletion_protection_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.deletion_protection_enabled = v.map(|x| x.into());
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
{
self.advanced_machine_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
{
self.advanced_machine_features = v.map(|x| x.into());
self
}
pub fn set_data_cache_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataCacheConfig>,
{
self.data_cache_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataCacheConfig>,
{
self.data_cache_config = v.map(|x| x.into());
self
}
pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.replication_lag_max_seconds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.replication_lag_max_seconds = v.map(|x| x.into());
self
}
pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_google_ml_integration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_google_ml_integration = v.map(|x| x.into());
self
}
pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_dataplex_integration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_dataplex_integration = v.map(|x| x.into());
self
}
pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.retain_backups_on_delete = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.retain_backups_on_delete = v.map(|x| x.into());
self
}
pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.data_disk_provisioned_iops = v.map(|x| x.into());
self
}
pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_disk_provisioned_throughput<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i64>,
{
self.data_disk_provisioned_throughput = v.map(|x| x.into());
self
}
pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConnectionPoolConfig>,
{
self.connection_pool_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConnectionPoolConfig>,
{
self.connection_pool_config = v.map(|x| x.into());
self
}
pub fn set_final_backup_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FinalBackupConfig>,
{
self.final_backup_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FinalBackupConfig>,
{
self.final_backup_config = v.map(|x| x.into());
self
}
pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
{
self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
{
self.read_pool_auto_scale_config = v.map(|x| x.into());
self
}
pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.auto_upgrade_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.auto_upgrade_enabled = v.map(|x| x.into());
self
}
pub fn set_entraid_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
{
self.entraid_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
{
self.entraid_config = v.map(|x| x.into());
self
}
pub fn set_data_api_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::settings::DataApiAccess>,
{
self.data_api_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::settings::DataApiAccess>,
{
self.data_api_access = v.map(|x| x.into());
self
}
pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
{
self.performance_capture_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
{
self.performance_capture_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Settings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Settings"
}
}
pub mod settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlActivationPolicy {
Unspecified,
Always,
Never,
#[deprecated]
OnDemand,
UnknownValue(sql_activation_policy::UnknownValue),
}
#[doc(hidden)]
pub mod sql_activation_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlActivationPolicy {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Always => std::option::Option::Some(1),
Self::Never => std::option::Option::Some(2),
Self::OnDemand => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
Self::Always => std::option::Option::Some("ALWAYS"),
Self::Never => std::option::Option::Some("NEVER"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlActivationPolicy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlActivationPolicy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlActivationPolicy {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Always,
2 => Self::Never,
3 => Self::OnDemand,
_ => Self::UnknownValue(sql_activation_policy::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlActivationPolicy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
"ALWAYS" => Self::Always,
"NEVER" => Self::Never,
"ON_DEMAND" => Self::OnDemand,
_ => Self::UnknownValue(sql_activation_policy::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlActivationPolicy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Always => serializer.serialize_i32(1),
Self::Never => serializer.serialize_i32(2),
Self::OnDemand => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
".google.cloud.sql.v1.Settings.SqlActivationPolicy",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Edition {
Unspecified,
Enterprise,
EnterprisePlus,
UnknownValue(edition::UnknownValue),
}
#[doc(hidden)]
pub mod edition {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Edition {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enterprise => std::option::Option::Some(2),
Self::EnterprisePlus => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Edition {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Edition {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Edition {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Enterprise,
3 => Self::EnterprisePlus,
_ => Self::UnknownValue(edition::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Edition {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EDITION_UNSPECIFIED" => Self::Unspecified,
"ENTERPRISE" => Self::Enterprise,
"ENTERPRISE_PLUS" => Self::EnterprisePlus,
_ => Self::UnknownValue(edition::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Edition {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Enterprise => serializer.serialize_i32(2),
Self::EnterprisePlus => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Edition {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
".google.cloud.sql.v1.Settings.Edition",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectorEnforcement {
Unspecified,
NotRequired,
Required,
UnknownValue(connector_enforcement::UnknownValue),
}
#[doc(hidden)]
pub mod connector_enforcement {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConnectorEnforcement {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NotRequired => std::option::Option::Some(1),
Self::Required => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
Self::Required => std::option::Option::Some("REQUIRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConnectorEnforcement {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConnectorEnforcement {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ConnectorEnforcement {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NotRequired,
2 => Self::Required,
_ => Self::UnknownValue(connector_enforcement::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConnectorEnforcement {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
"NOT_REQUIRED" => Self::NotRequired,
"REQUIRED" => Self::Required,
_ => Self::UnknownValue(connector_enforcement::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConnectorEnforcement {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NotRequired => serializer.serialize_i32(1),
Self::Required => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
".google.cloud.sql.v1.Settings.ConnectorEnforcement",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataApiAccess {
Unspecified,
DisallowDataApi,
AllowDataApi,
UnknownValue(data_api_access::UnknownValue),
}
#[doc(hidden)]
pub mod data_api_access {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataApiAccess {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DisallowDataApi => std::option::Option::Some(1),
Self::AllowDataApi => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataApiAccess {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataApiAccess {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DataApiAccess {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DisallowDataApi,
2 => Self::AllowDataApi,
_ => Self::UnknownValue(data_api_access::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataApiAccess {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
"DISALLOW_DATA_API" => Self::DisallowDataApi,
"ALLOW_DATA_API" => Self::AllowDataApi,
_ => Self::UnknownValue(data_api_access::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataApiAccess {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DisallowDataApi => serializer.serialize_i32(1),
Self::AllowDataApi => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
".google.cloud.sql.v1.Settings.DataApiAccess",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PerformanceCaptureConfig {
pub enabled: std::option::Option<bool>,
pub probing_interval_seconds: std::option::Option<i32>,
pub probe_threshold: std::option::Option<i32>,
pub running_threads_threshold: std::option::Option<i32>,
pub seconds_behind_source_threshold: std::option::Option<i32>,
pub transaction_duration_threshold: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PerformanceCaptureConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = v.map(|x| x.into());
self
}
pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.probing_interval_seconds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.probing_interval_seconds = v.map(|x| x.into());
self
}
pub fn set_probe_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.probe_threshold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.probe_threshold = v.map(|x| x.into());
self
}
pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.running_threads_threshold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.running_threads_threshold = v.map(|x| x.into());
self
}
pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_seconds_behind_source_threshold<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.seconds_behind_source_threshold = v.map(|x| x.into());
self
}
pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.transaction_duration_threshold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transaction_duration_threshold<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.transaction_duration_threshold = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PerformanceCaptureConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectionPoolFlags {
pub name: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectionPoolFlags {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for ConnectionPoolFlags {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectionPoolConfig {
pub connection_pooling_enabled: std::option::Option<bool>,
pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
pub pooler_count: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectionPoolConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.connection_pooling_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.connection_pooling_enabled = v.map(|x| x.into());
self
}
pub fn set_flags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConnectionPoolFlags>,
{
use std::iter::Iterator;
self.flags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_pooler_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.pooler_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.pooler_count = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ConnectionPoolConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReadPoolAutoScaleConfig {
pub enabled: std::option::Option<bool>,
pub min_node_count: std::option::Option<i32>,
pub max_node_count: std::option::Option<i32>,
pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
pub disable_scale_in: std::option::Option<bool>,
pub scale_in_cooldown_seconds: std::option::Option<i32>,
pub scale_out_cooldown_seconds: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReadPoolAutoScaleConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = v.map(|x| x.into());
self
}
pub fn set_min_node_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.min_node_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.min_node_count = v.map(|x| x.into());
self
}
pub fn set_max_node_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_node_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_node_count = v.map(|x| x.into());
self
}
pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
{
use std::iter::Iterator;
self.target_metrics = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.disable_scale_in = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.disable_scale_in = v.map(|x| x.into());
self
}
pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.scale_in_cooldown_seconds = v.map(|x| x.into());
self
}
pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.scale_out_cooldown_seconds = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReadPoolAutoScaleConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
}
}
pub mod read_pool_auto_scale_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetMetric {
pub metric: std::option::Option<std::string::String>,
pub target_value: std::option::Option<f32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetMetric {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metric<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.metric = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.metric = v.map(|x| x.into());
self
}
pub fn set_target_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f32>,
{
self.target_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f32>,
{
self.target_value = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TargetMetric {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvancedMachineFeatures {
pub threads_per_core: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvancedMachineFeatures {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.threads_per_core = v.into();
self
}
}
impl wkt::message::Message for AdvancedMachineFeatures {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslCert {
pub kind: std::string::String,
pub cert_serial_number: std::string::String,
pub cert: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub common_name: std::string::String,
pub expiration_time: std::option::Option<wkt::Timestamp>,
pub sha1_fingerprint: std::string::String,
pub instance: std::string::String,
pub self_link: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslCert {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cert_serial_number = v.into();
self
}
pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cert = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.common_name = v.into();
self
}
pub fn set_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiration_time = v.map(|x| x.into());
self
}
pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sha1_fingerprint = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
}
impl wkt::message::Message for SslCert {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SslCert"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslCertDetail {
pub cert_info: std::option::Option<crate::model::SslCert>,
pub cert_private_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslCertDetail {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cert_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.cert_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.cert_info = v.map(|x| x.into());
self
}
pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cert_private_key = v.into();
self
}
}
impl wkt::message::Message for SslCertDetail {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlActiveDirectoryConfig {
pub kind: std::string::String,
pub domain: std::string::String,
pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
pub dns_servers: std::vec::Vec<std::string::String>,
pub admin_credential_secret_name: std::string::String,
pub organizational_unit: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlActiveDirectoryConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.domain = v.into();
self
}
pub fn set_mode<
T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.dns_servers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.admin_credential_secret_name = v.into();
self
}
pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.organizational_unit = v.into();
self
}
}
impl wkt::message::Message for SqlActiveDirectoryConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
}
}
pub mod sql_active_directory_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ActiveDirectoryMode {
Unspecified,
ManagedActiveDirectory,
#[deprecated]
SelfManagedActiveDirectory,
CustomerManagedActiveDirectory,
UnknownValue(active_directory_mode::UnknownValue),
}
#[doc(hidden)]
pub mod active_directory_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ActiveDirectoryMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ManagedActiveDirectory => std::option::Option::Some(1),
Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
Self::ManagedActiveDirectory => {
std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
}
Self::SelfManagedActiveDirectory => {
std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
}
Self::CustomerManagedActiveDirectory => {
std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ActiveDirectoryMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ActiveDirectoryMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ActiveDirectoryMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ManagedActiveDirectory,
2 => Self::SelfManagedActiveDirectory,
3 => Self::CustomerManagedActiveDirectory,
_ => Self::UnknownValue(active_directory_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ActiveDirectoryMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
"MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
"SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
"CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
_ => Self::UnknownValue(active_directory_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ActiveDirectoryMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ManagedActiveDirectory => serializer.serialize_i32(1),
Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlServerAuditConfig {
pub kind: std::string::String,
pub bucket: std::string::String,
pub retention_interval: std::option::Option<wkt::Duration>,
pub upload_interval: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlServerAuditConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
pub fn set_retention_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_interval = v.map(|x| x.into());
self
}
pub fn set_upload_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.upload_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.upload_interval = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlServerAuditConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlServerEntraIdConfig {
pub kind: std::string::String,
pub tenant_id: std::string::String,
pub application_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlServerEntraIdConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tenant_id = v.into();
self
}
pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.application_id = v.into();
self
}
}
impl wkt::message::Message for SqlServerEntraIdConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcquireSsrsLeaseContext {
pub setup_login: std::option::Option<std::string::String>,
pub service_login: std::option::Option<std::string::String>,
pub report_database: std::option::Option<std::string::String>,
pub duration: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AcquireSsrsLeaseContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_setup_login<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.setup_login = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.setup_login = v.map(|x| x.into());
self
}
pub fn set_service_login<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.service_login = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.service_login = v.map(|x| x.into());
self
}
pub fn set_report_database<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.report_database = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.report_database = v.map(|x| x.into());
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AcquireSsrsLeaseContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DnsNameMapping {
pub name: std::string::String,
pub connection_type: crate::model::dns_name_mapping::ConnectionType,
pub dns_scope: crate::model::dns_name_mapping::DnsScope,
pub record_manager: crate::model::dns_name_mapping::RecordManager,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DnsNameMapping {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_connection_type<
T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
>(
mut self,
v: T,
) -> Self {
self.connection_type = v.into();
self
}
pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
mut self,
v: T,
) -> Self {
self.dns_scope = v.into();
self
}
pub fn set_record_manager<
T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
>(
mut self,
v: T,
) -> Self {
self.record_manager = v.into();
self
}
}
impl wkt::message::Message for DnsNameMapping {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
}
}
pub mod dns_name_mapping {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectionType {
Unspecified,
Public,
PrivateServicesAccess,
PrivateServiceConnect,
UnknownValue(connection_type::UnknownValue),
}
#[doc(hidden)]
pub mod connection_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConnectionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Public => std::option::Option::Some(1),
Self::PrivateServicesAccess => std::option::Option::Some(2),
Self::PrivateServiceConnect => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
Self::Public => std::option::Option::Some("PUBLIC"),
Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConnectionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConnectionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ConnectionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Public,
2 => Self::PrivateServicesAccess,
3 => Self::PrivateServiceConnect,
_ => Self::UnknownValue(connection_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConnectionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
"PUBLIC" => Self::Public,
"PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
"PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
_ => Self::UnknownValue(connection_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConnectionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Public => serializer.serialize_i32(1),
Self::PrivateServicesAccess => serializer.serialize_i32(2),
Self::PrivateServiceConnect => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConnectionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DnsScope {
Unspecified,
Instance,
Cluster,
UnknownValue(dns_scope::UnknownValue),
}
#[doc(hidden)]
pub mod dns_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DnsScope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Instance => std::option::Option::Some(1),
Self::Cluster => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
Self::Instance => std::option::Option::Some("INSTANCE"),
Self::Cluster => std::option::Option::Some("CLUSTER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DnsScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DnsScope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DnsScope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Instance,
2 => Self::Cluster,
_ => Self::UnknownValue(dns_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DnsScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
"INSTANCE" => Self::Instance,
"CLUSTER" => Self::Cluster,
_ => Self::UnknownValue(dns_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DnsScope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Instance => serializer.serialize_i32(1),
Self::Cluster => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DnsScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
".google.cloud.sql.v1.DnsNameMapping.DnsScope",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RecordManager {
Unspecified,
Customer,
CloudSqlAutomation,
UnknownValue(record_manager::UnknownValue),
}
#[doc(hidden)]
pub mod record_manager {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RecordManager {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Customer => std::option::Option::Some(1),
Self::CloudSqlAutomation => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
Self::Customer => std::option::Option::Some("CUSTOMER"),
Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RecordManager {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RecordManager {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RecordManager {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Customer,
2 => Self::CloudSqlAutomation,
_ => Self::UnknownValue(record_manager::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RecordManager {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
"CUSTOMER" => Self::Customer,
"CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
_ => Self::UnknownValue(record_manager::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RecordManager {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Customer => serializer.serialize_i32(1),
Self::CloudSqlAutomation => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RecordManager {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
".google.cloud.sql.v1.DnsNameMapping.RecordManager",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlSslCertsDeleteRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub sha1_fingerprint: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlSslCertsDeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sha1_fingerprint = v.into();
self
}
}
impl wkt::message::Message for SqlSslCertsDeleteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlSslCertsGetRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub sha1_fingerprint: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlSslCertsGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.sha1_fingerprint = v.into();
self
}
}
impl wkt::message::Message for SqlSslCertsGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlSslCertsInsertRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlSslCertsInsertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCertsInsertRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCertsInsertRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlSslCertsInsertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlSslCertsListRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlSslCertsListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlSslCertsListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslCertsInsertRequest {
pub common_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslCertsInsertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.common_name = v.into();
self
}
}
impl wkt::message::Message for SslCertsInsertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslCertsInsertResponse {
pub kind: std::string::String,
pub operation: std::option::Option<crate::model::Operation>,
pub server_ca_cert: std::option::Option<crate::model::SslCert>,
pub client_cert: std::option::Option<crate::model::SslCertDetail>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslCertsInsertResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_operation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Operation>,
{
self.operation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Operation>,
{
self.operation = v.map(|x| x.into());
self
}
pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.server_ca_cert = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCert>,
{
self.server_ca_cert = v.map(|x| x.into());
self
}
pub fn set_client_cert<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslCertDetail>,
{
self.client_cert = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslCertDetail>,
{
self.client_cert = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SslCertsInsertResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslCertsListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::SslCert>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslCertsListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SslCert>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SslCertsListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlTiersListRequest {
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlTiersListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlTiersListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TiersListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::Tier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TiersListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Tier>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TiersListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Tier {
pub tier: std::string::String,
pub ram: i64,
pub kind: std::string::String,
pub disk_quota: i64,
pub region: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Tier {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tier = v.into();
self
}
pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.ram = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.disk_quota = v.into();
self
}
pub fn set_region<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.region = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Tier {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.Tier"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlUsersDeleteRequest {
pub host: std::string::String,
pub instance: std::string::String,
pub name: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlUsersDeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlUsersDeleteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlUsersGetRequest {
pub instance: std::string::String,
pub name: std::string::String,
pub project: std::string::String,
pub host: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlUsersGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host = v.into();
self
}
}
impl wkt::message::Message for SqlUsersGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlUsersInsertRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub body: std::option::Option<crate::model::User>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlUsersInsertRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlUsersInsertRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlUsersListRequest {
pub instance: std::string::String,
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlUsersListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
impl wkt::message::Message for SqlUsersListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlUsersUpdateRequest {
pub host: std::string::String,
pub instance: std::string::String,
pub name: std::string::String,
pub project: std::string::String,
pub database_roles: std::vec::Vec<std::string::String>,
pub revoke_existing_roles: std::option::Option<bool>,
pub body: std::option::Option<crate::model::User>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlUsersUpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_database_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.database_roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.revoke_existing_roles = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.revoke_existing_roles = v.map(|x| x.into());
self
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SqlUsersUpdateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserPasswordValidationPolicy {
pub allowed_failed_attempts: i32,
pub password_expiration_duration: std::option::Option<wkt::Duration>,
pub enable_failed_attempts_check: bool,
pub status: std::option::Option<crate::model::PasswordStatus>,
pub enable_password_verification: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserPasswordValidationPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.allowed_failed_attempts = v.into();
self
}
pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.password_expiration_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.password_expiration_duration = v.map(|x| x.into());
self
}
pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_failed_attempts_check = v.into();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PasswordStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PasswordStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_password_verification = v.into();
self
}
}
impl wkt::message::Message for UserPasswordValidationPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PasswordStatus {
pub locked: bool,
pub password_expiration_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PasswordStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.locked = v.into();
self
}
pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.password_expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.password_expiration_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PasswordStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct User {
pub kind: std::string::String,
pub password: std::string::String,
pub etag: std::string::String,
pub name: std::string::String,
pub host: std::string::String,
pub instance: std::string::String,
pub project: std::string::String,
pub r#type: crate::model::user::SqlUserType,
pub iam_email: std::string::String,
pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
pub iam_status: std::option::Option<crate::model::user::IamStatus>,
pub database_roles: std::vec::Vec<std::string::String>,
pub user_details: std::option::Option<crate::model::user::UserDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl User {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.password = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host = v.into();
self
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.iam_email = v.into();
self
}
pub fn set_password_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
{
self.password_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
{
self.password_policy = v.map(|x| x.into());
self
}
pub fn set_dual_password_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::user::DualPasswordType>,
{
self.dual_password_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::user::DualPasswordType>,
{
self.dual_password_type = v.map(|x| x.into());
self
}
pub fn set_iam_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::user::IamStatus>,
{
self.iam_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::user::IamStatus>,
{
self.iam_status = v.map(|x| x.into());
self
}
pub fn set_database_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.database_roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_user_details<
T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
>(
mut self,
v: T,
) -> Self {
self.user_details = v.into();
self
}
pub fn sqlserver_user_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
#[allow(unreachable_patterns)]
self.user_details.as_ref().and_then(|v| match v {
crate::model::user::UserDetails::SqlserverUserDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_sqlserver_user_details<
T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
>(
mut self,
v: T,
) -> Self {
self.user_details = std::option::Option::Some(
crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
);
self
}
}
impl wkt::message::Message for User {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.User"
}
}
pub mod user {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlUserType {
BuiltIn,
CloudIamUser,
CloudIamServiceAccount,
CloudIamGroup,
CloudIamGroupUser,
CloudIamGroupServiceAccount,
EntraidUser,
UnknownValue(sql_user_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_user_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlUserType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::BuiltIn => std::option::Option::Some(0),
Self::CloudIamUser => std::option::Option::Some(1),
Self::CloudIamServiceAccount => std::option::Option::Some(2),
Self::CloudIamGroup => std::option::Option::Some(3),
Self::CloudIamGroupUser => std::option::Option::Some(4),
Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
Self::EntraidUser => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
Self::CloudIamServiceAccount => {
std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
}
Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
Self::CloudIamGroupServiceAccount => {
std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
}
Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlUserType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlUserType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlUserType {
fn from(value: i32) -> Self {
match value {
0 => Self::BuiltIn,
1 => Self::CloudIamUser,
2 => Self::CloudIamServiceAccount,
3 => Self::CloudIamGroup,
4 => Self::CloudIamGroupUser,
5 => Self::CloudIamGroupServiceAccount,
7 => Self::EntraidUser,
_ => Self::UnknownValue(sql_user_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlUserType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BUILT_IN" => Self::BuiltIn,
"CLOUD_IAM_USER" => Self::CloudIamUser,
"CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
"CLOUD_IAM_GROUP" => Self::CloudIamGroup,
"CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
"CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
"ENTRAID_USER" => Self::EntraidUser,
_ => Self::UnknownValue(sql_user_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlUserType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::BuiltIn => serializer.serialize_i32(0),
Self::CloudIamUser => serializer.serialize_i32(1),
Self::CloudIamServiceAccount => serializer.serialize_i32(2),
Self::CloudIamGroup => serializer.serialize_i32(3),
Self::CloudIamGroupUser => serializer.serialize_i32(4),
Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
Self::EntraidUser => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlUserType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
".google.cloud.sql.v1.User.SqlUserType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DualPasswordType {
Unspecified,
NoModifyDualPassword,
NoDualPassword,
DualPassword,
UnknownValue(dual_password_type::UnknownValue),
}
#[doc(hidden)]
pub mod dual_password_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DualPasswordType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NoModifyDualPassword => std::option::Option::Some(1),
Self::NoDualPassword => std::option::Option::Some(2),
Self::DualPassword => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DualPasswordType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DualPasswordType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DualPasswordType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NoModifyDualPassword,
2 => Self::NoDualPassword,
3 => Self::DualPassword,
_ => Self::UnknownValue(dual_password_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DualPasswordType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
"NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
"NO_DUAL_PASSWORD" => Self::NoDualPassword,
"DUAL_PASSWORD" => Self::DualPassword,
_ => Self::UnknownValue(dual_password_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DualPasswordType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NoModifyDualPassword => serializer.serialize_i32(1),
Self::NoDualPassword => serializer.serialize_i32(2),
Self::DualPassword => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
".google.cloud.sql.v1.User.DualPasswordType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IamStatus {
Unspecified,
Inactive,
Active,
UnknownValue(iam_status::UnknownValue),
}
#[doc(hidden)]
pub mod iam_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IamStatus {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Inactive => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
Self::Inactive => std::option::Option::Some("INACTIVE"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IamStatus {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IamStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for IamStatus {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Inactive,
2 => Self::Active,
_ => Self::UnknownValue(iam_status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IamStatus {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
"INACTIVE" => Self::Inactive,
"ACTIVE" => Self::Active,
_ => Self::UnknownValue(iam_status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IamStatus {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Inactive => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for IamStatus {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
".google.cloud.sql.v1.User.IamStatus",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UserDetails {
SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlServerUserDetails {
pub disabled: bool,
pub server_roles: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlServerUserDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
pub fn set_server_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.server_roles = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SqlServerUserDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UsersListResponse {
pub kind: std::string::String,
pub items: std::vec::Vec<crate::model::User>,
#[deprecated]
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UsersListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::User>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
#[deprecated]
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for UsersListResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlBackupRunStatus {
Unspecified,
Enqueued,
Overdue,
Running,
Failed,
Successful,
Skipped,
DeletionPending,
DeletionFailed,
Deleted,
UnknownValue(sql_backup_run_status::UnknownValue),
}
#[doc(hidden)]
pub mod sql_backup_run_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlBackupRunStatus {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enqueued => std::option::Option::Some(1),
Self::Overdue => std::option::Option::Some(2),
Self::Running => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Successful => std::option::Option::Some(5),
Self::Skipped => std::option::Option::Some(6),
Self::DeletionPending => std::option::Option::Some(7),
Self::DeletionFailed => std::option::Option::Some(8),
Self::Deleted => std::option::Option::Some(9),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
Self::Enqueued => std::option::Option::Some("ENQUEUED"),
Self::Overdue => std::option::Option::Some("OVERDUE"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Successful => std::option::Option::Some("SUCCESSFUL"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlBackupRunStatus {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlBackupRunStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlBackupRunStatus {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enqueued,
2 => Self::Overdue,
3 => Self::Running,
4 => Self::Failed,
5 => Self::Successful,
6 => Self::Skipped,
7 => Self::DeletionPending,
8 => Self::DeletionFailed,
9 => Self::Deleted,
_ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlBackupRunStatus {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
"ENQUEUED" => Self::Enqueued,
"OVERDUE" => Self::Overdue,
"RUNNING" => Self::Running,
"FAILED" => Self::Failed,
"SUCCESSFUL" => Self::Successful,
"SKIPPED" => Self::Skipped,
"DELETION_PENDING" => Self::DeletionPending,
"DELETION_FAILED" => Self::DeletionFailed,
"DELETED" => Self::Deleted,
_ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlBackupRunStatus {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Enqueued => serializer.serialize_i32(1),
Self::Overdue => serializer.serialize_i32(2),
Self::Running => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Successful => serializer.serialize_i32(5),
Self::Skipped => serializer.serialize_i32(6),
Self::DeletionPending => serializer.serialize_i32(7),
Self::DeletionFailed => serializer.serialize_i32(8),
Self::Deleted => serializer.serialize_i32(9),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
".google.cloud.sql.v1.SqlBackupRunStatus",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlBackupKind {
Unspecified,
Snapshot,
Physical,
UnknownValue(sql_backup_kind::UnknownValue),
}
#[doc(hidden)]
pub mod sql_backup_kind {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlBackupKind {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Snapshot => std::option::Option::Some(1),
Self::Physical => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
Self::Physical => std::option::Option::Some("PHYSICAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlBackupKind {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlBackupKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlBackupKind {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Snapshot,
2 => Self::Physical,
_ => Self::UnknownValue(sql_backup_kind::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlBackupKind {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
"SNAPSHOT" => Self::Snapshot,
"PHYSICAL" => Self::Physical,
_ => Self::UnknownValue(sql_backup_kind::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlBackupKind {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Snapshot => serializer.serialize_i32(1),
Self::Physical => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
".google.cloud.sql.v1.SqlBackupKind",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlBackupRunType {
Unspecified,
Automated,
OnDemand,
UnknownValue(sql_backup_run_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_backup_run_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlBackupRunType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Automated => std::option::Option::Some(1),
Self::OnDemand => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
Self::Automated => std::option::Option::Some("AUTOMATED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlBackupRunType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlBackupRunType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlBackupRunType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Automated,
2 => Self::OnDemand,
_ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlBackupRunType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
"AUTOMATED" => Self::Automated,
"ON_DEMAND" => Self::OnDemand,
_ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlBackupRunType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Automated => serializer.serialize_i32(1),
Self::OnDemand => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
".google.cloud.sql.v1.SqlBackupRunType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlFlagType {
Unspecified,
Boolean,
String,
Integer,
None,
MysqlTimezoneOffset,
Float,
RepeatedString,
UnknownValue(sql_flag_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_flag_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlFlagType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Boolean => std::option::Option::Some(1),
Self::String => std::option::Option::Some(2),
Self::Integer => std::option::Option::Some(3),
Self::None => std::option::Option::Some(4),
Self::MysqlTimezoneOffset => std::option::Option::Some(5),
Self::Float => std::option::Option::Some(6),
Self::RepeatedString => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
Self::Boolean => std::option::Option::Some("BOOLEAN"),
Self::String => std::option::Option::Some("STRING"),
Self::Integer => std::option::Option::Some("INTEGER"),
Self::None => std::option::Option::Some("NONE"),
Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
Self::Float => std::option::Option::Some("FLOAT"),
Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlFlagType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlFlagType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlFlagType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Boolean,
2 => Self::String,
3 => Self::Integer,
4 => Self::None,
5 => Self::MysqlTimezoneOffset,
6 => Self::Float,
7 => Self::RepeatedString,
_ => Self::UnknownValue(sql_flag_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlFlagType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
"BOOLEAN" => Self::Boolean,
"STRING" => Self::String,
"INTEGER" => Self::Integer,
"NONE" => Self::None,
"MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
"FLOAT" => Self::Float,
"REPEATED_STRING" => Self::RepeatedString,
_ => Self::UnknownValue(sql_flag_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlFlagType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Boolean => serializer.serialize_i32(1),
Self::String => serializer.serialize_i32(2),
Self::Integer => serializer.serialize_i32(3),
Self::None => serializer.serialize_i32(4),
Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
Self::Float => serializer.serialize_i32(6),
Self::RepeatedString => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
".google.cloud.sql.v1.SqlFlagType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlFlagScope {
Unspecified,
Database,
ConnectionPool,
UnknownValue(sql_flag_scope::UnknownValue),
}
#[doc(hidden)]
pub mod sql_flag_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlFlagScope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Database => std::option::Option::Some(1),
Self::ConnectionPool => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlFlagScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlFlagScope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlFlagScope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Database,
2 => Self::ConnectionPool,
_ => Self::UnknownValue(sql_flag_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlFlagScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
"SQL_FLAG_SCOPE_DATABASE" => Self::Database,
"SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
_ => Self::UnknownValue(sql_flag_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlFlagScope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Database => serializer.serialize_i32(1),
Self::ConnectionPool => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
".google.cloud.sql.v1.SqlFlagScope",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExternalSyncParallelLevel {
Unspecified,
Min,
Optimal,
Max,
UnknownValue(external_sync_parallel_level::UnknownValue),
}
#[doc(hidden)]
pub mod external_sync_parallel_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExternalSyncParallelLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Min => std::option::Option::Some(1),
Self::Optimal => std::option::Option::Some(2),
Self::Max => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
}
Self::Min => std::option::Option::Some("MIN"),
Self::Optimal => std::option::Option::Some("OPTIMAL"),
Self::Max => std::option::Option::Some("MAX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExternalSyncParallelLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExternalSyncParallelLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExternalSyncParallelLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Min,
2 => Self::Optimal,
3 => Self::Max,
_ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExternalSyncParallelLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
"MIN" => Self::Min,
"OPTIMAL" => Self::Optimal,
"MAX" => Self::Max,
_ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExternalSyncParallelLevel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Min => serializer.serialize_i32(1),
Self::Optimal => serializer.serialize_i32(2),
Self::Max => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
".google.cloud.sql.v1.ExternalSyncParallelLevel",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlInstanceType {
Unspecified,
CloudSqlInstance,
OnPremisesInstance,
ReadReplicaInstance,
ReadPoolInstance,
UnknownValue(sql_instance_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_instance_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlInstanceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudSqlInstance => std::option::Option::Some(1),
Self::OnPremisesInstance => std::option::Option::Some(2),
Self::ReadReplicaInstance => std::option::Option::Some(3),
Self::ReadPoolInstance => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlInstanceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlInstanceType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlInstanceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudSqlInstance,
2 => Self::OnPremisesInstance,
3 => Self::ReadReplicaInstance,
5 => Self::ReadPoolInstance,
_ => Self::UnknownValue(sql_instance_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlInstanceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
"ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
"READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
"READ_POOL_INSTANCE" => Self::ReadPoolInstance,
_ => Self::UnknownValue(sql_instance_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlInstanceType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudSqlInstance => serializer.serialize_i32(1),
Self::OnPremisesInstance => serializer.serialize_i32(2),
Self::ReadReplicaInstance => serializer.serialize_i32(3),
Self::ReadPoolInstance => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
".google.cloud.sql.v1.SqlInstanceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlSuspensionReason {
Unspecified,
BillingIssue,
LegalIssue,
OperationalIssue,
KmsKeyIssue,
UnknownValue(sql_suspension_reason::UnknownValue),
}
#[doc(hidden)]
pub mod sql_suspension_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlSuspensionReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::BillingIssue => std::option::Option::Some(2),
Self::LegalIssue => std::option::Option::Some(3),
Self::OperationalIssue => std::option::Option::Some(4),
Self::KmsKeyIssue => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlSuspensionReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlSuspensionReason {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlSuspensionReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::BillingIssue,
3 => Self::LegalIssue,
4 => Self::OperationalIssue,
5 => Self::KmsKeyIssue,
_ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlSuspensionReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
"BILLING_ISSUE" => Self::BillingIssue,
"LEGAL_ISSUE" => Self::LegalIssue,
"OPERATIONAL_ISSUE" => Self::OperationalIssue,
"KMS_KEY_ISSUE" => Self::KmsKeyIssue,
_ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlSuspensionReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::BillingIssue => serializer.serialize_i32(2),
Self::LegalIssue => serializer.serialize_i32(3),
Self::OperationalIssue => serializer.serialize_i32(4),
Self::KmsKeyIssue => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
".google.cloud.sql.v1.SqlSuspensionReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlFileType {
Unspecified,
Sql,
Csv,
Bak,
Tde,
UnknownValue(sql_file_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_file_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlFileType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Sql => std::option::Option::Some(1),
Self::Csv => std::option::Option::Some(2),
Self::Bak => std::option::Option::Some(4),
Self::Tde => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
Self::Sql => std::option::Option::Some("SQL"),
Self::Csv => std::option::Option::Some("CSV"),
Self::Bak => std::option::Option::Some("BAK"),
Self::Tde => std::option::Option::Some("TDE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlFileType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlFileType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlFileType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Sql,
2 => Self::Csv,
4 => Self::Bak,
8 => Self::Tde,
_ => Self::UnknownValue(sql_file_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlFileType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SQL" => Self::Sql,
"CSV" => Self::Csv,
"BAK" => Self::Bak,
"TDE" => Self::Tde,
_ => Self::UnknownValue(sql_file_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlFileType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Sql => serializer.serialize_i32(1),
Self::Csv => serializer.serialize_i32(2),
Self::Bak => serializer.serialize_i32(4),
Self::Tde => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlFileType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
".google.cloud.sql.v1.SqlFileType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BakType {
Unspecified,
Full,
Diff,
Tlog,
UnknownValue(bak_type::UnknownValue),
}
#[doc(hidden)]
pub mod bak_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BakType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Full => std::option::Option::Some(1),
Self::Diff => std::option::Option::Some(2),
Self::Tlog => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
Self::Full => std::option::Option::Some("FULL"),
Self::Diff => std::option::Option::Some("DIFF"),
Self::Tlog => std::option::Option::Some("TLOG"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BakType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BakType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for BakType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Full,
2 => Self::Diff,
3 => Self::Tlog,
_ => Self::UnknownValue(bak_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BakType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
"FULL" => Self::Full,
"DIFF" => Self::Diff,
"TLOG" => Self::Tlog,
_ => Self::UnknownValue(bak_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BakType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Full => serializer.serialize_i32(1),
Self::Diff => serializer.serialize_i32(2),
Self::Tlog => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BakType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
".google.cloud.sql.v1.BakType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlMaintenanceType {
Unspecified,
InstanceMaintenance,
ReplicaIncludedMaintenance,
InstanceSelfServiceMaintenance,
ReplicaIncludedSelfServiceMaintenance,
UnknownValue(sql_maintenance_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_maintenance_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlMaintenanceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::InstanceMaintenance => std::option::Option::Some(1),
Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
Self::ReplicaIncludedMaintenance => {
std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
}
Self::InstanceSelfServiceMaintenance => {
std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
}
Self::ReplicaIncludedSelfServiceMaintenance => {
std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlMaintenanceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlMaintenanceType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlMaintenanceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::InstanceMaintenance,
2 => Self::ReplicaIncludedMaintenance,
3 => Self::InstanceSelfServiceMaintenance,
4 => Self::ReplicaIncludedSelfServiceMaintenance,
_ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlMaintenanceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
"INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
"REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
"INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
"REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
Self::ReplicaIncludedSelfServiceMaintenance
}
_ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlMaintenanceType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::InstanceMaintenance => serializer.serialize_i32(1),
Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
".google.cloud.sql.v1.SqlMaintenanceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlBackendType {
Unspecified,
#[deprecated]
FirstGen,
SecondGen,
External,
UnknownValue(sql_backend_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_backend_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlBackendType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FirstGen => std::option::Option::Some(1),
Self::SecondGen => std::option::Option::Some(2),
Self::External => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
Self::External => std::option::Option::Some("EXTERNAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlBackendType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlBackendType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlBackendType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FirstGen,
2 => Self::SecondGen,
3 => Self::External,
_ => Self::UnknownValue(sql_backend_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlBackendType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
"FIRST_GEN" => Self::FirstGen,
"SECOND_GEN" => Self::SecondGen,
"EXTERNAL" => Self::External,
_ => Self::UnknownValue(sql_backend_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlBackendType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::FirstGen => serializer.serialize_i32(1),
Self::SecondGen => serializer.serialize_i32(2),
Self::External => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
".google.cloud.sql.v1.SqlBackendType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlIpAddressType {
Unspecified,
Primary,
Outgoing,
Private,
Migrated1StGen,
UnknownValue(sql_ip_address_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_ip_address_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlIpAddressType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Primary => std::option::Option::Some(1),
Self::Outgoing => std::option::Option::Some(2),
Self::Private => std::option::Option::Some(3),
Self::Migrated1StGen => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
Self::Primary => std::option::Option::Some("PRIMARY"),
Self::Outgoing => std::option::Option::Some("OUTGOING"),
Self::Private => std::option::Option::Some("PRIVATE"),
Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlIpAddressType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlIpAddressType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlIpAddressType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Primary,
2 => Self::Outgoing,
3 => Self::Private,
4 => Self::Migrated1StGen,
_ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlIpAddressType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
"PRIMARY" => Self::Primary,
"OUTGOING" => Self::Outgoing,
"PRIVATE" => Self::Private,
"MIGRATED_1ST_GEN" => Self::Migrated1StGen,
_ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlIpAddressType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Primary => serializer.serialize_i32(1),
Self::Outgoing => serializer.serialize_i32(2),
Self::Private => serializer.serialize_i32(3),
Self::Migrated1StGen => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
".google.cloud.sql.v1.SqlIpAddressType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlDatabaseVersion {
Unspecified,
#[deprecated]
Mysql51,
#[deprecated]
Mysql55,
Mysql56,
Mysql57,
Mysql80,
Mysql8018,
Mysql8026,
Mysql8027,
Mysql8028,
#[deprecated]
Mysql8029,
Mysql8030,
Mysql8031,
Mysql8032,
Mysql8033,
Mysql8034,
Mysql8035,
Mysql8036,
Mysql8037,
Mysql8039,
Mysql8040,
Mysql8041,
Mysql8042,
Mysql8043,
Mysql8044,
Mysql8045,
Mysql8046,
Mysql84,
Mysql97,
Sqlserver2017Standard,
Sqlserver2017Enterprise,
Sqlserver2017Express,
Sqlserver2017Web,
Postgres96,
Postgres10,
Postgres11,
Postgres12,
Postgres13,
Postgres14,
Postgres15,
Postgres16,
Postgres17,
Postgres18,
Sqlserver2019Standard,
Sqlserver2019Enterprise,
Sqlserver2019Express,
Sqlserver2019Web,
Sqlserver2022Standard,
Sqlserver2022Enterprise,
Sqlserver2022Express,
Sqlserver2022Web,
UnknownValue(sql_database_version::UnknownValue),
}
#[doc(hidden)]
pub mod sql_database_version {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlDatabaseVersion {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Mysql51 => std::option::Option::Some(2),
Self::Mysql55 => std::option::Option::Some(3),
Self::Mysql56 => std::option::Option::Some(5),
Self::Mysql57 => std::option::Option::Some(6),
Self::Mysql80 => std::option::Option::Some(20),
Self::Mysql8018 => std::option::Option::Some(41),
Self::Mysql8026 => std::option::Option::Some(85),
Self::Mysql8027 => std::option::Option::Some(111),
Self::Mysql8028 => std::option::Option::Some(132),
Self::Mysql8029 => std::option::Option::Some(148),
Self::Mysql8030 => std::option::Option::Some(174),
Self::Mysql8031 => std::option::Option::Some(197),
Self::Mysql8032 => std::option::Option::Some(213),
Self::Mysql8033 => std::option::Option::Some(238),
Self::Mysql8034 => std::option::Option::Some(239),
Self::Mysql8035 => std::option::Option::Some(240),
Self::Mysql8036 => std::option::Option::Some(241),
Self::Mysql8037 => std::option::Option::Some(355),
Self::Mysql8039 => std::option::Option::Some(357),
Self::Mysql8040 => std::option::Option::Some(358),
Self::Mysql8041 => std::option::Option::Some(488),
Self::Mysql8042 => std::option::Option::Some(489),
Self::Mysql8043 => std::option::Option::Some(553),
Self::Mysql8044 => std::option::Option::Some(554),
Self::Mysql8045 => std::option::Option::Some(555),
Self::Mysql8046 => std::option::Option::Some(556),
Self::Mysql84 => std::option::Option::Some(398),
Self::Mysql97 => std::option::Option::Some(654),
Self::Sqlserver2017Standard => std::option::Option::Some(11),
Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
Self::Sqlserver2017Express => std::option::Option::Some(15),
Self::Sqlserver2017Web => std::option::Option::Some(16),
Self::Postgres96 => std::option::Option::Some(9),
Self::Postgres10 => std::option::Option::Some(18),
Self::Postgres11 => std::option::Option::Some(10),
Self::Postgres12 => std::option::Option::Some(19),
Self::Postgres13 => std::option::Option::Some(23),
Self::Postgres14 => std::option::Option::Some(110),
Self::Postgres15 => std::option::Option::Some(172),
Self::Postgres16 => std::option::Option::Some(272),
Self::Postgres17 => std::option::Option::Some(408),
Self::Postgres18 => std::option::Option::Some(557),
Self::Sqlserver2019Standard => std::option::Option::Some(26),
Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
Self::Sqlserver2019Express => std::option::Option::Some(28),
Self::Sqlserver2019Web => std::option::Option::Some(29),
Self::Sqlserver2022Standard => std::option::Option::Some(199),
Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
Self::Sqlserver2022Express => std::option::Option::Some(201),
Self::Sqlserver2022Web => std::option::Option::Some(202),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlDatabaseVersion {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlDatabaseVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlDatabaseVersion {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Mysql51,
3 => Self::Mysql55,
5 => Self::Mysql56,
6 => Self::Mysql57,
9 => Self::Postgres96,
10 => Self::Postgres11,
11 => Self::Sqlserver2017Standard,
14 => Self::Sqlserver2017Enterprise,
15 => Self::Sqlserver2017Express,
16 => Self::Sqlserver2017Web,
18 => Self::Postgres10,
19 => Self::Postgres12,
20 => Self::Mysql80,
23 => Self::Postgres13,
26 => Self::Sqlserver2019Standard,
27 => Self::Sqlserver2019Enterprise,
28 => Self::Sqlserver2019Express,
29 => Self::Sqlserver2019Web,
41 => Self::Mysql8018,
85 => Self::Mysql8026,
110 => Self::Postgres14,
111 => Self::Mysql8027,
132 => Self::Mysql8028,
148 => Self::Mysql8029,
172 => Self::Postgres15,
174 => Self::Mysql8030,
197 => Self::Mysql8031,
199 => Self::Sqlserver2022Standard,
200 => Self::Sqlserver2022Enterprise,
201 => Self::Sqlserver2022Express,
202 => Self::Sqlserver2022Web,
213 => Self::Mysql8032,
238 => Self::Mysql8033,
239 => Self::Mysql8034,
240 => Self::Mysql8035,
241 => Self::Mysql8036,
272 => Self::Postgres16,
355 => Self::Mysql8037,
357 => Self::Mysql8039,
358 => Self::Mysql8040,
398 => Self::Mysql84,
408 => Self::Postgres17,
488 => Self::Mysql8041,
489 => Self::Mysql8042,
553 => Self::Mysql8043,
554 => Self::Mysql8044,
555 => Self::Mysql8045,
556 => Self::Mysql8046,
557 => Self::Postgres18,
654 => Self::Mysql97,
_ => Self::UnknownValue(sql_database_version::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlDatabaseVersion {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
"MYSQL_5_1" => Self::Mysql51,
"MYSQL_5_5" => Self::Mysql55,
"MYSQL_5_6" => Self::Mysql56,
"MYSQL_5_7" => Self::Mysql57,
"MYSQL_8_0" => Self::Mysql80,
"MYSQL_8_0_18" => Self::Mysql8018,
"MYSQL_8_0_26" => Self::Mysql8026,
"MYSQL_8_0_27" => Self::Mysql8027,
"MYSQL_8_0_28" => Self::Mysql8028,
"MYSQL_8_0_29" => Self::Mysql8029,
"MYSQL_8_0_30" => Self::Mysql8030,
"MYSQL_8_0_31" => Self::Mysql8031,
"MYSQL_8_0_32" => Self::Mysql8032,
"MYSQL_8_0_33" => Self::Mysql8033,
"MYSQL_8_0_34" => Self::Mysql8034,
"MYSQL_8_0_35" => Self::Mysql8035,
"MYSQL_8_0_36" => Self::Mysql8036,
"MYSQL_8_0_37" => Self::Mysql8037,
"MYSQL_8_0_39" => Self::Mysql8039,
"MYSQL_8_0_40" => Self::Mysql8040,
"MYSQL_8_0_41" => Self::Mysql8041,
"MYSQL_8_0_42" => Self::Mysql8042,
"MYSQL_8_0_43" => Self::Mysql8043,
"MYSQL_8_0_44" => Self::Mysql8044,
"MYSQL_8_0_45" => Self::Mysql8045,
"MYSQL_8_0_46" => Self::Mysql8046,
"MYSQL_8_4" => Self::Mysql84,
"MYSQL_9_7" => Self::Mysql97,
"SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
"SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
"SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
"SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
"POSTGRES_9_6" => Self::Postgres96,
"POSTGRES_10" => Self::Postgres10,
"POSTGRES_11" => Self::Postgres11,
"POSTGRES_12" => Self::Postgres12,
"POSTGRES_13" => Self::Postgres13,
"POSTGRES_14" => Self::Postgres14,
"POSTGRES_15" => Self::Postgres15,
"POSTGRES_16" => Self::Postgres16,
"POSTGRES_17" => Self::Postgres17,
"POSTGRES_18" => Self::Postgres18,
"SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
"SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
"SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
"SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
"SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
"SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
"SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
"SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
_ => Self::UnknownValue(sql_database_version::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlDatabaseVersion {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Mysql51 => serializer.serialize_i32(2),
Self::Mysql55 => serializer.serialize_i32(3),
Self::Mysql56 => serializer.serialize_i32(5),
Self::Mysql57 => serializer.serialize_i32(6),
Self::Mysql80 => serializer.serialize_i32(20),
Self::Mysql8018 => serializer.serialize_i32(41),
Self::Mysql8026 => serializer.serialize_i32(85),
Self::Mysql8027 => serializer.serialize_i32(111),
Self::Mysql8028 => serializer.serialize_i32(132),
Self::Mysql8029 => serializer.serialize_i32(148),
Self::Mysql8030 => serializer.serialize_i32(174),
Self::Mysql8031 => serializer.serialize_i32(197),
Self::Mysql8032 => serializer.serialize_i32(213),
Self::Mysql8033 => serializer.serialize_i32(238),
Self::Mysql8034 => serializer.serialize_i32(239),
Self::Mysql8035 => serializer.serialize_i32(240),
Self::Mysql8036 => serializer.serialize_i32(241),
Self::Mysql8037 => serializer.serialize_i32(355),
Self::Mysql8039 => serializer.serialize_i32(357),
Self::Mysql8040 => serializer.serialize_i32(358),
Self::Mysql8041 => serializer.serialize_i32(488),
Self::Mysql8042 => serializer.serialize_i32(489),
Self::Mysql8043 => serializer.serialize_i32(553),
Self::Mysql8044 => serializer.serialize_i32(554),
Self::Mysql8045 => serializer.serialize_i32(555),
Self::Mysql8046 => serializer.serialize_i32(556),
Self::Mysql84 => serializer.serialize_i32(398),
Self::Mysql97 => serializer.serialize_i32(654),
Self::Sqlserver2017Standard => serializer.serialize_i32(11),
Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
Self::Sqlserver2017Express => serializer.serialize_i32(15),
Self::Sqlserver2017Web => serializer.serialize_i32(16),
Self::Postgres96 => serializer.serialize_i32(9),
Self::Postgres10 => serializer.serialize_i32(18),
Self::Postgres11 => serializer.serialize_i32(10),
Self::Postgres12 => serializer.serialize_i32(19),
Self::Postgres13 => serializer.serialize_i32(23),
Self::Postgres14 => serializer.serialize_i32(110),
Self::Postgres15 => serializer.serialize_i32(172),
Self::Postgres16 => serializer.serialize_i32(272),
Self::Postgres17 => serializer.serialize_i32(408),
Self::Postgres18 => serializer.serialize_i32(557),
Self::Sqlserver2019Standard => serializer.serialize_i32(26),
Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
Self::Sqlserver2019Express => serializer.serialize_i32(28),
Self::Sqlserver2019Web => serializer.serialize_i32(29),
Self::Sqlserver2022Standard => serializer.serialize_i32(199),
Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
Self::Sqlserver2022Express => serializer.serialize_i32(201),
Self::Sqlserver2022Web => serializer.serialize_i32(202),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
".google.cloud.sql.v1.SqlDatabaseVersion",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlPricingPlan {
Unspecified,
Package,
PerUse,
UnknownValue(sql_pricing_plan::UnknownValue),
}
#[doc(hidden)]
pub mod sql_pricing_plan {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlPricingPlan {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Package => std::option::Option::Some(1),
Self::PerUse => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
Self::Package => std::option::Option::Some("PACKAGE"),
Self::PerUse => std::option::Option::Some("PER_USE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlPricingPlan {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlPricingPlan {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlPricingPlan {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Package,
2 => Self::PerUse,
_ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlPricingPlan {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
"PACKAGE" => Self::Package,
"PER_USE" => Self::PerUse,
_ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlPricingPlan {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Package => serializer.serialize_i32(1),
Self::PerUse => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
".google.cloud.sql.v1.SqlPricingPlan",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlReplicationType {
Unspecified,
Synchronous,
Asynchronous,
UnknownValue(sql_replication_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_replication_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlReplicationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Synchronous => std::option::Option::Some(1),
Self::Asynchronous => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlReplicationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlReplicationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlReplicationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Synchronous,
2 => Self::Asynchronous,
_ => Self::UnknownValue(sql_replication_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlReplicationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"SYNCHRONOUS" => Self::Synchronous,
"ASYNCHRONOUS" => Self::Asynchronous,
_ => Self::UnknownValue(sql_replication_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlReplicationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Synchronous => serializer.serialize_i32(1),
Self::Asynchronous => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
".google.cloud.sql.v1.SqlReplicationType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlDataDiskType {
Unspecified,
PdSsd,
PdHdd,
#[deprecated]
ObsoleteLocalSsd,
HyperdiskBalanced,
UnknownValue(sql_data_disk_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_data_disk_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlDataDiskType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PdSsd => std::option::Option::Some(1),
Self::PdHdd => std::option::Option::Some(2),
Self::ObsoleteLocalSsd => std::option::Option::Some(3),
Self::HyperdiskBalanced => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
Self::PdSsd => std::option::Option::Some("PD_SSD"),
Self::PdHdd => std::option::Option::Some("PD_HDD"),
Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlDataDiskType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlDataDiskType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlDataDiskType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PdSsd,
2 => Self::PdHdd,
3 => Self::ObsoleteLocalSsd,
4 => Self::HyperdiskBalanced,
_ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlDataDiskType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
"PD_SSD" => Self::PdSsd,
"PD_HDD" => Self::PdHdd,
"OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
"HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
_ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlDataDiskType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::PdSsd => serializer.serialize_i32(1),
Self::PdHdd => serializer.serialize_i32(2),
Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
Self::HyperdiskBalanced => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
".google.cloud.sql.v1.SqlDataDiskType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlAvailabilityType {
Unspecified,
Zonal,
Regional,
UnknownValue(sql_availability_type::UnknownValue),
}
#[doc(hidden)]
pub mod sql_availability_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlAvailabilityType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Zonal => std::option::Option::Some(1),
Self::Regional => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
Self::Zonal => std::option::Option::Some("ZONAL"),
Self::Regional => std::option::Option::Some("REGIONAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlAvailabilityType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlAvailabilityType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlAvailabilityType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Zonal,
2 => Self::Regional,
_ => Self::UnknownValue(sql_availability_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlAvailabilityType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
"ZONAL" => Self::Zonal,
"REGIONAL" => Self::Regional,
_ => Self::UnknownValue(sql_availability_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlAvailabilityType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Zonal => serializer.serialize_i32(1),
Self::Regional => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
".google.cloud.sql.v1.SqlAvailabilityType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlUpdateTrack {
Unspecified,
Canary,
Stable,
Week5,
UnknownValue(sql_update_track::UnknownValue),
}
#[doc(hidden)]
pub mod sql_update_track {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SqlUpdateTrack {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Canary => std::option::Option::Some(1),
Self::Stable => std::option::Option::Some(2),
Self::Week5 => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
Self::Canary => std::option::Option::Some("canary"),
Self::Stable => std::option::Option::Some("stable"),
Self::Week5 => std::option::Option::Some("week5"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SqlUpdateTrack {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SqlUpdateTrack {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SqlUpdateTrack {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Canary,
2 => Self::Stable,
3 => Self::Week5,
_ => Self::UnknownValue(sql_update_track::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SqlUpdateTrack {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
"canary" => Self::Canary,
"stable" => Self::Stable,
"week5" => Self::Week5,
_ => Self::UnknownValue(sql_update_track::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SqlUpdateTrack {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Canary => serializer.serialize_i32(1),
Self::Stable => serializer.serialize_i32(2),
Self::Week5 => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
".google.cloud.sql.v1.SqlUpdateTrack",
))
}
}