#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
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 ListMigrationJobsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMigrationJobsRequest {
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
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListMigrationJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListMigrationJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMigrationJobsResponse {
pub migration_jobs: std::vec::Vec<crate::model::MigrationJob>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMigrationJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migration_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MigrationJob>,
{
use std::iter::Iterator;
self.migration_jobs = 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_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListMigrationJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListMigrationJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMigrationJobsResponse {
type PageItem = crate::model::MigrationJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.migration_jobs
}
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 GetMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMigrationJobRequest {
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 GetMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GetMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMigrationJobRequest {
pub parent: std::string::String,
pub migration_job_id: std::string::String,
pub migration_job: std::option::Option<crate::model::MigrationJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMigrationJobRequest {
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_migration_job_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.migration_job_id = v.into();
self
}
pub fn set_migration_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MigrationJob>,
{
self.migration_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MigrationJob>,
{
self.migration_job = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CreateMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMigrationJobRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub migration_job: std::option::Option<crate::model::MigrationJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMigrationJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
pub fn set_migration_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MigrationJob>,
{
self.migration_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MigrationJob>,
{
self.migration_job = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.UpdateMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMigrationJobRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMigrationJobRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DeleteMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartMigrationJobRequest {
pub name: std::string::String,
pub skip_validation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartMigrationJobRequest {
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_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_validation = v.into();
self
}
}
impl wkt::message::Message for StartMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.StartMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StopMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StopMigrationJobRequest {
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 StopMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.StopMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResumeMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResumeMigrationJobRequest {
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 ResumeMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ResumeMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PromoteMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PromoteMigrationJobRequest {
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 PromoteMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.PromoteMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyMigrationJobRequest {
pub name: std::string::String,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub migration_job: std::option::Option<crate::model::MigrationJob>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyMigrationJobRequest {
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_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
}
pub fn set_migration_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MigrationJob>,
{
self.migration_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MigrationJob>,
{
self.migration_job = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VerifyMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.VerifyMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestartMigrationJobRequest {
pub name: std::string::String,
pub skip_validation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestartMigrationJobRequest {
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_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_validation = v.into();
self
}
}
impl wkt::message::Message for RestartMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.RestartMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateSshScriptRequest {
pub migration_job: std::string::String,
pub vm: std::string::String,
pub vm_port: i32,
pub vm_config: std::option::Option<crate::model::generate_ssh_script_request::VmConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateSshScriptRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migration_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migration_job = v.into();
self
}
pub fn set_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm = v.into();
self
}
pub fn set_vm_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.vm_port = v.into();
self
}
pub fn set_vm_config<
T: std::convert::Into<
std::option::Option<crate::model::generate_ssh_script_request::VmConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.vm_config = v.into();
self
}
pub fn vm_creation_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmCreationConfig>> {
#[allow(unreachable_patterns)]
self.vm_config.as_ref().and_then(|v| match v {
crate::model::generate_ssh_script_request::VmConfig::VmCreationConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vm_creation_config<
T: std::convert::Into<std::boxed::Box<crate::model::VmCreationConfig>>,
>(
mut self,
v: T,
) -> Self {
self.vm_config = std::option::Option::Some(
crate::model::generate_ssh_script_request::VmConfig::VmCreationConfig(v.into()),
);
self
}
pub fn vm_selection_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmSelectionConfig>> {
#[allow(unreachable_patterns)]
self.vm_config.as_ref().and_then(|v| match v {
crate::model::generate_ssh_script_request::VmConfig::VmSelectionConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vm_selection_config<
T: std::convert::Into<std::boxed::Box<crate::model::VmSelectionConfig>>,
>(
mut self,
v: T,
) -> Self {
self.vm_config = std::option::Option::Some(
crate::model::generate_ssh_script_request::VmConfig::VmSelectionConfig(v.into()),
);
self
}
}
impl wkt::message::Message for GenerateSshScriptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GenerateSshScriptRequest"
}
}
pub mod generate_ssh_script_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmConfig {
VmCreationConfig(std::boxed::Box<crate::model::VmCreationConfig>),
VmSelectionConfig(std::boxed::Box<crate::model::VmSelectionConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmCreationConfig {
pub vm_machine_type: std::string::String,
pub vm_zone: std::string::String,
pub subnet: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmCreationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_machine_type = v.into();
self
}
pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_zone = v.into();
self
}
pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnet = v.into();
self
}
}
impl wkt::message::Message for VmCreationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.VmCreationConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmSelectionConfig {
pub vm_zone: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmSelectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_zone = v.into();
self
}
}
impl wkt::message::Message for VmSelectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.VmSelectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SshScript {
pub script: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SshScript {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.script = v.into();
self
}
}
impl wkt::message::Message for SshScript {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SshScript"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateTcpProxyScriptRequest {
pub migration_job: std::string::String,
pub vm_name: std::string::String,
pub vm_machine_type: std::string::String,
pub vm_zone: std::string::String,
pub vm_subnet: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateTcpProxyScriptRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migration_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migration_job = v.into();
self
}
pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_name = v.into();
self
}
pub fn set_vm_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_machine_type = v.into();
self
}
pub fn set_vm_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_zone = v.into();
self
}
pub fn set_vm_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_subnet = v.into();
self
}
}
impl wkt::message::Message for GenerateTcpProxyScriptRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GenerateTcpProxyScriptRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TcpProxyScript {
pub script: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TcpProxyScript {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.script = v.into();
self
}
}
impl wkt::message::Message for TcpProxyScript {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.TcpProxyScript"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectionProfilesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectionProfilesRequest {
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
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListConnectionProfilesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListConnectionProfilesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectionProfilesResponse {
pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectionProfilesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConnectionProfile>,
{
use std::iter::Iterator;
self.connection_profiles = 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_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListConnectionProfilesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListConnectionProfilesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
type PageItem = crate::model::ConnectionProfile;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.connection_profiles
}
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 GetConnectionProfileRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConnectionProfileRequest {
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 GetConnectionProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GetConnectionProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateConnectionProfileRequest {
pub parent: std::string::String,
pub connection_profile_id: std::string::String,
pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
pub request_id: std::string::String,
pub validate_only: bool,
pub skip_validation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateConnectionProfileRequest {
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_connection_profile_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.connection_profile_id = v.into();
self
}
pub fn set_connection_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConnectionProfile>,
{
self.connection_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConnectionProfile>,
{
self.connection_profile = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_validation = v.into();
self
}
}
impl wkt::message::Message for CreateConnectionProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CreateConnectionProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateConnectionProfileRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
pub request_id: std::string::String,
pub validate_only: bool,
pub skip_validation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateConnectionProfileRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
pub fn set_connection_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConnectionProfile>,
{
self.connection_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConnectionProfile>,
{
self.connection_profile = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_validation = v.into();
self
}
}
impl wkt::message::Message for UpdateConnectionProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.UpdateConnectionProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteConnectionProfileRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteConnectionProfileRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteConnectionProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DeleteConnectionProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePrivateConnectionRequest {
pub parent: std::string::String,
pub private_connection_id: std::string::String,
pub private_connection: std::option::Option<crate::model::PrivateConnection>,
pub request_id: std::string::String,
pub skip_validation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatePrivateConnectionRequest {
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_private_connection_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.private_connection_id = v.into();
self
}
pub fn set_private_connection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PrivateConnection>,
{
self.private_connection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PrivateConnection>,
{
self.private_connection = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_skip_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_validation = v.into();
self
}
}
impl wkt::message::Message for CreatePrivateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CreatePrivateConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPrivateConnectionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPrivateConnectionsRequest {
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
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListPrivateConnectionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListPrivateConnectionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPrivateConnectionsResponse {
pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPrivateConnectionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_private_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PrivateConnection>,
{
use std::iter::Iterator;
self.private_connections = 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_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListPrivateConnectionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListPrivateConnectionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
type PageItem = crate::model::PrivateConnection;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.private_connections
}
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 DeletePrivateConnectionRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeletePrivateConnectionRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeletePrivateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DeletePrivateConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPrivateConnectionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetPrivateConnectionRequest {
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 GetPrivateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GetPrivateConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConversionWorkspacesRequest {
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 ListConversionWorkspacesRequest {
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 ListConversionWorkspacesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListConversionWorkspacesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConversionWorkspacesResponse {
pub conversion_workspaces: std::vec::Vec<crate::model::ConversionWorkspace>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConversionWorkspacesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_conversion_workspaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConversionWorkspace>,
{
use std::iter::Iterator;
self.conversion_workspaces = 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_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListConversionWorkspacesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListConversionWorkspacesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListConversionWorkspacesResponse {
type PageItem = crate::model::ConversionWorkspace;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.conversion_workspaces
}
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 GetConversionWorkspaceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConversionWorkspaceRequest {
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 GetConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GetConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateConversionWorkspaceRequest {
pub parent: std::string::String,
pub conversion_workspace_id: std::string::String,
pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspace>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateConversionWorkspaceRequest {
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_conversion_workspace_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.conversion_workspace_id = v.into();
self
}
pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConversionWorkspace>,
{
self.conversion_workspace = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConversionWorkspace>,
{
self.conversion_workspace = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CreateConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateConversionWorkspaceRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspace>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateConversionWorkspaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConversionWorkspace>,
{
self.conversion_workspace = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConversionWorkspace>,
{
self.conversion_workspace = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteConversionWorkspaceRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteConversionWorkspaceRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommitConversionWorkspaceRequest {
pub name: std::string::String,
pub commit_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CommitConversionWorkspaceRequest {
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_commit_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.commit_name = v.into();
self
}
}
impl wkt::message::Message for CommitConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CommitConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RollbackConversionWorkspaceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RollbackConversionWorkspaceRequest {
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 RollbackConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApplyConversionWorkspaceRequest {
pub name: std::string::String,
pub filter: std::string::String,
pub dry_run: bool,
pub auto_commit: bool,
pub destination:
std::option::Option<crate::model::apply_conversion_workspace_request::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApplyConversionWorkspaceRequest {
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_dry_run<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.dry_run = v.into();
self
}
pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.auto_commit = v.into();
self
}
pub fn set_destination<
T: std::convert::Into<
std::option::Option<crate::model::apply_conversion_workspace_request::Destination>,
>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn connection_profile(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::apply_conversion_workspace_request::Destination::ConnectionProfile(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::apply_conversion_workspace_request::Destination::ConnectionProfile(
v.into(),
),
);
self
}
}
impl wkt::message::Message for ApplyConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest"
}
}
pub mod apply_conversion_workspace_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
ConnectionProfile(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMappingRulesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMappingRulesRequest {
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
}
}
impl wkt::message::Message for ListMappingRulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListMappingRulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMappingRulesResponse {
pub mapping_rules: std::vec::Vec<crate::model::MappingRule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMappingRulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mapping_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MappingRule>,
{
use std::iter::Iterator;
self.mapping_rules = 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 ListMappingRulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ListMappingRulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMappingRulesResponse {
type PageItem = crate::model::MappingRule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.mapping_rules
}
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 GetMappingRuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMappingRuleRequest {
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 GetMappingRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.GetMappingRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SeedConversionWorkspaceRequest {
pub name: std::string::String,
pub auto_commit: bool,
pub seed_from: std::option::Option<crate::model::seed_conversion_workspace_request::SeedFrom>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SeedConversionWorkspaceRequest {
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_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.auto_commit = v.into();
self
}
pub fn set_seed_from<
T: std::convert::Into<
std::option::Option<crate::model::seed_conversion_workspace_request::SeedFrom>,
>,
>(
mut self,
v: T,
) -> Self {
self.seed_from = v.into();
self
}
pub fn source_connection_profile(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.seed_from.as_ref().and_then(|v| match v {
crate::model::seed_conversion_workspace_request::SeedFrom::SourceConnectionProfile(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.seed_from = std::option::Option::Some(
crate::model::seed_conversion_workspace_request::SeedFrom::SourceConnectionProfile(
v.into(),
),
);
self
}
pub fn destination_connection_profile(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.seed_from.as_ref().and_then(|v| match v {
crate::model::seed_conversion_workspace_request::SeedFrom::DestinationConnectionProfile(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.seed_from = std::option::Option::Some(
crate::model::seed_conversion_workspace_request::SeedFrom::DestinationConnectionProfile(
v.into(),
),
);
self
}
}
impl wkt::message::Message for SeedConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SeedConversionWorkspaceRequest"
}
}
pub mod seed_conversion_workspace_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SeedFrom {
SourceConnectionProfile(std::string::String),
DestinationConnectionProfile(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConvertConversionWorkspaceRequest {
pub name: std::string::String,
pub auto_commit: bool,
pub filter: std::string::String,
pub convert_full_path: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConvertConversionWorkspaceRequest {
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_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.auto_commit = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_convert_full_path<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.convert_full_path = v.into();
self
}
}
impl wkt::message::Message for ConvertConversionWorkspaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportMappingRulesRequest {
pub parent: std::string::String,
pub rules_format: crate::model::ImportRulesFileFormat,
pub rules_files: std::vec::Vec<crate::model::import_mapping_rules_request::RulesFile>,
pub auto_commit: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportMappingRulesRequest {
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_rules_format<T: std::convert::Into<crate::model::ImportRulesFileFormat>>(
mut self,
v: T,
) -> Self {
self.rules_format = v.into();
self
}
pub fn set_rules_files<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::import_mapping_rules_request::RulesFile>,
{
use std::iter::Iterator;
self.rules_files = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_auto_commit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.auto_commit = v.into();
self
}
}
impl wkt::message::Message for ImportMappingRulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ImportMappingRulesRequest"
}
}
pub mod import_mapping_rules_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RulesFile {
pub rules_source_filename: std::string::String,
pub rules_content: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RulesFile {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules_source_filename<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rules_source_filename = v.into();
self
}
pub fn set_rules_content<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rules_content = v.into();
self
}
}
impl wkt::message::Message for RulesFile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DescribeDatabaseEntitiesRequest {
pub conversion_workspace: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub tree: crate::model::describe_database_entities_request::DBTreeType,
pub uncommitted: bool,
pub commit_id: std::string::String,
pub filter: std::string::String,
pub view: crate::model::DatabaseEntityView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DescribeDatabaseEntitiesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.conversion_workspace = 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_tree<
T: std::convert::Into<crate::model::describe_database_entities_request::DBTreeType>,
>(
mut self,
v: T,
) -> Self {
self.tree = v.into();
self
}
pub fn set_uncommitted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.uncommitted = v.into();
self
}
pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.commit_id = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::DatabaseEntityView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for DescribeDatabaseEntitiesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest"
}
}
pub mod describe_database_entities_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DBTreeType {
Unspecified,
SourceTree,
DraftTree,
DestinationTree,
UnknownValue(db_tree_type::UnknownValue),
}
#[doc(hidden)]
pub mod db_tree_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DBTreeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SourceTree => std::option::Option::Some(1),
Self::DraftTree => std::option::Option::Some(2),
Self::DestinationTree => 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("DB_TREE_TYPE_UNSPECIFIED"),
Self::SourceTree => std::option::Option::Some("SOURCE_TREE"),
Self::DraftTree => std::option::Option::Some("DRAFT_TREE"),
Self::DestinationTree => std::option::Option::Some("DESTINATION_TREE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DBTreeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DBTreeType {
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 DBTreeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SourceTree,
2 => Self::DraftTree,
3 => Self::DestinationTree,
_ => Self::UnknownValue(db_tree_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DBTreeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DB_TREE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SOURCE_TREE" => Self::SourceTree,
"DRAFT_TREE" => Self::DraftTree,
"DESTINATION_TREE" => Self::DestinationTree,
_ => Self::UnknownValue(db_tree_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DBTreeType {
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::SourceTree => serializer.serialize_i32(1),
Self::DraftTree => serializer.serialize_i32(2),
Self::DestinationTree => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DBTreeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DBTreeType>::new(
".google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DescribeDatabaseEntitiesResponse {
pub database_entities: std::vec::Vec<crate::model::DatabaseEntity>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DescribeDatabaseEntitiesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database_entities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DatabaseEntity>,
{
use std::iter::Iterator;
self.database_entities = 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 DescribeDatabaseEntitiesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for DescribeDatabaseEntitiesResponse {
type PageItem = crate::model::DatabaseEntity;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.database_entities
}
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 SearchBackgroundJobsRequest {
pub conversion_workspace: std::string::String,
pub return_most_recent_per_job_type: bool,
pub max_size: i32,
pub completed_until_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchBackgroundJobsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.conversion_workspace = v.into();
self
}
pub fn set_return_most_recent_per_job_type<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.return_most_recent_per_job_type = v.into();
self
}
pub fn set_max_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_size = v.into();
self
}
pub fn set_completed_until_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completed_until_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_completed_until_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completed_until_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SearchBackgroundJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SearchBackgroundJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchBackgroundJobsResponse {
pub jobs: std::vec::Vec<crate::model::BackgroundJobLogEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchBackgroundJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BackgroundJobLogEntry>,
{
use std::iter::Iterator;
self.jobs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SearchBackgroundJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SearchBackgroundJobsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DescribeConversionWorkspaceRevisionsRequest {
pub conversion_workspace: std::string::String,
pub commit_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DescribeConversionWorkspaceRevisionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_conversion_workspace<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.conversion_workspace = v.into();
self
}
pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.commit_id = v.into();
self
}
}
impl wkt::message::Message for DescribeConversionWorkspaceRevisionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DescribeConversionWorkspaceRevisionsResponse {
pub revisions: std::vec::Vec<crate::model::ConversionWorkspace>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DescribeConversionWorkspaceRevisionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_revisions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConversionWorkspace>,
{
use std::iter::Iterator;
self.revisions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DescribeConversionWorkspaceRevisionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMappingRuleRequest {
pub parent: std::string::String,
pub mapping_rule_id: std::string::String,
pub mapping_rule: std::option::Option<crate::model::MappingRule>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMappingRuleRequest {
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_mapping_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mapping_rule_id = v.into();
self
}
pub fn set_mapping_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MappingRule>,
{
self.mapping_rule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mapping_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MappingRule>,
{
self.mapping_rule = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateMappingRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CreateMappingRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMappingRuleRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMappingRuleRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteMappingRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DeleteMappingRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchStaticIpsRequest {
pub name: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchStaticIpsRequest {
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_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
}
}
impl wkt::message::Message for FetchStaticIpsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.FetchStaticIpsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchStaticIpsResponse {
pub static_ips: std::vec::Vec<std::string::String>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchStaticIpsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_static_ips<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.static_ips = 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 FetchStaticIpsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.FetchStaticIpsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslConfig {
pub r#type: crate::model::ssl_config::SslType,
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 SslConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::ssl_config::SslType>>(
mut self,
v: T,
) -> Self {
self.r#type = 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 SslConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SslConfig"
}
}
pub mod ssl_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SslType {
Unspecified,
ServerOnly,
ServerClient,
UnknownValue(ssl_type::UnknownValue),
}
#[doc(hidden)]
pub mod ssl_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SslType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ServerOnly => std::option::Option::Some(1),
Self::ServerClient => 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("SSL_TYPE_UNSPECIFIED"),
Self::ServerOnly => std::option::Option::Some("SERVER_ONLY"),
Self::ServerClient => std::option::Option::Some("SERVER_CLIENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SslType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SslType {
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 SslType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ServerOnly,
2 => Self::ServerClient,
_ => Self::UnknownValue(ssl_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SslType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SSL_TYPE_UNSPECIFIED" => Self::Unspecified,
"SERVER_ONLY" => Self::ServerOnly,
"SERVER_CLIENT" => Self::ServerClient,
_ => Self::UnknownValue(ssl_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SslType {
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::ServerOnly => serializer.serialize_i32(1),
Self::ServerClient => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SslType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslType>::new(
".google.cloud.clouddms.v1.SslConfig.SslType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MySqlConnectionProfile {
pub host: std::string::String,
pub port: i32,
pub username: std::string::String,
pub password: std::string::String,
pub password_set: bool,
pub ssl: std::option::Option<crate::model::SslConfig>,
pub cloud_sql_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MySqlConnectionProfile {
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_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = 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_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.password_set = v.into();
self
}
pub fn set_ssl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl = v.map(|x| x.into());
self
}
pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cloud_sql_id = v.into();
self
}
}
impl wkt::message::Message for MySqlConnectionProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MySqlConnectionProfile"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostgreSqlConnectionProfile {
pub host: std::string::String,
pub port: i32,
pub username: std::string::String,
pub password: std::string::String,
pub password_set: bool,
pub ssl: std::option::Option<crate::model::SslConfig>,
pub cloud_sql_id: std::string::String,
pub network_architecture: crate::model::NetworkArchitecture,
pub connectivity:
std::option::Option<crate::model::postgre_sql_connection_profile::Connectivity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostgreSqlConnectionProfile {
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_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = 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_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.password_set = v.into();
self
}
pub fn set_ssl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl = v.map(|x| x.into());
self
}
pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cloud_sql_id = v.into();
self
}
pub fn set_network_architecture<T: std::convert::Into<crate::model::NetworkArchitecture>>(
mut self,
v: T,
) -> Self {
self.network_architecture = v.into();
self
}
pub fn set_connectivity<
T: std::convert::Into<
std::option::Option<crate::model::postgre_sql_connection_profile::Connectivity>,
>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = v.into();
self
}
pub fn static_ip_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StaticIpConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_static_ip_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::StaticIpConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::postgre_sql_connection_profile::Connectivity::StaticIpConnectivity(
v.into(),
),
);
self
}
pub fn private_service_connect_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>>
{
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::postgre_sql_connection_profile::Connectivity::PrivateServiceConnectConnectivity(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_private_service_connect_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::postgre_sql_connection_profile::Connectivity::PrivateServiceConnectConnectivity(
v.into()
)
);
self
}
}
impl wkt::message::Message for PostgreSqlConnectionProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.PostgreSqlConnectionProfile"
}
}
pub mod postgre_sql_connection_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Connectivity {
StaticIpConnectivity(std::boxed::Box<crate::model::StaticIpConnectivity>),
PrivateServiceConnectConnectivity(
std::boxed::Box<crate::model::PrivateServiceConnectConnectivity>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OracleConnectionProfile {
pub host: std::string::String,
pub port: i32,
pub username: std::string::String,
pub password: std::string::String,
pub password_set: bool,
pub database_service: std::string::String,
pub ssl: std::option::Option<crate::model::SslConfig>,
pub connectivity: std::option::Option<crate::model::oracle_connection_profile::Connectivity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OracleConnectionProfile {
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_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = 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_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.password_set = v.into();
self
}
pub fn set_database_service<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.database_service = v.into();
self
}
pub fn set_ssl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl = v.map(|x| x.into());
self
}
pub fn set_connectivity<
T: std::convert::Into<
std::option::Option<crate::model::oracle_connection_profile::Connectivity>,
>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = v.into();
self
}
pub fn static_service_ip_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_static_service_ip_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::oracle_connection_profile::Connectivity::StaticServiceIpConnectivity(
v.into(),
),
);
self
}
pub fn forward_ssh_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::oracle_connection_profile::Connectivity::ForwardSshConnectivity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_forward_ssh_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::oracle_connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
);
self
}
pub fn private_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::oracle_connection_profile::Connectivity::PrivateConnectivity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_private_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::oracle_connection_profile::Connectivity::PrivateConnectivity(v.into()),
);
self
}
}
impl wkt::message::Message for OracleConnectionProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.OracleConnectionProfile"
}
}
pub mod oracle_connection_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Connectivity {
StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudSqlConnectionProfile {
pub cloud_sql_id: std::string::String,
pub settings: std::option::Option<crate::model::CloudSqlSettings>,
pub private_ip: std::string::String,
pub public_ip: std::string::String,
pub additional_public_ip: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudSqlConnectionProfile {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_sql_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cloud_sql_id = v.into();
self
}
pub fn set_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudSqlSettings>,
{
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::CloudSqlSettings>,
{
self.settings = v.map(|x| x.into());
self
}
pub fn set_private_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.private_ip = v.into();
self
}
pub fn set_public_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_ip = v.into();
self
}
pub fn set_additional_public_ip<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.additional_public_ip = v.into();
self
}
}
impl wkt::message::Message for CloudSqlConnectionProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CloudSqlConnectionProfile"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AlloyDbConnectionProfile {
pub cluster_id: std::string::String,
pub settings: std::option::Option<crate::model::AlloyDbSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AlloyDbConnectionProfile {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_id = v.into();
self
}
pub fn set_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AlloyDbSettings>,
{
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::AlloyDbSettings>,
{
self.settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AlloyDbConnectionProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AlloyDbConnectionProfile"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlAclEntry {
pub value: std::string::String,
pub label: std::string::String,
pub expiration: std::option::Option<crate::model::sql_acl_entry::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlAclEntry {
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_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.label = v.into();
self
}
pub fn set_expiration<
T: std::convert::Into<std::option::Option<crate::model::sql_acl_entry::Expiration>>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn expire_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_acl_entry::Expiration::ExpireTime(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration = std::option::Option::Some(
crate::model::sql_acl_entry::Expiration::ExpireTime(v.into()),
);
self
}
pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::sql_acl_entry::Expiration::Ttl(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
self.expiration =
std::option::Option::Some(crate::model::sql_acl_entry::Expiration::Ttl(v.into()));
self
}
}
impl wkt::message::Message for SqlAclEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SqlAclEntry"
}
}
pub mod sql_acl_entry {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
ExpireTime(std::boxed::Box<wkt::Timestamp>),
Ttl(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SqlIpConfig {
pub enable_ipv4: std::option::Option<wkt::BoolValue>,
pub private_network: std::string::String,
pub allocated_ip_range: std::string::String,
pub require_ssl: std::option::Option<wkt::BoolValue>,
pub authorized_networks: std::vec::Vec<crate::model::SqlAclEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SqlIpConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_ipv4<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_ipv4 = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_ipv4<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.enable_ipv4 = 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_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_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::SqlAclEntry>,
{
use std::iter::Iterator;
self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SqlIpConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SqlIpConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudSqlSettings {
pub database_version: crate::model::cloud_sql_settings::SqlDatabaseVersion,
pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub tier: std::string::String,
pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
pub activation_policy: crate::model::cloud_sql_settings::SqlActivationPolicy,
pub ip_config: std::option::Option<crate::model::SqlIpConfig>,
pub auto_storage_increase: std::option::Option<wkt::BoolValue>,
pub database_flags: std::collections::HashMap<std::string::String, std::string::String>,
pub data_disk_type: crate::model::cloud_sql_settings::SqlDataDiskType,
pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
pub zone: std::string::String,
pub secondary_zone: std::string::String,
pub source_id: std::string::String,
pub root_password: std::string::String,
pub root_password_set: bool,
pub collation: std::string::String,
pub cmek_key_name: std::string::String,
pub availability_type: crate::model::cloud_sql_settings::SqlAvailabilityType,
pub edition: crate::model::cloud_sql_settings::Edition,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudSqlSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database_version<
T: std::convert::Into<crate::model::cloud_sql_settings::SqlDatabaseVersion>,
>(
mut self,
v: T,
) -> Self {
self.database_version = 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_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tier = 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::cloud_sql_settings::SqlActivationPolicy>,
>(
mut self,
v: T,
) -> Self {
self.activation_policy = v.into();
self
}
pub fn set_ip_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SqlIpConfig>,
{
self.ip_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SqlIpConfig>,
{
self.ip_config = v.map(|x| x.into());
self
}
pub fn set_auto_storage_increase<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.auto_storage_increase = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auto_storage_increase<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::BoolValue>,
{
self.auto_storage_increase = v.map(|x| x.into());
self
}
pub fn set_database_flags<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.database_flags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_data_disk_type<
T: std::convert::Into<crate::model::cloud_sql_settings::SqlDataDiskType>,
>(
mut self,
v: T,
) -> Self {
self.data_disk_type = v.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_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_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_id = v.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_root_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.root_password_set = 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_cmek_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cmek_key_name = v.into();
self
}
pub fn set_availability_type<
T: std::convert::Into<crate::model::cloud_sql_settings::SqlAvailabilityType>,
>(
mut self,
v: T,
) -> Self {
self.availability_type = v.into();
self
}
pub fn set_edition<T: std::convert::Into<crate::model::cloud_sql_settings::Edition>>(
mut self,
v: T,
) -> Self {
self.edition = v.into();
self
}
}
impl wkt::message::Message for CloudSqlSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.CloudSqlSettings"
}
}
pub mod cloud_sql_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlActivationPolicy {
Unspecified,
Always,
Never,
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::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::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,
_ => 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,
_ => 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::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.clouddms.v1.CloudSqlSettings.SqlActivationPolicy",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlDataDiskType {
Unspecified,
PdSsd,
PdHdd,
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::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::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,
_ => 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,
_ => 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::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.clouddms.v1.CloudSqlSettings.SqlDataDiskType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SqlDatabaseVersion {
Unspecified,
Mysql56,
Mysql57,
Postgres96,
Postgres11,
Postgres10,
Mysql80,
Postgres12,
Postgres13,
Postgres14,
Postgres15,
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::Mysql56 => std::option::Option::Some(1),
Self::Mysql57 => std::option::Option::Some(2),
Self::Postgres96 => std::option::Option::Some(3),
Self::Postgres11 => std::option::Option::Some(4),
Self::Postgres10 => std::option::Option::Some(5),
Self::Mysql80 => std::option::Option::Some(6),
Self::Postgres12 => std::option::Option::Some(7),
Self::Postgres13 => std::option::Option::Some(8),
Self::Postgres14 => std::option::Option::Some(17),
Self::Postgres15 => std::option::Option::Some(18),
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::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
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::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,
1 => Self::Mysql56,
2 => Self::Mysql57,
3 => Self::Postgres96,
4 => Self::Postgres11,
5 => Self::Postgres10,
6 => Self::Mysql80,
7 => Self::Postgres12,
8 => Self::Postgres13,
17 => Self::Postgres14,
18 => Self::Postgres15,
_ => 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_6" => Self::Mysql56,
"MYSQL_5_7" => Self::Mysql57,
"POSTGRES_9_6" => Self::Postgres96,
"POSTGRES_11" => Self::Postgres11,
"POSTGRES_10" => Self::Postgres10,
"MYSQL_8_0" => Self::Mysql80,
"POSTGRES_12" => Self::Postgres12,
"POSTGRES_13" => Self::Postgres13,
"POSTGRES_14" => Self::Postgres14,
"POSTGRES_15" => Self::Postgres15,
_ => 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::Mysql56 => serializer.serialize_i32(1),
Self::Mysql57 => serializer.serialize_i32(2),
Self::Postgres96 => serializer.serialize_i32(3),
Self::Postgres11 => serializer.serialize_i32(4),
Self::Postgres10 => serializer.serialize_i32(5),
Self::Mysql80 => serializer.serialize_i32(6),
Self::Postgres12 => serializer.serialize_i32(7),
Self::Postgres13 => serializer.serialize_i32(8),
Self::Postgres14 => serializer.serialize_i32(17),
Self::Postgres15 => serializer.serialize_i32(18),
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.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion",
))
}
}
#[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.clouddms.v1.CloudSqlSettings.SqlAvailabilityType",
))
}
}
#[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.clouddms.v1.CloudSqlSettings.Edition",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AlloyDbSettings {
pub initial_user: std::option::Option<crate::model::alloy_db_settings::UserPassword>,
pub vpc_network: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
#[allow(missing_docs)]
pub primary_instance_settings:
std::option::Option<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
pub encryption_config: std::option::Option<crate::model::alloy_db_settings::EncryptionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AlloyDbSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_initial_user<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::alloy_db_settings::UserPassword>,
{
self.initial_user = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_initial_user<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::alloy_db_settings::UserPassword>,
{
self.initial_user = v.map(|x| x.into());
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_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.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_primary_instance_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
{
self.primary_instance_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_primary_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::alloy_db_settings::PrimaryInstanceSettings>,
{
self.primary_instance_settings = v.map(|x| x.into());
self
}
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::alloy_db_settings::EncryptionConfig>,
{
self.encryption_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::alloy_db_settings::EncryptionConfig>,
{
self.encryption_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AlloyDbSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings"
}
}
pub mod alloy_db_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserPassword {
pub user: std::string::String,
pub password: std::string::String,
pub password_set: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserPassword {
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_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.password = v.into();
self
}
pub fn set_password_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.password_set = v.into();
self
}
}
impl wkt::message::Message for UserPassword {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.UserPassword"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PrimaryInstanceSettings {
pub id: std::string::String,
pub machine_config: std::option::Option<
crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
>,
pub database_flags: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub private_ip: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PrimaryInstanceSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_machine_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
>,
{
self.machine_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_machine_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::alloy_db_settings::primary_instance_settings::MachineConfig,
>,
{
self.machine_config = v.map(|x| x.into());
self
}
pub fn set_database_flags<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.database_flags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_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.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_private_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.private_ip = v.into();
self
}
}
impl wkt::message::Message for PrimaryInstanceSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings"
}
}
pub mod primary_instance_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineConfig {
pub cpu_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_count = v.into();
self
}
}
impl wkt::message::Message for MachineConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
pub kms_key_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionConfig {
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
}
}
impl wkt::message::Message for EncryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StaticIpConnectivity {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StaticIpConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for StaticIpConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.StaticIpConnectivity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PrivateServiceConnectConnectivity {
pub service_attachment: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PrivateServiceConnectConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_attachment = v.into();
self
}
}
impl wkt::message::Message for PrivateServiceConnectConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.PrivateServiceConnectConnectivity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReverseSshConnectivity {
pub vm_ip: std::string::String,
pub vm_port: i32,
pub vm: std::string::String,
pub vpc: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReverseSshConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_ip = v.into();
self
}
pub fn set_vm_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.vm_port = v.into();
self
}
pub fn set_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm = v.into();
self
}
pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc = v.into();
self
}
}
impl wkt::message::Message for ReverseSshConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ReverseSshConnectivity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VpcPeeringConnectivity {
pub vpc: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VpcPeeringConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc = v.into();
self
}
}
impl wkt::message::Message for VpcPeeringConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.VpcPeeringConnectivity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ForwardSshTunnelConnectivity {
pub hostname: std::string::String,
pub username: std::string::String,
pub port: i32,
#[allow(missing_docs)]
pub authentication_method:
std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ForwardSshTunnelConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hostname = 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_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = v.into();
self
}
pub fn set_authentication_method<
T: std::convert::Into<
std::option::Option<
crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.authentication_method = v.into();
self
}
pub fn password(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.authentication_method.as_ref().and_then(|v| match v {
crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.authentication_method = std::option::Option::Some(
crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
);
self
}
pub fn private_key(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.authentication_method.as_ref().and_then(|v| match v {
crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.authentication_method = std::option::Option::Some(
crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
v.into(),
),
);
self
}
}
impl wkt::message::Message for ForwardSshTunnelConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ForwardSshTunnelConnectivity"
}
}
pub mod forward_ssh_tunnel_connectivity {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthenticationMethod {
Password(std::string::String),
PrivateKey(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StaticServiceIpConnectivity {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StaticServiceIpConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for StaticServiceIpConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.StaticServiceIpConnectivity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PrivateConnectivity {
pub private_connection: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PrivateConnectivity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.private_connection = v.into();
self
}
}
impl wkt::message::Message for PrivateConnectivity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.PrivateConnectivity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseType {
pub provider: crate::model::DatabaseProvider,
pub engine: crate::model::DatabaseEngine,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabaseType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_provider<T: std::convert::Into<crate::model::DatabaseProvider>>(
mut self,
v: T,
) -> Self {
self.provider = v.into();
self
}
pub fn set_engine<T: std::convert::Into<crate::model::DatabaseEngine>>(mut self, v: T) -> Self {
self.engine = v.into();
self
}
}
impl wkt::message::Message for DatabaseType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DatabaseType"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MigrationJob {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub display_name: std::string::String,
pub state: crate::model::migration_job::State,
pub phase: crate::model::migration_job::Phase,
pub r#type: crate::model::migration_job::Type,
pub dump_path: std::string::String,
pub dump_flags: std::option::Option<crate::model::migration_job::DumpFlags>,
pub source: std::string::String,
pub destination: std::string::String,
pub duration: std::option::Option<wkt::Duration>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub source_database: std::option::Option<crate::model::DatabaseType>,
pub destination_database: std::option::Option<crate::model::DatabaseType>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub conversion_workspace: std::option::Option<crate::model::ConversionWorkspaceInfo>,
pub filter: std::string::String,
pub cmek_key_name: std::string::String,
pub performance_config: std::option::Option<crate::model::migration_job::PerformanceConfig>,
pub connectivity: std::option::Option<crate::model::migration_job::Connectivity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MigrationJob {
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_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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_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.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::migration_job::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_phase<T: std::convert::Into<crate::model::migration_job::Phase>>(
mut self,
v: T,
) -> Self {
self.phase = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::migration_job::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_dump_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dump_path = v.into();
self
}
pub fn set_dump_flags<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::migration_job::DumpFlags>,
{
self.dump_flags = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dump_flags<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::migration_job::DumpFlags>,
{
self.dump_flags = v.map(|x| x.into());
self
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination = v.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
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
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<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_source_database<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseType>,
{
self.source_database = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_database<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseType>,
{
self.source_database = v.map(|x| x.into());
self
}
pub fn set_destination_database<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseType>,
{
self.destination_database = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination_database<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseType>,
{
self.destination_database = 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_conversion_workspace<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConversionWorkspaceInfo>,
{
self.conversion_workspace = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConversionWorkspaceInfo>,
{
self.conversion_workspace = v.map(|x| x.into());
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cmek_key_name = v.into();
self
}
pub fn set_performance_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::migration_job::PerformanceConfig>,
{
self.performance_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::migration_job::PerformanceConfig>,
{
self.performance_config = v.map(|x| x.into());
self
}
pub fn set_connectivity<
T: std::convert::Into<std::option::Option<crate::model::migration_job::Connectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = v.into();
self
}
pub fn reverse_ssh_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReverseSshConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::migration_job::Connectivity::ReverseSshConnectivity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_reverse_ssh_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::ReverseSshConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::migration_job::Connectivity::ReverseSshConnectivity(v.into()),
);
self
}
pub fn vpc_peering_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VpcPeeringConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::migration_job::Connectivity::VpcPeeringConnectivity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vpc_peering_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::VpcPeeringConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::migration_job::Connectivity::VpcPeeringConnectivity(v.into()),
);
self
}
pub fn static_ip_connectivity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StaticIpConnectivity>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::migration_job::Connectivity::StaticIpConnectivity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_static_ip_connectivity<
T: std::convert::Into<std::boxed::Box<crate::model::StaticIpConnectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::migration_job::Connectivity::StaticIpConnectivity(v.into()),
);
self
}
}
impl wkt::message::Message for MigrationJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MigrationJob"
}
}
pub mod migration_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DumpFlag {
pub name: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DumpFlag {
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 DumpFlag {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.DumpFlag"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DumpFlags {
pub dump_flags: std::vec::Vec<crate::model::migration_job::DumpFlag>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DumpFlags {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dump_flags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::migration_job::DumpFlag>,
{
use std::iter::Iterator;
self.dump_flags = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DumpFlags {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.DumpFlags"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PerformanceConfig {
pub dump_parallel_level: crate::model::migration_job::performance_config::DumpParallelLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PerformanceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dump_parallel_level<
T: std::convert::Into<crate::model::migration_job::performance_config::DumpParallelLevel>,
>(
mut self,
v: T,
) -> Self {
self.dump_parallel_level = v.into();
self
}
}
impl wkt::message::Message for PerformanceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MigrationJob.PerformanceConfig"
}
}
pub mod performance_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DumpParallelLevel {
Unspecified,
Min,
Optimal,
Max,
UnknownValue(dump_parallel_level::UnknownValue),
}
#[doc(hidden)]
pub mod dump_parallel_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DumpParallelLevel {
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("DUMP_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 DumpParallelLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DumpParallelLevel {
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 DumpParallelLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Min,
2 => Self::Optimal,
3 => Self::Max,
_ => Self::UnknownValue(dump_parallel_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DumpParallelLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DUMP_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
"MIN" => Self::Min,
"OPTIMAL" => Self::Optimal,
"MAX" => Self::Max,
_ => Self::UnknownValue(dump_parallel_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DumpParallelLevel {
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 DumpParallelLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DumpParallelLevel>::new(
".google.cloud.clouddms.v1.MigrationJob.PerformanceConfig.DumpParallelLevel",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Maintenance,
Draft,
Creating,
NotStarted,
Running,
Failed,
Completed,
Deleting,
Stopping,
Stopped,
Deleted,
Updating,
Starting,
Restarting,
Resuming,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Maintenance => std::option::Option::Some(1),
Self::Draft => std::option::Option::Some(2),
Self::Creating => std::option::Option::Some(3),
Self::NotStarted => std::option::Option::Some(4),
Self::Running => std::option::Option::Some(5),
Self::Failed => std::option::Option::Some(6),
Self::Completed => std::option::Option::Some(7),
Self::Deleting => std::option::Option::Some(8),
Self::Stopping => std::option::Option::Some(9),
Self::Stopped => std::option::Option::Some(10),
Self::Deleted => std::option::Option::Some(11),
Self::Updating => std::option::Option::Some(12),
Self::Starting => std::option::Option::Some(13),
Self::Restarting => std::option::Option::Some(14),
Self::Resuming => std::option::Option::Some(15),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
Self::Draft => std::option::Option::Some("DRAFT"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Completed => std::option::Option::Some("COMPLETED"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Stopping => std::option::Option::Some("STOPPING"),
Self::Stopped => std::option::Option::Some("STOPPED"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Starting => std::option::Option::Some("STARTING"),
Self::Restarting => std::option::Option::Some("RESTARTING"),
Self::Resuming => std::option::Option::Some("RESUMING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Maintenance,
2 => Self::Draft,
3 => Self::Creating,
4 => Self::NotStarted,
5 => Self::Running,
6 => Self::Failed,
7 => Self::Completed,
8 => Self::Deleting,
9 => Self::Stopping,
10 => Self::Stopped,
11 => Self::Deleted,
12 => Self::Updating,
13 => Self::Starting,
14 => Self::Restarting,
15 => Self::Resuming,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"MAINTENANCE" => Self::Maintenance,
"DRAFT" => Self::Draft,
"CREATING" => Self::Creating,
"NOT_STARTED" => Self::NotStarted,
"RUNNING" => Self::Running,
"FAILED" => Self::Failed,
"COMPLETED" => Self::Completed,
"DELETING" => Self::Deleting,
"STOPPING" => Self::Stopping,
"STOPPED" => Self::Stopped,
"DELETED" => Self::Deleted,
"UPDATING" => Self::Updating,
"STARTING" => Self::Starting,
"RESTARTING" => Self::Restarting,
"RESUMING" => Self::Resuming,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Maintenance => serializer.serialize_i32(1),
Self::Draft => serializer.serialize_i32(2),
Self::Creating => serializer.serialize_i32(3),
Self::NotStarted => serializer.serialize_i32(4),
Self::Running => serializer.serialize_i32(5),
Self::Failed => serializer.serialize_i32(6),
Self::Completed => serializer.serialize_i32(7),
Self::Deleting => serializer.serialize_i32(8),
Self::Stopping => serializer.serialize_i32(9),
Self::Stopped => serializer.serialize_i32(10),
Self::Deleted => serializer.serialize_i32(11),
Self::Updating => serializer.serialize_i32(12),
Self::Starting => serializer.serialize_i32(13),
Self::Restarting => serializer.serialize_i32(14),
Self::Resuming => serializer.serialize_i32(15),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.clouddms.v1.MigrationJob.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Phase {
Unspecified,
FullDump,
Cdc,
PromoteInProgress,
WaitingForSourceWritesToStop,
PreparingTheDump,
UnknownValue(phase::UnknownValue),
}
#[doc(hidden)]
pub mod phase {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Phase {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FullDump => std::option::Option::Some(1),
Self::Cdc => std::option::Option::Some(2),
Self::PromoteInProgress => std::option::Option::Some(3),
Self::WaitingForSourceWritesToStop => std::option::Option::Some(4),
Self::PreparingTheDump => 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("PHASE_UNSPECIFIED"),
Self::FullDump => std::option::Option::Some("FULL_DUMP"),
Self::Cdc => std::option::Option::Some("CDC"),
Self::PromoteInProgress => std::option::Option::Some("PROMOTE_IN_PROGRESS"),
Self::WaitingForSourceWritesToStop => {
std::option::Option::Some("WAITING_FOR_SOURCE_WRITES_TO_STOP")
}
Self::PreparingTheDump => std::option::Option::Some("PREPARING_THE_DUMP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Phase {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Phase {
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 Phase {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FullDump,
2 => Self::Cdc,
3 => Self::PromoteInProgress,
4 => Self::WaitingForSourceWritesToStop,
5 => Self::PreparingTheDump,
_ => Self::UnknownValue(phase::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Phase {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PHASE_UNSPECIFIED" => Self::Unspecified,
"FULL_DUMP" => Self::FullDump,
"CDC" => Self::Cdc,
"PROMOTE_IN_PROGRESS" => Self::PromoteInProgress,
"WAITING_FOR_SOURCE_WRITES_TO_STOP" => Self::WaitingForSourceWritesToStop,
"PREPARING_THE_DUMP" => Self::PreparingTheDump,
_ => Self::UnknownValue(phase::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Phase {
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::FullDump => serializer.serialize_i32(1),
Self::Cdc => serializer.serialize_i32(2),
Self::PromoteInProgress => serializer.serialize_i32(3),
Self::WaitingForSourceWritesToStop => serializer.serialize_i32(4),
Self::PreparingTheDump => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Phase {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Phase>::new(
".google.cloud.clouddms.v1.MigrationJob.Phase",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
OneTime,
Continuous,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OneTime => std::option::Option::Some(1),
Self::Continuous => 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("TYPE_UNSPECIFIED"),
Self::OneTime => std::option::Option::Some("ONE_TIME"),
Self::Continuous => std::option::Option::Some("CONTINUOUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
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 Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OneTime,
2 => Self::Continuous,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ONE_TIME" => Self::OneTime,
"CONTINUOUS" => Self::Continuous,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
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::OneTime => serializer.serialize_i32(1),
Self::Continuous => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.clouddms.v1.MigrationJob.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Connectivity {
ReverseSshConnectivity(std::boxed::Box<crate::model::ReverseSshConnectivity>),
VpcPeeringConnectivity(std::boxed::Box<crate::model::VpcPeeringConnectivity>),
StaticIpConnectivity(std::boxed::Box<crate::model::StaticIpConnectivity>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConversionWorkspaceInfo {
pub name: std::string::String,
pub commit_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConversionWorkspaceInfo {
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_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.commit_id = v.into();
self
}
}
impl wkt::message::Message for ConversionWorkspaceInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConversionWorkspaceInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectionProfile {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub state: crate::model::connection_profile::State,
pub display_name: std::string::String,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub provider: crate::model::DatabaseProvider,
pub connection_profile:
std::option::Option<crate::model::connection_profile::ConnectionProfile>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectionProfile {
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_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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_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.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::connection_profile::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
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<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_provider<T: std::convert::Into<crate::model::DatabaseProvider>>(
mut self,
v: T,
) -> Self {
self.provider = v.into();
self
}
pub fn set_connection_profile<
T: std::convert::Into<
std::option::Option<crate::model::connection_profile::ConnectionProfile>,
>,
>(
mut self,
v: T,
) -> Self {
self.connection_profile = v.into();
self
}
pub fn mysql(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MySqlConnectionProfile>> {
#[allow(unreachable_patterns)]
self.connection_profile.as_ref().and_then(|v| match v {
crate::model::connection_profile::ConnectionProfile::Mysql(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_mysql<
T: std::convert::Into<std::boxed::Box<crate::model::MySqlConnectionProfile>>,
>(
mut self,
v: T,
) -> Self {
self.connection_profile = std::option::Option::Some(
crate::model::connection_profile::ConnectionProfile::Mysql(v.into()),
);
self
}
pub fn postgresql(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PostgreSqlConnectionProfile>> {
#[allow(unreachable_patterns)]
self.connection_profile.as_ref().and_then(|v| match v {
crate::model::connection_profile::ConnectionProfile::Postgresql(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_postgresql<
T: std::convert::Into<std::boxed::Box<crate::model::PostgreSqlConnectionProfile>>,
>(
mut self,
v: T,
) -> Self {
self.connection_profile = std::option::Option::Some(
crate::model::connection_profile::ConnectionProfile::Postgresql(v.into()),
);
self
}
pub fn oracle(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::OracleConnectionProfile>> {
#[allow(unreachable_patterns)]
self.connection_profile.as_ref().and_then(|v| match v {
crate::model::connection_profile::ConnectionProfile::Oracle(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_oracle<
T: std::convert::Into<std::boxed::Box<crate::model::OracleConnectionProfile>>,
>(
mut self,
v: T,
) -> Self {
self.connection_profile = std::option::Option::Some(
crate::model::connection_profile::ConnectionProfile::Oracle(v.into()),
);
self
}
pub fn cloudsql(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlConnectionProfile>> {
#[allow(unreachable_patterns)]
self.connection_profile.as_ref().and_then(|v| match v {
crate::model::connection_profile::ConnectionProfile::Cloudsql(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_cloudsql<
T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlConnectionProfile>>,
>(
mut self,
v: T,
) -> Self {
self.connection_profile = std::option::Option::Some(
crate::model::connection_profile::ConnectionProfile::Cloudsql(v.into()),
);
self
}
pub fn alloydb(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AlloyDbConnectionProfile>> {
#[allow(unreachable_patterns)]
self.connection_profile.as_ref().and_then(|v| match v {
crate::model::connection_profile::ConnectionProfile::Alloydb(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_alloydb<
T: std::convert::Into<std::boxed::Box<crate::model::AlloyDbConnectionProfile>>,
>(
mut self,
v: T,
) -> Self {
self.connection_profile = std::option::Option::Some(
crate::model::connection_profile::ConnectionProfile::Alloydb(v.into()),
);
self
}
}
impl wkt::message::Message for ConnectionProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConnectionProfile"
}
}
pub mod connection_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Draft,
Creating,
Ready,
Updating,
Deleting,
Deleted,
Failed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Draft => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Ready => std::option::Option::Some(3),
Self::Updating => std::option::Option::Some(4),
Self::Deleting => std::option::Option::Some(5),
Self::Deleted => std::option::Option::Some(6),
Self::Failed => 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("STATE_UNSPECIFIED"),
Self::Draft => std::option::Option::Some("DRAFT"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Ready => std::option::Option::Some("READY"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Draft,
2 => Self::Creating,
3 => Self::Ready,
4 => Self::Updating,
5 => Self::Deleting,
6 => Self::Deleted,
7 => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"DRAFT" => Self::Draft,
"CREATING" => Self::Creating,
"READY" => Self::Ready,
"UPDATING" => Self::Updating,
"DELETING" => Self::Deleting,
"DELETED" => Self::Deleted,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Draft => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Ready => serializer.serialize_i32(3),
Self::Updating => serializer.serialize_i32(4),
Self::Deleting => serializer.serialize_i32(5),
Self::Deleted => serializer.serialize_i32(6),
Self::Failed => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.clouddms.v1.ConnectionProfile.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectionProfile {
Mysql(std::boxed::Box<crate::model::MySqlConnectionProfile>),
Postgresql(std::boxed::Box<crate::model::PostgreSqlConnectionProfile>),
Oracle(std::boxed::Box<crate::model::OracleConnectionProfile>),
Cloudsql(std::boxed::Box<crate::model::CloudSqlConnectionProfile>),
Alloydb(std::boxed::Box<crate::model::AlloyDbConnectionProfile>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MigrationJobVerificationError {
pub error_code: crate::model::migration_job_verification_error::ErrorCode,
pub error_message: std::string::String,
pub error_detail_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MigrationJobVerificationError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_error_code<
T: std::convert::Into<crate::model::migration_job_verification_error::ErrorCode>,
>(
mut self,
v: T,
) -> Self {
self.error_code = v.into();
self
}
pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.error_message = v.into();
self
}
pub fn set_error_detail_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.error_detail_message = v.into();
self
}
}
impl wkt::message::Message for MigrationJobVerificationError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MigrationJobVerificationError"
}
}
pub mod migration_job_verification_error {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ErrorCode {
Unspecified,
ConnectionFailure,
AuthenticationFailure,
InvalidConnectionProfileConfig,
VersionIncompatibility,
ConnectionProfileTypesIncompatibility,
NoPglogicalInstalled,
PglogicalNodeAlreadyExists,
InvalidWalLevel,
InvalidSharedPreloadLibrary,
InsufficientMaxReplicationSlots,
InsufficientMaxWalSenders,
InsufficientMaxWorkerProcesses,
UnsupportedExtensions,
UnsupportedMigrationType,
InvalidRdsLogicalReplication,
UnsupportedGtidMode,
UnsupportedTableDefinition,
UnsupportedDefiner,
CantRestartRunningMigration,
SourceAlreadySetup,
TablesWithLimitedSupport,
UnsupportedDatabaseLocale,
UnsupportedDatabaseFdwConfig,
ErrorRdbms,
SourceSizeExceedsThreshold,
ExistingConflictingDatabases,
ParallelImportInsufficientPrivilege,
UnknownValue(error_code::UnknownValue),
}
#[doc(hidden)]
pub mod error_code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ErrorCode {
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::AuthenticationFailure => std::option::Option::Some(2),
Self::InvalidConnectionProfileConfig => std::option::Option::Some(3),
Self::VersionIncompatibility => std::option::Option::Some(4),
Self::ConnectionProfileTypesIncompatibility => std::option::Option::Some(5),
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::UnsupportedMigrationType => std::option::Option::Some(15),
Self::InvalidRdsLogicalReplication => std::option::Option::Some(16),
Self::UnsupportedGtidMode => std::option::Option::Some(17),
Self::UnsupportedTableDefinition => std::option::Option::Some(18),
Self::UnsupportedDefiner => std::option::Option::Some(19),
Self::CantRestartRunningMigration => std::option::Option::Some(21),
Self::SourceAlreadySetup => std::option::Option::Some(23),
Self::TablesWithLimitedSupport => std::option::Option::Some(24),
Self::UnsupportedDatabaseLocale => std::option::Option::Some(25),
Self::UnsupportedDatabaseFdwConfig => std::option::Option::Some(26),
Self::ErrorRdbms => std::option::Option::Some(27),
Self::SourceSizeExceedsThreshold => std::option::Option::Some(28),
Self::ExistingConflictingDatabases => std::option::Option::Some(29),
Self::ParallelImportInsufficientPrivilege => std::option::Option::Some(30),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
Self::AuthenticationFailure => std::option::Option::Some("AUTHENTICATION_FAILURE"),
Self::InvalidConnectionProfileConfig => {
std::option::Option::Some("INVALID_CONNECTION_PROFILE_CONFIG")
}
Self::VersionIncompatibility => {
std::option::Option::Some("VERSION_INCOMPATIBILITY")
}
Self::ConnectionProfileTypesIncompatibility => {
std::option::Option::Some("CONNECTION_PROFILE_TYPES_INCOMPATIBILITY")
}
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::UnsupportedMigrationType => {
std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
}
Self::InvalidRdsLogicalReplication => {
std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
}
Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
Self::UnsupportedTableDefinition => {
std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
}
Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
Self::CantRestartRunningMigration => {
std::option::Option::Some("CANT_RESTART_RUNNING_MIGRATION")
}
Self::SourceAlreadySetup => std::option::Option::Some("SOURCE_ALREADY_SETUP"),
Self::TablesWithLimitedSupport => {
std::option::Option::Some("TABLES_WITH_LIMITED_SUPPORT")
}
Self::UnsupportedDatabaseLocale => {
std::option::Option::Some("UNSUPPORTED_DATABASE_LOCALE")
}
Self::UnsupportedDatabaseFdwConfig => {
std::option::Option::Some("UNSUPPORTED_DATABASE_FDW_CONFIG")
}
Self::ErrorRdbms => std::option::Option::Some("ERROR_RDBMS"),
Self::SourceSizeExceedsThreshold => {
std::option::Option::Some("SOURCE_SIZE_EXCEEDS_THRESHOLD")
}
Self::ExistingConflictingDatabases => {
std::option::Option::Some("EXISTING_CONFLICTING_DATABASES")
}
Self::ParallelImportInsufficientPrivilege => {
std::option::Option::Some("PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ErrorCode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ErrorCode {
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 ErrorCode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ConnectionFailure,
2 => Self::AuthenticationFailure,
3 => Self::InvalidConnectionProfileConfig,
4 => Self::VersionIncompatibility,
5 => Self::ConnectionProfileTypesIncompatibility,
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::UnsupportedMigrationType,
16 => Self::InvalidRdsLogicalReplication,
17 => Self::UnsupportedGtidMode,
18 => Self::UnsupportedTableDefinition,
19 => Self::UnsupportedDefiner,
21 => Self::CantRestartRunningMigration,
23 => Self::SourceAlreadySetup,
24 => Self::TablesWithLimitedSupport,
25 => Self::UnsupportedDatabaseLocale,
26 => Self::UnsupportedDatabaseFdwConfig,
27 => Self::ErrorRdbms,
28 => Self::SourceSizeExceedsThreshold,
29 => Self::ExistingConflictingDatabases,
30 => Self::ParallelImportInsufficientPrivilege,
_ => Self::UnknownValue(error_code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ErrorCode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
"CONNECTION_FAILURE" => Self::ConnectionFailure,
"AUTHENTICATION_FAILURE" => Self::AuthenticationFailure,
"INVALID_CONNECTION_PROFILE_CONFIG" => Self::InvalidConnectionProfileConfig,
"VERSION_INCOMPATIBILITY" => Self::VersionIncompatibility,
"CONNECTION_PROFILE_TYPES_INCOMPATIBILITY" => {
Self::ConnectionProfileTypesIncompatibility
}
"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,
"UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
"INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
"UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
"UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
"UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
"CANT_RESTART_RUNNING_MIGRATION" => Self::CantRestartRunningMigration,
"SOURCE_ALREADY_SETUP" => Self::SourceAlreadySetup,
"TABLES_WITH_LIMITED_SUPPORT" => Self::TablesWithLimitedSupport,
"UNSUPPORTED_DATABASE_LOCALE" => Self::UnsupportedDatabaseLocale,
"UNSUPPORTED_DATABASE_FDW_CONFIG" => Self::UnsupportedDatabaseFdwConfig,
"ERROR_RDBMS" => Self::ErrorRdbms,
"SOURCE_SIZE_EXCEEDS_THRESHOLD" => Self::SourceSizeExceedsThreshold,
"EXISTING_CONFLICTING_DATABASES" => Self::ExistingConflictingDatabases,
"PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
Self::ParallelImportInsufficientPrivilege
}
_ => Self::UnknownValue(error_code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ErrorCode {
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::AuthenticationFailure => serializer.serialize_i32(2),
Self::InvalidConnectionProfileConfig => serializer.serialize_i32(3),
Self::VersionIncompatibility => serializer.serialize_i32(4),
Self::ConnectionProfileTypesIncompatibility => serializer.serialize_i32(5),
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::UnsupportedMigrationType => serializer.serialize_i32(15),
Self::InvalidRdsLogicalReplication => serializer.serialize_i32(16),
Self::UnsupportedGtidMode => serializer.serialize_i32(17),
Self::UnsupportedTableDefinition => serializer.serialize_i32(18),
Self::UnsupportedDefiner => serializer.serialize_i32(19),
Self::CantRestartRunningMigration => serializer.serialize_i32(21),
Self::SourceAlreadySetup => serializer.serialize_i32(23),
Self::TablesWithLimitedSupport => serializer.serialize_i32(24),
Self::UnsupportedDatabaseLocale => serializer.serialize_i32(25),
Self::UnsupportedDatabaseFdwConfig => serializer.serialize_i32(26),
Self::ErrorRdbms => serializer.serialize_i32(27),
Self::SourceSizeExceedsThreshold => serializer.serialize_i32(28),
Self::ExistingConflictingDatabases => serializer.serialize_i32(29),
Self::ParallelImportInsufficientPrivilege => serializer.serialize_i32(30),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ErrorCode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
".google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PrivateConnection {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub display_name: std::string::String,
pub state: crate::model::private_connection::State,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
#[allow(missing_docs)]
pub connectivity: std::option::Option<crate::model::private_connection::Connectivity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PrivateConnection {
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_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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_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.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
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<google_cloud_rpc::model::Status>,
{
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<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_connectivity<
T: std::convert::Into<std::option::Option<crate::model::private_connection::Connectivity>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = v.into();
self
}
pub fn vpc_peering_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VpcPeeringConfig>> {
#[allow(unreachable_patterns)]
self.connectivity.as_ref().and_then(|v| match v {
crate::model::private_connection::Connectivity::VpcPeeringConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vpc_peering_config<
T: std::convert::Into<std::boxed::Box<crate::model::VpcPeeringConfig>>,
>(
mut self,
v: T,
) -> Self {
self.connectivity = std::option::Option::Some(
crate::model::private_connection::Connectivity::VpcPeeringConfig(v.into()),
);
self
}
}
impl wkt::message::Message for PrivateConnection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.PrivateConnection"
}
}
pub mod private_connection {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
#[allow(missing_docs)]
Unspecified,
Creating,
Created,
Failed,
Deleting,
FailedToDelete,
Deleted,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Creating => std::option::Option::Some(1),
Self::Created => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(4),
Self::FailedToDelete => std::option::Option::Some(5),
Self::Deleted => 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("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Created => std::option::Option::Some("CREATED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Creating,
2 => Self::Created,
3 => Self::Failed,
4 => Self::Deleting,
5 => Self::FailedToDelete,
6 => Self::Deleted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"CREATING" => Self::Creating,
"CREATED" => Self::Created,
"FAILED" => Self::Failed,
"DELETING" => Self::Deleting,
"FAILED_TO_DELETE" => Self::FailedToDelete,
"DELETED" => Self::Deleted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Creating => serializer.serialize_i32(1),
Self::Created => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(4),
Self::FailedToDelete => serializer.serialize_i32(5),
Self::Deleted => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.clouddms.v1.PrivateConnection.State",
))
}
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Connectivity {
VpcPeeringConfig(std::boxed::Box<crate::model::VpcPeeringConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VpcPeeringConfig {
pub vpc_name: std::string::String,
pub subnet: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VpcPeeringConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vpc_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_name = v.into();
self
}
pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnet = v.into();
self
}
}
impl wkt::message::Message for VpcPeeringConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.VpcPeeringConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseEngineInfo {
pub engine: crate::model::DatabaseEngine,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabaseEngineInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_engine<T: std::convert::Into<crate::model::DatabaseEngine>>(mut self, v: T) -> Self {
self.engine = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for DatabaseEngineInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DatabaseEngineInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConversionWorkspace {
pub name: std::string::String,
pub source: std::option::Option<crate::model::DatabaseEngineInfo>,
pub destination: std::option::Option<crate::model::DatabaseEngineInfo>,
pub global_settings: std::collections::HashMap<std::string::String, std::string::String>,
pub has_uncommitted_changes: bool,
pub latest_commit_id: std::string::String,
pub latest_commit_time: std::option::Option<wkt::Timestamp>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConversionWorkspace {
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_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseEngineInfo>,
{
self.source = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseEngineInfo>,
{
self.source = v.map(|x| x.into());
self
}
pub fn set_destination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatabaseEngineInfo>,
{
self.destination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatabaseEngineInfo>,
{
self.destination = v.map(|x| x.into());
self
}
pub fn set_global_settings<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.global_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_has_uncommitted_changes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.has_uncommitted_changes = v.into();
self
}
pub fn set_latest_commit_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.latest_commit_id = v.into();
self
}
pub fn set_latest_commit_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_commit_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_latest_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_commit_time = 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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for ConversionWorkspace {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConversionWorkspace"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackgroundJobLogEntry {
pub id: std::string::String,
pub job_type: crate::model::BackgroundJobType,
pub start_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub completion_state: crate::model::background_job_log_entry::JobCompletionState,
pub completion_comment: std::string::String,
pub request_autocommit: bool,
#[allow(missing_docs)]
pub job_details: std::option::Option<crate::model::background_job_log_entry::JobDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackgroundJobLogEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_job_type<T: std::convert::Into<crate::model::BackgroundJobType>>(
mut self,
v: T,
) -> Self {
self.job_type = 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_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
pub fn set_completion_state<
T: std::convert::Into<crate::model::background_job_log_entry::JobCompletionState>,
>(
mut self,
v: T,
) -> Self {
self.completion_state = v.into();
self
}
pub fn set_completion_comment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.completion_comment = v.into();
self
}
pub fn set_request_autocommit<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.request_autocommit = v.into();
self
}
pub fn set_job_details<
T: std::convert::Into<std::option::Option<crate::model::background_job_log_entry::JobDetails>>,
>(
mut self,
v: T,
) -> Self {
self.job_details = v.into();
self
}
pub fn seed_job_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>>
{
#[allow(unreachable_patterns)]
self.job_details.as_ref().and_then(|v| match v {
crate::model::background_job_log_entry::JobDetails::SeedJobDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_seed_job_details<
T: std::convert::Into<std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>>,
>(
mut self,
v: T,
) -> Self {
self.job_details = std::option::Option::Some(
crate::model::background_job_log_entry::JobDetails::SeedJobDetails(v.into()),
);
self
}
pub fn import_rules_job_details(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
> {
#[allow(unreachable_patterns)]
self.job_details.as_ref().and_then(|v| match v {
crate::model::background_job_log_entry::JobDetails::ImportRulesJobDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_import_rules_job_details<
T: std::convert::Into<
std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
>,
>(
mut self,
v: T,
) -> Self {
self.job_details = std::option::Option::Some(
crate::model::background_job_log_entry::JobDetails::ImportRulesJobDetails(v.into()),
);
self
}
pub fn convert_job_details(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
> {
#[allow(unreachable_patterns)]
self.job_details.as_ref().and_then(|v| match v {
crate::model::background_job_log_entry::JobDetails::ConvertJobDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_convert_job_details<
T: std::convert::Into<
std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
>,
>(
mut self,
v: T,
) -> Self {
self.job_details = std::option::Option::Some(
crate::model::background_job_log_entry::JobDetails::ConvertJobDetails(v.into()),
);
self
}
pub fn apply_job_details(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>,
> {
#[allow(unreachable_patterns)]
self.job_details.as_ref().and_then(|v| match v {
crate::model::background_job_log_entry::JobDetails::ApplyJobDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_apply_job_details<
T: std::convert::Into<
std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>,
>,
>(
mut self,
v: T,
) -> Self {
self.job_details = std::option::Option::Some(
crate::model::background_job_log_entry::JobDetails::ApplyJobDetails(v.into()),
);
self
}
}
impl wkt::message::Message for BackgroundJobLogEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry"
}
}
pub mod background_job_log_entry {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SeedJobDetails {
pub connection_profile: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SeedJobDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.connection_profile = v.into();
self
}
}
impl wkt::message::Message for SeedJobDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportRulesJobDetails {
pub files: std::vec::Vec<std::string::String>,
pub file_format: crate::model::ImportRulesFileFormat,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportRulesJobDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_files<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.files = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_format<T: std::convert::Into<crate::model::ImportRulesFileFormat>>(
mut self,
v: T,
) -> Self {
self.file_format = v.into();
self
}
}
impl wkt::message::Message for ImportRulesJobDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConvertJobDetails {
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConvertJobDetails {
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
}
}
impl wkt::message::Message for ConvertJobDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApplyJobDetails {
pub connection_profile: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApplyJobDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.connection_profile = 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 ApplyJobDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobCompletionState {
Unspecified,
Succeeded,
Failed,
UnknownValue(job_completion_state::UnknownValue),
}
#[doc(hidden)]
pub mod job_completion_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl JobCompletionState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => 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("JOB_COMPLETION_STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for JobCompletionState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for JobCompletionState {
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 JobCompletionState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
_ => Self::UnknownValue(job_completion_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for JobCompletionState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"JOB_COMPLETION_STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(job_completion_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for JobCompletionState {
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::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for JobCompletionState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobCompletionState>::new(
".google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState",
))
}
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobDetails {
SeedJobDetails(std::boxed::Box<crate::model::background_job_log_entry::SeedJobDetails>),
ImportRulesJobDetails(
std::boxed::Box<crate::model::background_job_log_entry::ImportRulesJobDetails>,
),
ConvertJobDetails(
std::boxed::Box<crate::model::background_job_log_entry::ConvertJobDetails>,
),
ApplyJobDetails(std::boxed::Box<crate::model::background_job_log_entry::ApplyJobDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MappingRuleFilter {
pub parent_entity: std::string::String,
pub entity_name_prefix: std::string::String,
pub entity_name_suffix: std::string::String,
pub entity_name_contains: std::string::String,
pub entities: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MappingRuleFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent_entity = v.into();
self
}
pub fn set_entity_name_prefix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entity_name_prefix = v.into();
self
}
pub fn set_entity_name_suffix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entity_name_suffix = v.into();
self
}
pub fn set_entity_name_contains<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.entity_name_contains = v.into();
self
}
pub fn set_entities<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.entities = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MappingRuleFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MappingRuleFilter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MappingRule {
pub name: std::string::String,
pub display_name: std::string::String,
pub state: crate::model::mapping_rule::State,
pub rule_scope: crate::model::DatabaseEntityType,
pub filter: std::option::Option<crate::model::MappingRuleFilter>,
pub rule_order: i64,
pub revision_id: std::string::String,
pub revision_create_time: std::option::Option<wkt::Timestamp>,
pub details: std::option::Option<crate::model::mapping_rule::Details>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MappingRule {
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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::mapping_rule::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_rule_scope<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.rule_scope = v.into();
self
}
pub fn set_filter<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MappingRuleFilter>,
{
self.filter = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MappingRuleFilter>,
{
self.filter = v.map(|x| x.into());
self
}
pub fn set_rule_order<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.rule_order = v.into();
self
}
pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision_id = v.into();
self
}
pub fn set_revision_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = v.map(|x| x.into());
self
}
pub fn set_details<
T: std::convert::Into<std::option::Option<crate::model::mapping_rule::Details>>,
>(
mut self,
v: T,
) -> Self {
self.details = v.into();
self
}
pub fn single_entity_rename(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SingleEntityRename>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::SingleEntityRename(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_single_entity_rename<
T: std::convert::Into<std::boxed::Box<crate::model::SingleEntityRename>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::SingleEntityRename(v.into()),
);
self
}
pub fn multi_entity_rename(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MultiEntityRename>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::MultiEntityRename(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_multi_entity_rename<
T: std::convert::Into<std::boxed::Box<crate::model::MultiEntityRename>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::MultiEntityRename(v.into()),
);
self
}
pub fn entity_move(&self) -> std::option::Option<&std::boxed::Box<crate::model::EntityMove>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::EntityMove(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_entity_move<T: std::convert::Into<std::boxed::Box<crate::model::EntityMove>>>(
mut self,
v: T,
) -> Self {
self.details =
std::option::Option::Some(crate::model::mapping_rule::Details::EntityMove(v.into()));
self
}
pub fn single_column_change(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SingleColumnChange>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::SingleColumnChange(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_single_column_change<
T: std::convert::Into<std::boxed::Box<crate::model::SingleColumnChange>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::SingleColumnChange(v.into()),
);
self
}
pub fn multi_column_data_type_change(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MultiColumnDatatypeChange>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::MultiColumnDataTypeChange(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_multi_column_data_type_change<
T: std::convert::Into<std::boxed::Box<crate::model::MultiColumnDatatypeChange>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::MultiColumnDataTypeChange(v.into()),
);
self
}
pub fn conditional_column_set_value(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ConditionalColumnSetValue>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::ConditionalColumnSetValue(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_conditional_column_set_value<
T: std::convert::Into<std::boxed::Box<crate::model::ConditionalColumnSetValue>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::ConditionalColumnSetValue(v.into()),
);
self
}
pub fn convert_rowid_column(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ConvertRowIdToColumn>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::ConvertRowidColumn(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_convert_rowid_column<
T: std::convert::Into<std::boxed::Box<crate::model::ConvertRowIdToColumn>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::ConvertRowidColumn(v.into()),
);
self
}
pub fn set_table_primary_key(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SetTablePrimaryKey>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::SetTablePrimaryKey(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_set_table_primary_key<
T: std::convert::Into<std::boxed::Box<crate::model::SetTablePrimaryKey>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::SetTablePrimaryKey(v.into()),
);
self
}
pub fn single_package_change(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SinglePackageChange>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::SinglePackageChange(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_single_package_change<
T: std::convert::Into<std::boxed::Box<crate::model::SinglePackageChange>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::SinglePackageChange(v.into()),
);
self
}
pub fn source_sql_change(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceSqlChange>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::SourceSqlChange(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_source_sql_change<
T: std::convert::Into<std::boxed::Box<crate::model::SourceSqlChange>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::SourceSqlChange(v.into()),
);
self
}
pub fn filter_table_columns(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::FilterTableColumns>> {
#[allow(unreachable_patterns)]
self.details.as_ref().and_then(|v| match v {
crate::model::mapping_rule::Details::FilterTableColumns(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_filter_table_columns<
T: std::convert::Into<std::boxed::Box<crate::model::FilterTableColumns>>,
>(
mut self,
v: T,
) -> Self {
self.details = std::option::Option::Some(
crate::model::mapping_rule::Details::FilterTableColumns(v.into()),
);
self
}
}
impl wkt::message::Message for MappingRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MappingRule"
}
}
pub mod mapping_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Enabled,
Disabled,
Deleted,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::Deleted => 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("STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
3 => Self::Deleted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"DELETED" => Self::Deleted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::Deleted => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.clouddms.v1.MappingRule.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Details {
SingleEntityRename(std::boxed::Box<crate::model::SingleEntityRename>),
MultiEntityRename(std::boxed::Box<crate::model::MultiEntityRename>),
EntityMove(std::boxed::Box<crate::model::EntityMove>),
SingleColumnChange(std::boxed::Box<crate::model::SingleColumnChange>),
MultiColumnDataTypeChange(std::boxed::Box<crate::model::MultiColumnDatatypeChange>),
ConditionalColumnSetValue(std::boxed::Box<crate::model::ConditionalColumnSetValue>),
ConvertRowidColumn(std::boxed::Box<crate::model::ConvertRowIdToColumn>),
SetTablePrimaryKey(std::boxed::Box<crate::model::SetTablePrimaryKey>),
SinglePackageChange(std::boxed::Box<crate::model::SinglePackageChange>),
SourceSqlChange(std::boxed::Box<crate::model::SourceSqlChange>),
FilterTableColumns(std::boxed::Box<crate::model::FilterTableColumns>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SingleEntityRename {
pub new_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SingleEntityRename {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_new_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_name = v.into();
self
}
}
impl wkt::message::Message for SingleEntityRename {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SingleEntityRename"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiEntityRename {
pub new_name_pattern: std::string::String,
pub source_name_transformation: crate::model::EntityNameTransformation,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiEntityRename {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_new_name_pattern<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.new_name_pattern = v.into();
self
}
pub fn set_source_name_transformation<
T: std::convert::Into<crate::model::EntityNameTransformation>,
>(
mut self,
v: T,
) -> Self {
self.source_name_transformation = v.into();
self
}
}
impl wkt::message::Message for MultiEntityRename {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MultiEntityRename"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityMove {
pub new_schema: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityMove {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_new_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_schema = v.into();
self
}
}
impl wkt::message::Message for EntityMove {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.EntityMove"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SingleColumnChange {
pub data_type: std::string::String,
pub charset: std::string::String,
pub collation: std::string::String,
pub length: i64,
pub precision: i32,
pub scale: i32,
pub fractional_seconds_precision: i32,
pub array: bool,
pub array_length: i32,
pub nullable: bool,
pub auto_generated: bool,
pub udt: bool,
pub custom_features: std::option::Option<wkt::Struct>,
pub set_values: std::vec::Vec<std::string::String>,
pub comment: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SingleColumnChange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_type = 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_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.length = v.into();
self
}
pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.precision = v.into();
self
}
pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.scale = v.into();
self
}
pub fn set_fractional_seconds_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.fractional_seconds_precision = v.into();
self
}
pub fn set_array<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.array = v.into();
self
}
pub fn set_array_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.array_length = v.into();
self
}
pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.nullable = v.into();
self
}
pub fn set_auto_generated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.auto_generated = v.into();
self
}
pub fn set_udt<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.udt = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_set_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.set_values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.comment = v.into();
self
}
}
impl wkt::message::Message for SingleColumnChange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SingleColumnChange"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiColumnDatatypeChange {
pub source_data_type_filter: std::string::String,
pub new_data_type: std::string::String,
pub override_length: i64,
pub override_scale: i32,
pub override_precision: i32,
pub override_fractional_seconds_precision: i32,
pub custom_features: std::option::Option<wkt::Struct>,
pub source_filter:
std::option::Option<crate::model::multi_column_datatype_change::SourceFilter>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiColumnDatatypeChange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_data_type_filter<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_data_type_filter = v.into();
self
}
pub fn set_new_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.new_data_type = v.into();
self
}
pub fn set_override_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.override_length = v.into();
self
}
pub fn set_override_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.override_scale = v.into();
self
}
pub fn set_override_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.override_precision = v.into();
self
}
pub fn set_override_fractional_seconds_precision<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.override_fractional_seconds_precision = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_source_filter<
T: std::convert::Into<
std::option::Option<crate::model::multi_column_datatype_change::SourceFilter>,
>,
>(
mut self,
v: T,
) -> Self {
self.source_filter = v.into();
self
}
pub fn source_text_filter(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceTextFilter>> {
#[allow(unreachable_patterns)]
self.source_filter.as_ref().and_then(|v| match v {
crate::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_text_filter<
T: std::convert::Into<std::boxed::Box<crate::model::SourceTextFilter>>,
>(
mut self,
v: T,
) -> Self {
self.source_filter = std::option::Option::Some(
crate::model::multi_column_datatype_change::SourceFilter::SourceTextFilter(v.into()),
);
self
}
pub fn source_numeric_filter(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceNumericFilter>> {
#[allow(unreachable_patterns)]
self.source_filter.as_ref().and_then(|v| match v {
crate::model::multi_column_datatype_change::SourceFilter::SourceNumericFilter(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_numeric_filter<
T: std::convert::Into<std::boxed::Box<crate::model::SourceNumericFilter>>,
>(
mut self,
v: T,
) -> Self {
self.source_filter = std::option::Option::Some(
crate::model::multi_column_datatype_change::SourceFilter::SourceNumericFilter(v.into()),
);
self
}
}
impl wkt::message::Message for MultiColumnDatatypeChange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MultiColumnDatatypeChange"
}
}
pub mod multi_column_datatype_change {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceFilter {
SourceTextFilter(std::boxed::Box<crate::model::SourceTextFilter>),
SourceNumericFilter(std::boxed::Box<crate::model::SourceNumericFilter>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceTextFilter {
pub source_min_length_filter: i64,
pub source_max_length_filter: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceTextFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_min_length_filter<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.source_min_length_filter = v.into();
self
}
pub fn set_source_max_length_filter<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.source_max_length_filter = v.into();
self
}
}
impl wkt::message::Message for SourceTextFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SourceTextFilter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceNumericFilter {
pub source_min_scale_filter: i32,
pub source_max_scale_filter: i32,
pub source_min_precision_filter: i32,
pub source_max_precision_filter: i32,
pub numeric_filter_option: crate::model::NumericFilterOption,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceNumericFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_min_scale_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_min_scale_filter = v.into();
self
}
pub fn set_source_max_scale_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_max_scale_filter = v.into();
self
}
pub fn set_source_min_precision_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_min_precision_filter = v.into();
self
}
pub fn set_source_max_precision_filter<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_max_precision_filter = v.into();
self
}
pub fn set_numeric_filter_option<T: std::convert::Into<crate::model::NumericFilterOption>>(
mut self,
v: T,
) -> Self {
self.numeric_filter_option = v.into();
self
}
}
impl wkt::message::Message for SourceNumericFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SourceNumericFilter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConditionalColumnSetValue {
pub value_transformation: std::option::Option<crate::model::ValueTransformation>,
pub custom_features: std::option::Option<wkt::Struct>,
#[allow(missing_docs)]
pub source_filter:
std::option::Option<crate::model::conditional_column_set_value::SourceFilter>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConditionalColumnSetValue {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value_transformation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ValueTransformation>,
{
self.value_transformation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_value_transformation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ValueTransformation>,
{
self.value_transformation = v.map(|x| x.into());
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_source_filter<
T: std::convert::Into<
std::option::Option<crate::model::conditional_column_set_value::SourceFilter>,
>,
>(
mut self,
v: T,
) -> Self {
self.source_filter = v.into();
self
}
pub fn source_text_filter(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceTextFilter>> {
#[allow(unreachable_patterns)]
self.source_filter.as_ref().and_then(|v| match v {
crate::model::conditional_column_set_value::SourceFilter::SourceTextFilter(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_text_filter<
T: std::convert::Into<std::boxed::Box<crate::model::SourceTextFilter>>,
>(
mut self,
v: T,
) -> Self {
self.source_filter = std::option::Option::Some(
crate::model::conditional_column_set_value::SourceFilter::SourceTextFilter(v.into()),
);
self
}
pub fn source_numeric_filter(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceNumericFilter>> {
#[allow(unreachable_patterns)]
self.source_filter.as_ref().and_then(|v| match v {
crate::model::conditional_column_set_value::SourceFilter::SourceNumericFilter(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_numeric_filter<
T: std::convert::Into<std::boxed::Box<crate::model::SourceNumericFilter>>,
>(
mut self,
v: T,
) -> Self {
self.source_filter = std::option::Option::Some(
crate::model::conditional_column_set_value::SourceFilter::SourceNumericFilter(v.into()),
);
self
}
}
impl wkt::message::Message for ConditionalColumnSetValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConditionalColumnSetValue"
}
}
pub mod conditional_column_set_value {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceFilter {
SourceTextFilter(std::boxed::Box<crate::model::SourceTextFilter>),
SourceNumericFilter(std::boxed::Box<crate::model::SourceNumericFilter>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValueTransformation {
#[allow(missing_docs)]
pub filter: std::option::Option<crate::model::value_transformation::Filter>,
#[allow(missing_docs)]
pub action: std::option::Option<crate::model::value_transformation::Action>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValueTransformation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filter<
T: std::convert::Into<std::option::Option<crate::model::value_transformation::Filter>>,
>(
mut self,
v: T,
) -> Self {
self.filter = v.into();
self
}
pub fn is_null(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
#[allow(unreachable_patterns)]
self.filter.as_ref().and_then(|v| match v {
crate::model::value_transformation::Filter::IsNull(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_is_null<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(mut self, v: T) -> Self {
self.filter =
std::option::Option::Some(crate::model::value_transformation::Filter::IsNull(v.into()));
self
}
pub fn value_list(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ValueListFilter>> {
#[allow(unreachable_patterns)]
self.filter.as_ref().and_then(|v| match v {
crate::model::value_transformation::Filter::ValueList(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_value_list<T: std::convert::Into<std::boxed::Box<crate::model::ValueListFilter>>>(
mut self,
v: T,
) -> Self {
self.filter = std::option::Option::Some(
crate::model::value_transformation::Filter::ValueList(v.into()),
);
self
}
pub fn int_comparison(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::IntComparisonFilter>> {
#[allow(unreachable_patterns)]
self.filter.as_ref().and_then(|v| match v {
crate::model::value_transformation::Filter::IntComparison(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_int_comparison<
T: std::convert::Into<std::boxed::Box<crate::model::IntComparisonFilter>>,
>(
mut self,
v: T,
) -> Self {
self.filter = std::option::Option::Some(
crate::model::value_transformation::Filter::IntComparison(v.into()),
);
self
}
pub fn double_comparison(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DoubleComparisonFilter>> {
#[allow(unreachable_patterns)]
self.filter.as_ref().and_then(|v| match v {
crate::model::value_transformation::Filter::DoubleComparison(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_double_comparison<
T: std::convert::Into<std::boxed::Box<crate::model::DoubleComparisonFilter>>,
>(
mut self,
v: T,
) -> Self {
self.filter = std::option::Option::Some(
crate::model::value_transformation::Filter::DoubleComparison(v.into()),
);
self
}
pub fn set_action<
T: std::convert::Into<std::option::Option<crate::model::value_transformation::Action>>,
>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn assign_null(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::value_transformation::Action::AssignNull(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_assign_null<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::value_transformation::Action::AssignNull(v.into()),
);
self
}
pub fn assign_specific_value(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AssignSpecificValue>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::value_transformation::Action::AssignSpecificValue(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_assign_specific_value<
T: std::convert::Into<std::boxed::Box<crate::model::AssignSpecificValue>>,
>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::value_transformation::Action::AssignSpecificValue(v.into()),
);
self
}
pub fn assign_min_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::value_transformation::Action::AssignMinValue(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_assign_min_value<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::value_transformation::Action::AssignMinValue(v.into()),
);
self
}
pub fn assign_max_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::value_transformation::Action::AssignMaxValue(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_assign_max_value<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::value_transformation::Action::AssignMaxValue(v.into()),
);
self
}
pub fn round_scale(&self) -> std::option::Option<&std::boxed::Box<crate::model::RoundToScale>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::value_transformation::Action::RoundScale(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_round_scale<T: std::convert::Into<std::boxed::Box<crate::model::RoundToScale>>>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::value_transformation::Action::RoundScale(v.into()),
);
self
}
pub fn apply_hash(&self) -> std::option::Option<&std::boxed::Box<crate::model::ApplyHash>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::value_transformation::Action::ApplyHash(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_apply_hash<T: std::convert::Into<std::boxed::Box<crate::model::ApplyHash>>>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::value_transformation::Action::ApplyHash(v.into()),
);
self
}
}
impl wkt::message::Message for ValueTransformation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ValueTransformation"
}
}
pub mod value_transformation {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Filter {
IsNull(std::boxed::Box<wkt::Empty>),
ValueList(std::boxed::Box<crate::model::ValueListFilter>),
IntComparison(std::boxed::Box<crate::model::IntComparisonFilter>),
DoubleComparison(std::boxed::Box<crate::model::DoubleComparisonFilter>),
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
AssignNull(std::boxed::Box<wkt::Empty>),
AssignSpecificValue(std::boxed::Box<crate::model::AssignSpecificValue>),
AssignMinValue(std::boxed::Box<wkt::Empty>),
AssignMaxValue(std::boxed::Box<wkt::Empty>),
RoundScale(std::boxed::Box<crate::model::RoundToScale>),
ApplyHash(std::boxed::Box<crate::model::ApplyHash>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConvertRowIdToColumn {
pub only_if_no_primary_key: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConvertRowIdToColumn {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_only_if_no_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.only_if_no_primary_key = v.into();
self
}
}
impl wkt::message::Message for ConvertRowIdToColumn {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConvertRowIdToColumn"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SetTablePrimaryKey {
pub primary_key_columns: std::vec::Vec<std::string::String>,
pub primary_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetTablePrimaryKey {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_primary_key_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.primary_key_columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_primary_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.primary_key = v.into();
self
}
}
impl wkt::message::Message for SetTablePrimaryKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SetTablePrimaryKey"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SinglePackageChange {
pub package_description: std::string::String,
pub package_body: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SinglePackageChange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_package_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.package_description = v.into();
self
}
pub fn set_package_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.package_body = v.into();
self
}
}
impl wkt::message::Message for SinglePackageChange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SinglePackageChange"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceSqlChange {
pub sql_code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceSqlChange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_code = v.into();
self
}
}
impl wkt::message::Message for SourceSqlChange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SourceSqlChange"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FilterTableColumns {
pub include_columns: std::vec::Vec<std::string::String>,
pub exclude_columns: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FilterTableColumns {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_include_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.include_columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_exclude_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.exclude_columns = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FilterTableColumns {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.FilterTableColumns"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValueListFilter {
pub value_present_list: crate::model::ValuePresentInList,
pub values: std::vec::Vec<std::string::String>,
pub ignore_case: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValueListFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value_present_list<T: std::convert::Into<crate::model::ValuePresentInList>>(
mut self,
v: T,
) -> Self {
self.value_present_list = v.into();
self
}
pub fn set_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.values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_case = v.into();
self
}
}
impl wkt::message::Message for ValueListFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ValueListFilter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IntComparisonFilter {
pub value_comparison: crate::model::ValueComparison,
pub value: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IntComparisonFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value_comparison<T: std::convert::Into<crate::model::ValueComparison>>(
mut self,
v: T,
) -> Self {
self.value_comparison = v.into();
self
}
pub fn set_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for IntComparisonFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.IntComparisonFilter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DoubleComparisonFilter {
pub value_comparison: crate::model::ValueComparison,
pub value: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DoubleComparisonFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value_comparison<T: std::convert::Into<crate::model::ValueComparison>>(
mut self,
v: T,
) -> Self {
self.value_comparison = v.into();
self
}
pub fn set_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for DoubleComparisonFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DoubleComparisonFilter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssignSpecificValue {
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssignSpecificValue {
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
}
}
impl wkt::message::Message for AssignSpecificValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.AssignSpecificValue"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApplyHash {
#[allow(missing_docs)]
pub hash_function: std::option::Option<crate::model::apply_hash::HashFunction>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApplyHash {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hash_function<
T: std::convert::Into<std::option::Option<crate::model::apply_hash::HashFunction>>,
>(
mut self,
v: T,
) -> Self {
self.hash_function = v.into();
self
}
pub fn uuid_from_bytes(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
#[allow(unreachable_patterns)]
self.hash_function.as_ref().and_then(|v| match v {
crate::model::apply_hash::HashFunction::UuidFromBytes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_uuid_from_bytes<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
mut self,
v: T,
) -> Self {
self.hash_function = std::option::Option::Some(
crate::model::apply_hash::HashFunction::UuidFromBytes(v.into()),
);
self
}
}
impl wkt::message::Message for ApplyHash {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ApplyHash"
}
}
pub mod apply_hash {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HashFunction {
UuidFromBytes(std::boxed::Box<wkt::Empty>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoundToScale {
pub scale: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RoundToScale {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.scale = v.into();
self
}
}
impl wkt::message::Message for RoundToScale {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.RoundToScale"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseEntity {
pub short_name: std::string::String,
pub parent_entity: std::string::String,
pub tree: crate::model::database_entity::TreeType,
pub entity_type: crate::model::DatabaseEntityType,
pub mappings: std::vec::Vec<crate::model::EntityMapping>,
pub entity_ddl: std::vec::Vec<crate::model::EntityDdl>,
pub issues: std::vec::Vec<crate::model::EntityIssue>,
pub entity_body: std::option::Option<crate::model::database_entity::EntityBody>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabaseEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.short_name = v.into();
self
}
pub fn set_parent_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent_entity = v.into();
self
}
pub fn set_tree<T: std::convert::Into<crate::model::database_entity::TreeType>>(
mut self,
v: T,
) -> Self {
self.tree = v.into();
self
}
pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.entity_type = v.into();
self
}
pub fn set_mappings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntityMapping>,
{
use std::iter::Iterator;
self.mappings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_entity_ddl<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntityDdl>,
{
use std::iter::Iterator;
self.entity_ddl = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_issues<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntityIssue>,
{
use std::iter::Iterator;
self.issues = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_entity_body<
T: std::convert::Into<std::option::Option<crate::model::database_entity::EntityBody>>,
>(
mut self,
v: T,
) -> Self {
self.entity_body = v.into();
self
}
pub fn database(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DatabaseInstanceEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::Database(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_database<
T: std::convert::Into<std::boxed::Box<crate::model::DatabaseInstanceEntity>>,
>(
mut self,
v: T,
) -> Self {
self.entity_body = std::option::Option::Some(
crate::model::database_entity::EntityBody::Database(v.into()),
);
self
}
pub fn schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::SchemaEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::Schema(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::SchemaEntity>>>(
mut self,
v: T,
) -> Self {
self.entity_body =
std::option::Option::Some(crate::model::database_entity::EntityBody::Schema(v.into()));
self
}
pub fn table(&self) -> std::option::Option<&std::boxed::Box<crate::model::TableEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::Table(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_table<T: std::convert::Into<std::boxed::Box<crate::model::TableEntity>>>(
mut self,
v: T,
) -> Self {
self.entity_body =
std::option::Option::Some(crate::model::database_entity::EntityBody::Table(v.into()));
self
}
pub fn view(&self) -> std::option::Option<&std::boxed::Box<crate::model::ViewEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::View(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_view<T: std::convert::Into<std::boxed::Box<crate::model::ViewEntity>>>(
mut self,
v: T,
) -> Self {
self.entity_body =
std::option::Option::Some(crate::model::database_entity::EntityBody::View(v.into()));
self
}
pub fn sequence(&self) -> std::option::Option<&std::boxed::Box<crate::model::SequenceEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::Sequence(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sequence<T: std::convert::Into<std::boxed::Box<crate::model::SequenceEntity>>>(
mut self,
v: T,
) -> Self {
self.entity_body = std::option::Option::Some(
crate::model::database_entity::EntityBody::Sequence(v.into()),
);
self
}
pub fn stored_procedure(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StoredProcedureEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::StoredProcedure(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_stored_procedure<
T: std::convert::Into<std::boxed::Box<crate::model::StoredProcedureEntity>>,
>(
mut self,
v: T,
) -> Self {
self.entity_body = std::option::Option::Some(
crate::model::database_entity::EntityBody::StoredProcedure(v.into()),
);
self
}
pub fn database_function(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::FunctionEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::DatabaseFunction(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_database_function<
T: std::convert::Into<std::boxed::Box<crate::model::FunctionEntity>>,
>(
mut self,
v: T,
) -> Self {
self.entity_body = std::option::Option::Some(
crate::model::database_entity::EntityBody::DatabaseFunction(v.into()),
);
self
}
pub fn synonym(&self) -> std::option::Option<&std::boxed::Box<crate::model::SynonymEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::Synonym(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_synonym<T: std::convert::Into<std::boxed::Box<crate::model::SynonymEntity>>>(
mut self,
v: T,
) -> Self {
self.entity_body =
std::option::Option::Some(crate::model::database_entity::EntityBody::Synonym(v.into()));
self
}
pub fn database_package(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PackageEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::DatabasePackage(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_database_package<
T: std::convert::Into<std::boxed::Box<crate::model::PackageEntity>>,
>(
mut self,
v: T,
) -> Self {
self.entity_body = std::option::Option::Some(
crate::model::database_entity::EntityBody::DatabasePackage(v.into()),
);
self
}
pub fn udt(&self) -> std::option::Option<&std::boxed::Box<crate::model::UDTEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::Udt(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_udt<T: std::convert::Into<std::boxed::Box<crate::model::UDTEntity>>>(
mut self,
v: T,
) -> Self {
self.entity_body =
std::option::Option::Some(crate::model::database_entity::EntityBody::Udt(v.into()));
self
}
pub fn materialized_view(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MaterializedViewEntity>> {
#[allow(unreachable_patterns)]
self.entity_body.as_ref().and_then(|v| match v {
crate::model::database_entity::EntityBody::MaterializedView(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_materialized_view<
T: std::convert::Into<std::boxed::Box<crate::model::MaterializedViewEntity>>,
>(
mut self,
v: T,
) -> Self {
self.entity_body = std::option::Option::Some(
crate::model::database_entity::EntityBody::MaterializedView(v.into()),
);
self
}
}
impl wkt::message::Message for DatabaseEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DatabaseEntity"
}
}
pub mod database_entity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TreeType {
Unspecified,
Source,
Draft,
Destination,
UnknownValue(tree_type::UnknownValue),
}
#[doc(hidden)]
pub mod tree_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TreeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Source => std::option::Option::Some(1),
Self::Draft => std::option::Option::Some(2),
Self::Destination => 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("TREE_TYPE_UNSPECIFIED"),
Self::Source => std::option::Option::Some("SOURCE"),
Self::Draft => std::option::Option::Some("DRAFT"),
Self::Destination => std::option::Option::Some("DESTINATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TreeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TreeType {
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 TreeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Source,
2 => Self::Draft,
3 => Self::Destination,
_ => Self::UnknownValue(tree_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TreeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TREE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SOURCE" => Self::Source,
"DRAFT" => Self::Draft,
"DESTINATION" => Self::Destination,
_ => Self::UnknownValue(tree_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TreeType {
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::Source => serializer.serialize_i32(1),
Self::Draft => serializer.serialize_i32(2),
Self::Destination => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TreeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TreeType>::new(
".google.cloud.clouddms.v1.DatabaseEntity.TreeType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntityBody {
Database(std::boxed::Box<crate::model::DatabaseInstanceEntity>),
Schema(std::boxed::Box<crate::model::SchemaEntity>),
Table(std::boxed::Box<crate::model::TableEntity>),
View(std::boxed::Box<crate::model::ViewEntity>),
Sequence(std::boxed::Box<crate::model::SequenceEntity>),
StoredProcedure(std::boxed::Box<crate::model::StoredProcedureEntity>),
DatabaseFunction(std::boxed::Box<crate::model::FunctionEntity>),
Synonym(std::boxed::Box<crate::model::SynonymEntity>),
DatabasePackage(std::boxed::Box<crate::model::PackageEntity>),
Udt(std::boxed::Box<crate::model::UDTEntity>),
MaterializedView(std::boxed::Box<crate::model::MaterializedViewEntity>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseInstanceEntity {
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatabaseInstanceEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DatabaseInstanceEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.DatabaseInstanceEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchemaEntity {
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchemaEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SchemaEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SchemaEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TableEntity {
pub columns: std::vec::Vec<crate::model::ColumnEntity>,
pub constraints: std::vec::Vec<crate::model::ConstraintEntity>,
pub indices: std::vec::Vec<crate::model::IndexEntity>,
pub triggers: std::vec::Vec<crate::model::TriggerEntity>,
pub custom_features: std::option::Option<wkt::Struct>,
pub comment: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TableEntity {
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::ColumnEntity>,
{
use std::iter::Iterator;
self.columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_constraints<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConstraintEntity>,
{
use std::iter::Iterator;
self.constraints = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_indices<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IndexEntity>,
{
use std::iter::Iterator;
self.indices = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_triggers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TriggerEntity>,
{
use std::iter::Iterator;
self.triggers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.comment = v.into();
self
}
}
impl wkt::message::Message for TableEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.TableEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ColumnEntity {
pub name: std::string::String,
pub data_type: std::string::String,
pub charset: std::string::String,
pub collation: std::string::String,
pub length: i64,
pub precision: i32,
pub scale: i32,
pub fractional_seconds_precision: i32,
pub array: bool,
pub array_length: i32,
pub nullable: bool,
pub auto_generated: bool,
pub udt: bool,
pub custom_features: std::option::Option<wkt::Struct>,
pub set_values: std::vec::Vec<std::string::String>,
pub comment: std::string::String,
pub ordinal_position: i32,
pub default_value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ColumnEntity {
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_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_type = 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_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.length = v.into();
self
}
pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.precision = v.into();
self
}
pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.scale = v.into();
self
}
pub fn set_fractional_seconds_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.fractional_seconds_precision = v.into();
self
}
pub fn set_array<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.array = v.into();
self
}
pub fn set_array_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.array_length = v.into();
self
}
pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.nullable = v.into();
self
}
pub fn set_auto_generated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.auto_generated = v.into();
self
}
pub fn set_udt<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.udt = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_set_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.set_values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.comment = v.into();
self
}
pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.ordinal_position = v.into();
self
}
pub fn set_default_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.default_value = v.into();
self
}
}
impl wkt::message::Message for ColumnEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ColumnEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConstraintEntity {
pub name: std::string::String,
pub r#type: std::string::String,
pub table_columns: std::vec::Vec<std::string::String>,
pub custom_features: std::option::Option<wkt::Struct>,
pub reference_columns: std::vec::Vec<std::string::String>,
pub reference_table: std::string::String,
pub table_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConstraintEntity {
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
}
pub fn set_table_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.table_columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_reference_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.reference_columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_reference_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.reference_table = v.into();
self
}
pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table_name = v.into();
self
}
}
impl wkt::message::Message for ConstraintEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ConstraintEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IndexEntity {
pub name: std::string::String,
pub r#type: std::string::String,
pub table_columns: std::vec::Vec<std::string::String>,
pub unique: bool,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IndexEntity {
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
}
pub fn set_table_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.table_columns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unique = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IndexEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.IndexEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TriggerEntity {
pub name: std::string::String,
pub triggering_events: std::vec::Vec<std::string::String>,
pub trigger_type: std::string::String,
pub sql_code: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TriggerEntity {
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_triggering_events<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.triggering_events = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_trigger_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trigger_type = v.into();
self
}
pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_code = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TriggerEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.TriggerEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ViewEntity {
pub sql_code: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub constraints: std::vec::Vec<crate::model::ConstraintEntity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ViewEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_code = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
pub fn set_constraints<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConstraintEntity>,
{
use std::iter::Iterator;
self.constraints = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ViewEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.ViewEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SequenceEntity {
pub increment: i64,
pub start_value: ::bytes::Bytes,
pub max_value: ::bytes::Bytes,
pub min_value: ::bytes::Bytes,
pub cycle: bool,
pub cache: i64,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SequenceEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_increment<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.increment = v.into();
self
}
pub fn set_start_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.start_value = v.into();
self
}
pub fn set_max_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.max_value = v.into();
self
}
pub fn set_min_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.min_value = v.into();
self
}
pub fn set_cycle<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.cycle = v.into();
self
}
pub fn set_cache<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.cache = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SequenceEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SequenceEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StoredProcedureEntity {
pub sql_code: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StoredProcedureEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_code = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StoredProcedureEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.StoredProcedureEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FunctionEntity {
pub sql_code: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FunctionEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_code = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FunctionEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.FunctionEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MaterializedViewEntity {
pub sql_code: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MaterializedViewEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sql_code = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MaterializedViewEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.MaterializedViewEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SynonymEntity {
pub source_entity: std::string::String,
pub source_type: crate::model::DatabaseEntityType,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SynonymEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_entity = v.into();
self
}
pub fn set_source_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.source_type = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SynonymEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.SynonymEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PackageEntity {
pub package_sql_code: std::string::String,
pub package_body: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PackageEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_package_sql_code<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.package_sql_code = v.into();
self
}
pub fn set_package_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.package_body = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PackageEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.PackageEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UDTEntity {
pub udt_sql_code: std::string::String,
pub udt_body: std::string::String,
pub custom_features: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UDTEntity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_udt_sql_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.udt_sql_code = v.into();
self
}
pub fn set_udt_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.udt_body = v.into();
self
}
pub fn set_custom_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.custom_features = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UDTEntity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.UDTEntity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityMapping {
pub source_entity: std::string::String,
pub draft_entity: std::string::String,
pub source_type: crate::model::DatabaseEntityType,
pub draft_type: crate::model::DatabaseEntityType,
pub mapping_log: std::vec::Vec<crate::model::EntityMappingLogEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityMapping {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_entity = v.into();
self
}
pub fn set_draft_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.draft_entity = v.into();
self
}
pub fn set_source_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.source_type = v.into();
self
}
pub fn set_draft_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.draft_type = v.into();
self
}
pub fn set_mapping_log<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EntityMappingLogEntry>,
{
use std::iter::Iterator;
self.mapping_log = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for EntityMapping {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.EntityMapping"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityMappingLogEntry {
pub rule_id: std::string::String,
pub rule_revision_id: std::string::String,
pub mapping_comment: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityMappingLogEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_id = v.into();
self
}
pub fn set_rule_revision_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rule_revision_id = v.into();
self
}
pub fn set_mapping_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mapping_comment = v.into();
self
}
}
impl wkt::message::Message for EntityMappingLogEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.EntityMappingLogEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityDdl {
pub ddl_type: std::string::String,
pub entity: std::string::String,
pub ddl: std::string::String,
pub entity_type: crate::model::DatabaseEntityType,
pub issue_id: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityDdl {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ddl_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ddl_type = v.into();
self
}
pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity = v.into();
self
}
pub fn set_ddl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ddl = v.into();
self
}
pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.entity_type = v.into();
self
}
pub fn set_issue_id<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.issue_id = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for EntityDdl {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.EntityDdl"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityIssue {
pub id: std::string::String,
pub r#type: crate::model::entity_issue::IssueType,
pub severity: crate::model::entity_issue::IssueSeverity,
pub message: std::string::String,
pub code: std::string::String,
pub ddl: std::option::Option<std::string::String>,
pub position: std::option::Option<crate::model::entity_issue::Position>,
pub entity_type: crate::model::DatabaseEntityType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityIssue {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::entity_issue::IssueType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_severity<T: std::convert::Into<crate::model::entity_issue::IssueSeverity>>(
mut self,
v: T,
) -> Self {
self.severity = 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_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.code = v.into();
self
}
pub fn set_ddl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ddl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ddl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ddl = v.map(|x| x.into());
self
}
pub fn set_position<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::entity_issue::Position>,
{
self.position = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::entity_issue::Position>,
{
self.position = v.map(|x| x.into());
self
}
pub fn set_entity_type<T: std::convert::Into<crate::model::DatabaseEntityType>>(
mut self,
v: T,
) -> Self {
self.entity_type = v.into();
self
}
}
impl wkt::message::Message for EntityIssue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.EntityIssue"
}
}
pub mod entity_issue {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Position {
pub line: i32,
pub column: i32,
pub offset: i32,
pub length: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Position {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.line = v.into();
self
}
pub fn set_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.column = v.into();
self
}
pub fn set_offset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.offset = v.into();
self
}
pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.length = v.into();
self
}
}
impl wkt::message::Message for Position {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.clouddms.v1.EntityIssue.Position"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IssueType {
Unspecified,
Ddl,
Apply,
Convert,
UnknownValue(issue_type::UnknownValue),
}
#[doc(hidden)]
pub mod issue_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IssueType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ddl => std::option::Option::Some(1),
Self::Apply => std::option::Option::Some(2),
Self::Convert => 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("ISSUE_TYPE_UNSPECIFIED"),
Self::Ddl => std::option::Option::Some("ISSUE_TYPE_DDL"),
Self::Apply => std::option::Option::Some("ISSUE_TYPE_APPLY"),
Self::Convert => std::option::Option::Some("ISSUE_TYPE_CONVERT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IssueType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IssueType {
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 IssueType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ddl,
2 => Self::Apply,
3 => Self::Convert,
_ => Self::UnknownValue(issue_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IssueType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ISSUE_TYPE_UNSPECIFIED" => Self::Unspecified,
"ISSUE_TYPE_DDL" => Self::Ddl,
"ISSUE_TYPE_APPLY" => Self::Apply,
"ISSUE_TYPE_CONVERT" => Self::Convert,
_ => Self::UnknownValue(issue_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IssueType {
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::Ddl => serializer.serialize_i32(1),
Self::Apply => serializer.serialize_i32(2),
Self::Convert => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for IssueType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueType>::new(
".google.cloud.clouddms.v1.EntityIssue.IssueType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IssueSeverity {
Unspecified,
Info,
Warning,
Error,
UnknownValue(issue_severity::UnknownValue),
}
#[doc(hidden)]
pub mod issue_severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IssueSeverity {
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("ISSUE_SEVERITY_UNSPECIFIED"),
Self::Info => std::option::Option::Some("ISSUE_SEVERITY_INFO"),
Self::Warning => std::option::Option::Some("ISSUE_SEVERITY_WARNING"),
Self::Error => std::option::Option::Some("ISSUE_SEVERITY_ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IssueSeverity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IssueSeverity {
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 IssueSeverity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Info,
2 => Self::Warning,
3 => Self::Error,
_ => Self::UnknownValue(issue_severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IssueSeverity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ISSUE_SEVERITY_UNSPECIFIED" => Self::Unspecified,
"ISSUE_SEVERITY_INFO" => Self::Info,
"ISSUE_SEVERITY_WARNING" => Self::Warning,
"ISSUE_SEVERITY_ERROR" => Self::Error,
_ => Self::UnknownValue(issue_severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IssueSeverity {
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 IssueSeverity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueSeverity>::new(
".google.cloud.clouddms.v1.EntityIssue.IssueSeverity",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseEntityView {
Unspecified,
Basic,
Full,
RootSummary,
UnknownValue(database_entity_view::UnknownValue),
}
#[doc(hidden)]
pub mod database_entity_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DatabaseEntityView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => std::option::Option::Some(2),
Self::RootSummary => 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("DATABASE_ENTITY_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("DATABASE_ENTITY_VIEW_BASIC"),
Self::Full => std::option::Option::Some("DATABASE_ENTITY_VIEW_FULL"),
Self::RootSummary => std::option::Option::Some("DATABASE_ENTITY_VIEW_ROOT_SUMMARY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DatabaseEntityView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DatabaseEntityView {
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 DatabaseEntityView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
3 => Self::RootSummary,
_ => Self::UnknownValue(database_entity_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DatabaseEntityView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATABASE_ENTITY_VIEW_UNSPECIFIED" => Self::Unspecified,
"DATABASE_ENTITY_VIEW_BASIC" => Self::Basic,
"DATABASE_ENTITY_VIEW_FULL" => Self::Full,
"DATABASE_ENTITY_VIEW_ROOT_SUMMARY" => Self::RootSummary,
_ => Self::UnknownValue(database_entity_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DatabaseEntityView {
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::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(2),
Self::RootSummary => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DatabaseEntityView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEntityView>::new(
".google.cloud.clouddms.v1.DatabaseEntityView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NetworkArchitecture {
#[allow(missing_docs)]
Unspecified,
OldCsqlProducer,
NewCsqlProducer,
UnknownValue(network_architecture::UnknownValue),
}
#[doc(hidden)]
pub mod network_architecture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NetworkArchitecture {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OldCsqlProducer => std::option::Option::Some(1),
Self::NewCsqlProducer => 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("NETWORK_ARCHITECTURE_UNSPECIFIED"),
Self::OldCsqlProducer => {
std::option::Option::Some("NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER")
}
Self::NewCsqlProducer => {
std::option::Option::Some("NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NetworkArchitecture {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NetworkArchitecture {
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 NetworkArchitecture {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OldCsqlProducer,
2 => Self::NewCsqlProducer,
_ => Self::UnknownValue(network_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NetworkArchitecture {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
"NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER" => Self::OldCsqlProducer,
"NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER" => Self::NewCsqlProducer,
_ => Self::UnknownValue(network_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NetworkArchitecture {
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::OldCsqlProducer => serializer.serialize_i32(1),
Self::NewCsqlProducer => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NetworkArchitecture {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkArchitecture>::new(
".google.cloud.clouddms.v1.NetworkArchitecture",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseEngine {
Unspecified,
Mysql,
Postgresql,
Oracle,
UnknownValue(database_engine::UnknownValue),
}
#[doc(hidden)]
pub mod database_engine {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DatabaseEngine {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Mysql => std::option::Option::Some(1),
Self::Postgresql => std::option::Option::Some(2),
Self::Oracle => 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("DATABASE_ENGINE_UNSPECIFIED"),
Self::Mysql => std::option::Option::Some("MYSQL"),
Self::Postgresql => std::option::Option::Some("POSTGRESQL"),
Self::Oracle => std::option::Option::Some("ORACLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DatabaseEngine {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DatabaseEngine {
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 DatabaseEngine {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Mysql,
2 => Self::Postgresql,
4 => Self::Oracle,
_ => Self::UnknownValue(database_engine::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DatabaseEngine {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATABASE_ENGINE_UNSPECIFIED" => Self::Unspecified,
"MYSQL" => Self::Mysql,
"POSTGRESQL" => Self::Postgresql,
"ORACLE" => Self::Oracle,
_ => Self::UnknownValue(database_engine::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DatabaseEngine {
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::Mysql => serializer.serialize_i32(1),
Self::Postgresql => serializer.serialize_i32(2),
Self::Oracle => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DatabaseEngine {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEngine>::new(
".google.cloud.clouddms.v1.DatabaseEngine",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseProvider {
Unspecified,
Cloudsql,
Rds,
Aurora,
Alloydb,
UnknownValue(database_provider::UnknownValue),
}
#[doc(hidden)]
pub mod database_provider {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DatabaseProvider {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Cloudsql => std::option::Option::Some(1),
Self::Rds => std::option::Option::Some(2),
Self::Aurora => std::option::Option::Some(3),
Self::Alloydb => 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("DATABASE_PROVIDER_UNSPECIFIED"),
Self::Cloudsql => std::option::Option::Some("CLOUDSQL"),
Self::Rds => std::option::Option::Some("RDS"),
Self::Aurora => std::option::Option::Some("AURORA"),
Self::Alloydb => std::option::Option::Some("ALLOYDB"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DatabaseProvider {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DatabaseProvider {
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 DatabaseProvider {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Cloudsql,
2 => Self::Rds,
3 => Self::Aurora,
4 => Self::Alloydb,
_ => Self::UnknownValue(database_provider::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DatabaseProvider {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATABASE_PROVIDER_UNSPECIFIED" => Self::Unspecified,
"CLOUDSQL" => Self::Cloudsql,
"RDS" => Self::Rds,
"AURORA" => Self::Aurora,
"ALLOYDB" => Self::Alloydb,
_ => Self::UnknownValue(database_provider::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DatabaseProvider {
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::Cloudsql => serializer.serialize_i32(1),
Self::Rds => serializer.serialize_i32(2),
Self::Aurora => serializer.serialize_i32(3),
Self::Alloydb => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DatabaseProvider {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseProvider>::new(
".google.cloud.clouddms.v1.DatabaseProvider",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValuePresentInList {
Unspecified,
IfValueList,
IfValueNotList,
UnknownValue(value_present_in_list::UnknownValue),
}
#[doc(hidden)]
pub mod value_present_in_list {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ValuePresentInList {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::IfValueList => std::option::Option::Some(1),
Self::IfValueNotList => 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("VALUE_PRESENT_IN_LIST_UNSPECIFIED"),
Self::IfValueList => std::option::Option::Some("VALUE_PRESENT_IN_LIST_IF_VALUE_LIST"),
Self::IfValueNotList => {
std::option::Option::Some("VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ValuePresentInList {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ValuePresentInList {
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 ValuePresentInList {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::IfValueList,
2 => Self::IfValueNotList,
_ => Self::UnknownValue(value_present_in_list::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ValuePresentInList {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VALUE_PRESENT_IN_LIST_UNSPECIFIED" => Self::Unspecified,
"VALUE_PRESENT_IN_LIST_IF_VALUE_LIST" => Self::IfValueList,
"VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST" => Self::IfValueNotList,
_ => Self::UnknownValue(value_present_in_list::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ValuePresentInList {
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::IfValueList => serializer.serialize_i32(1),
Self::IfValueNotList => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ValuePresentInList {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValuePresentInList>::new(
".google.cloud.clouddms.v1.ValuePresentInList",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseEntityType {
Unspecified,
Schema,
Table,
Column,
Constraint,
Index,
Trigger,
View,
Sequence,
StoredProcedure,
Function,
Synonym,
DatabasePackage,
Udt,
MaterializedView,
Database,
UnknownValue(database_entity_type::UnknownValue),
}
#[doc(hidden)]
pub mod database_entity_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DatabaseEntityType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Schema => std::option::Option::Some(1),
Self::Table => std::option::Option::Some(2),
Self::Column => std::option::Option::Some(3),
Self::Constraint => std::option::Option::Some(4),
Self::Index => std::option::Option::Some(5),
Self::Trigger => std::option::Option::Some(6),
Self::View => std::option::Option::Some(7),
Self::Sequence => std::option::Option::Some(8),
Self::StoredProcedure => std::option::Option::Some(9),
Self::Function => std::option::Option::Some(10),
Self::Synonym => std::option::Option::Some(11),
Self::DatabasePackage => std::option::Option::Some(12),
Self::Udt => std::option::Option::Some(13),
Self::MaterializedView => std::option::Option::Some(14),
Self::Database => std::option::Option::Some(15),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATABASE_ENTITY_TYPE_UNSPECIFIED"),
Self::Schema => std::option::Option::Some("DATABASE_ENTITY_TYPE_SCHEMA"),
Self::Table => std::option::Option::Some("DATABASE_ENTITY_TYPE_TABLE"),
Self::Column => std::option::Option::Some("DATABASE_ENTITY_TYPE_COLUMN"),
Self::Constraint => std::option::Option::Some("DATABASE_ENTITY_TYPE_CONSTRAINT"),
Self::Index => std::option::Option::Some("DATABASE_ENTITY_TYPE_INDEX"),
Self::Trigger => std::option::Option::Some("DATABASE_ENTITY_TYPE_TRIGGER"),
Self::View => std::option::Option::Some("DATABASE_ENTITY_TYPE_VIEW"),
Self::Sequence => std::option::Option::Some("DATABASE_ENTITY_TYPE_SEQUENCE"),
Self::StoredProcedure => {
std::option::Option::Some("DATABASE_ENTITY_TYPE_STORED_PROCEDURE")
}
Self::Function => std::option::Option::Some("DATABASE_ENTITY_TYPE_FUNCTION"),
Self::Synonym => std::option::Option::Some("DATABASE_ENTITY_TYPE_SYNONYM"),
Self::DatabasePackage => {
std::option::Option::Some("DATABASE_ENTITY_TYPE_DATABASE_PACKAGE")
}
Self::Udt => std::option::Option::Some("DATABASE_ENTITY_TYPE_UDT"),
Self::MaterializedView => {
std::option::Option::Some("DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW")
}
Self::Database => std::option::Option::Some("DATABASE_ENTITY_TYPE_DATABASE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DatabaseEntityType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DatabaseEntityType {
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 DatabaseEntityType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Schema,
2 => Self::Table,
3 => Self::Column,
4 => Self::Constraint,
5 => Self::Index,
6 => Self::Trigger,
7 => Self::View,
8 => Self::Sequence,
9 => Self::StoredProcedure,
10 => Self::Function,
11 => Self::Synonym,
12 => Self::DatabasePackage,
13 => Self::Udt,
14 => Self::MaterializedView,
15 => Self::Database,
_ => Self::UnknownValue(database_entity_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DatabaseEntityType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATABASE_ENTITY_TYPE_UNSPECIFIED" => Self::Unspecified,
"DATABASE_ENTITY_TYPE_SCHEMA" => Self::Schema,
"DATABASE_ENTITY_TYPE_TABLE" => Self::Table,
"DATABASE_ENTITY_TYPE_COLUMN" => Self::Column,
"DATABASE_ENTITY_TYPE_CONSTRAINT" => Self::Constraint,
"DATABASE_ENTITY_TYPE_INDEX" => Self::Index,
"DATABASE_ENTITY_TYPE_TRIGGER" => Self::Trigger,
"DATABASE_ENTITY_TYPE_VIEW" => Self::View,
"DATABASE_ENTITY_TYPE_SEQUENCE" => Self::Sequence,
"DATABASE_ENTITY_TYPE_STORED_PROCEDURE" => Self::StoredProcedure,
"DATABASE_ENTITY_TYPE_FUNCTION" => Self::Function,
"DATABASE_ENTITY_TYPE_SYNONYM" => Self::Synonym,
"DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" => Self::DatabasePackage,
"DATABASE_ENTITY_TYPE_UDT" => Self::Udt,
"DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW" => Self::MaterializedView,
"DATABASE_ENTITY_TYPE_DATABASE" => Self::Database,
_ => Self::UnknownValue(database_entity_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DatabaseEntityType {
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::Schema => serializer.serialize_i32(1),
Self::Table => serializer.serialize_i32(2),
Self::Column => serializer.serialize_i32(3),
Self::Constraint => serializer.serialize_i32(4),
Self::Index => serializer.serialize_i32(5),
Self::Trigger => serializer.serialize_i32(6),
Self::View => serializer.serialize_i32(7),
Self::Sequence => serializer.serialize_i32(8),
Self::StoredProcedure => serializer.serialize_i32(9),
Self::Function => serializer.serialize_i32(10),
Self::Synonym => serializer.serialize_i32(11),
Self::DatabasePackage => serializer.serialize_i32(12),
Self::Udt => serializer.serialize_i32(13),
Self::MaterializedView => serializer.serialize_i32(14),
Self::Database => serializer.serialize_i32(15),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DatabaseEntityType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEntityType>::new(
".google.cloud.clouddms.v1.DatabaseEntityType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EntityNameTransformation {
Unspecified,
NoTransformation,
LowerCase,
UpperCase,
CapitalizedCase,
UnknownValue(entity_name_transformation::UnknownValue),
}
#[doc(hidden)]
pub mod entity_name_transformation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EntityNameTransformation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NoTransformation => std::option::Option::Some(1),
Self::LowerCase => std::option::Option::Some(2),
Self::UpperCase => std::option::Option::Some(3),
Self::CapitalizedCase => 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("ENTITY_NAME_TRANSFORMATION_UNSPECIFIED")
}
Self::NoTransformation => {
std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION")
}
Self::LowerCase => std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_LOWER_CASE"),
Self::UpperCase => std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_UPPER_CASE"),
Self::CapitalizedCase => {
std::option::Option::Some("ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EntityNameTransformation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EntityNameTransformation {
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 EntityNameTransformation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NoTransformation,
2 => Self::LowerCase,
3 => Self::UpperCase,
4 => Self::CapitalizedCase,
_ => Self::UnknownValue(entity_name_transformation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EntityNameTransformation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENTITY_NAME_TRANSFORMATION_UNSPECIFIED" => Self::Unspecified,
"ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION" => Self::NoTransformation,
"ENTITY_NAME_TRANSFORMATION_LOWER_CASE" => Self::LowerCase,
"ENTITY_NAME_TRANSFORMATION_UPPER_CASE" => Self::UpperCase,
"ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE" => Self::CapitalizedCase,
_ => Self::UnknownValue(entity_name_transformation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EntityNameTransformation {
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::NoTransformation => serializer.serialize_i32(1),
Self::LowerCase => serializer.serialize_i32(2),
Self::UpperCase => serializer.serialize_i32(3),
Self::CapitalizedCase => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EntityNameTransformation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntityNameTransformation>::new(
".google.cloud.clouddms.v1.EntityNameTransformation",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackgroundJobType {
Unspecified,
SourceSeed,
Convert,
ApplyDestination,
ImportRulesFile,
UnknownValue(background_job_type::UnknownValue),
}
#[doc(hidden)]
pub mod background_job_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackgroundJobType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SourceSeed => std::option::Option::Some(1),
Self::Convert => std::option::Option::Some(2),
Self::ApplyDestination => std::option::Option::Some(3),
Self::ImportRulesFile => 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("BACKGROUND_JOB_TYPE_UNSPECIFIED"),
Self::SourceSeed => std::option::Option::Some("BACKGROUND_JOB_TYPE_SOURCE_SEED"),
Self::Convert => std::option::Option::Some("BACKGROUND_JOB_TYPE_CONVERT"),
Self::ApplyDestination => {
std::option::Option::Some("BACKGROUND_JOB_TYPE_APPLY_DESTINATION")
}
Self::ImportRulesFile => {
std::option::Option::Some("BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackgroundJobType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackgroundJobType {
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 BackgroundJobType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SourceSeed,
2 => Self::Convert,
3 => Self::ApplyDestination,
5 => Self::ImportRulesFile,
_ => Self::UnknownValue(background_job_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackgroundJobType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKGROUND_JOB_TYPE_UNSPECIFIED" => Self::Unspecified,
"BACKGROUND_JOB_TYPE_SOURCE_SEED" => Self::SourceSeed,
"BACKGROUND_JOB_TYPE_CONVERT" => Self::Convert,
"BACKGROUND_JOB_TYPE_APPLY_DESTINATION" => Self::ApplyDestination,
"BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE" => Self::ImportRulesFile,
_ => Self::UnknownValue(background_job_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackgroundJobType {
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::SourceSeed => serializer.serialize_i32(1),
Self::Convert => serializer.serialize_i32(2),
Self::ApplyDestination => serializer.serialize_i32(3),
Self::ImportRulesFile => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackgroundJobType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackgroundJobType>::new(
".google.cloud.clouddms.v1.BackgroundJobType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImportRulesFileFormat {
Unspecified,
HarbourBridgeSessionFile,
OratopgConfigFile,
UnknownValue(import_rules_file_format::UnknownValue),
}
#[doc(hidden)]
pub mod import_rules_file_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImportRulesFileFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::HarbourBridgeSessionFile => std::option::Option::Some(1),
Self::OratopgConfigFile => 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("IMPORT_RULES_FILE_FORMAT_UNSPECIFIED"),
Self::HarbourBridgeSessionFile => {
std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE")
}
Self::OratopgConfigFile => {
std::option::Option::Some("IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImportRulesFileFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImportRulesFileFormat {
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 ImportRulesFileFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::HarbourBridgeSessionFile,
2 => Self::OratopgConfigFile,
_ => Self::UnknownValue(import_rules_file_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImportRulesFileFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
"IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" => {
Self::HarbourBridgeSessionFile
}
"IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" => Self::OratopgConfigFile,
_ => Self::UnknownValue(import_rules_file_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImportRulesFileFormat {
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::HarbourBridgeSessionFile => serializer.serialize_i32(1),
Self::OratopgConfigFile => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ImportRulesFileFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportRulesFileFormat>::new(
".google.cloud.clouddms.v1.ImportRulesFileFormat",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValueComparison {
Unspecified,
IfValueSmallerThan,
IfValueSmallerEqualThan,
IfValueLargerThan,
IfValueLargerEqualThan,
UnknownValue(value_comparison::UnknownValue),
}
#[doc(hidden)]
pub mod value_comparison {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ValueComparison {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::IfValueSmallerThan => std::option::Option::Some(1),
Self::IfValueSmallerEqualThan => std::option::Option::Some(2),
Self::IfValueLargerThan => std::option::Option::Some(3),
Self::IfValueLargerEqualThan => 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("VALUE_COMPARISON_UNSPECIFIED"),
Self::IfValueSmallerThan => {
std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_SMALLER_THAN")
}
Self::IfValueSmallerEqualThan => {
std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN")
}
Self::IfValueLargerThan => {
std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_LARGER_THAN")
}
Self::IfValueLargerEqualThan => {
std::option::Option::Some("VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ValueComparison {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ValueComparison {
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 ValueComparison {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::IfValueSmallerThan,
2 => Self::IfValueSmallerEqualThan,
3 => Self::IfValueLargerThan,
4 => Self::IfValueLargerEqualThan,
_ => Self::UnknownValue(value_comparison::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ValueComparison {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VALUE_COMPARISON_UNSPECIFIED" => Self::Unspecified,
"VALUE_COMPARISON_IF_VALUE_SMALLER_THAN" => Self::IfValueSmallerThan,
"VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN" => Self::IfValueSmallerEqualThan,
"VALUE_COMPARISON_IF_VALUE_LARGER_THAN" => Self::IfValueLargerThan,
"VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN" => Self::IfValueLargerEqualThan,
_ => Self::UnknownValue(value_comparison::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ValueComparison {
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::IfValueSmallerThan => serializer.serialize_i32(1),
Self::IfValueSmallerEqualThan => serializer.serialize_i32(2),
Self::IfValueLargerThan => serializer.serialize_i32(3),
Self::IfValueLargerEqualThan => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ValueComparison {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueComparison>::new(
".google.cloud.clouddms.v1.ValueComparison",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NumericFilterOption {
Unspecified,
All,
Limit,
Limitless,
UnknownValue(numeric_filter_option::UnknownValue),
}
#[doc(hidden)]
pub mod numeric_filter_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NumericFilterOption {
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::Limit => std::option::Option::Some(2),
Self::Limitless => 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("NUMERIC_FILTER_OPTION_UNSPECIFIED"),
Self::All => std::option::Option::Some("NUMERIC_FILTER_OPTION_ALL"),
Self::Limit => std::option::Option::Some("NUMERIC_FILTER_OPTION_LIMIT"),
Self::Limitless => std::option::Option::Some("NUMERIC_FILTER_OPTION_LIMITLESS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NumericFilterOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NumericFilterOption {
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 NumericFilterOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::All,
2 => Self::Limit,
3 => Self::Limitless,
_ => Self::UnknownValue(numeric_filter_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NumericFilterOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NUMERIC_FILTER_OPTION_UNSPECIFIED" => Self::Unspecified,
"NUMERIC_FILTER_OPTION_ALL" => Self::All,
"NUMERIC_FILTER_OPTION_LIMIT" => Self::Limit,
"NUMERIC_FILTER_OPTION_LIMITLESS" => Self::Limitless,
_ => Self::UnknownValue(numeric_filter_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NumericFilterOption {
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::Limit => serializer.serialize_i32(2),
Self::Limitless => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NumericFilterOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NumericFilterOption>::new(
".google.cloud.clouddms.v1.NumericFilterOption",
))
}
}