#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
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 AuthConfig {
pub auth_type: crate::model::AuthType,
pub additional_variables: std::vec::Vec<crate::model::ConfigVariable>,
pub r#type: std::option::Option<crate::model::auth_config::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
self.auth_type = v.into();
self
}
pub fn set_additional_variables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConfigVariable>,
{
use std::iter::Iterator;
self.additional_variables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_type<T: std::convert::Into<std::option::Option<crate::model::auth_config::Type>>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn user_password(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::UserPassword>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::auth_config::Type::UserPassword(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_user_password<
T: std::convert::Into<std::boxed::Box<crate::model::auth_config::UserPassword>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::auth_config::Type::UserPassword(v.into()));
self
}
pub fn oauth2_jwt_bearer(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::Oauth2JwtBearer>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::auth_config::Type::Oauth2JwtBearer(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_oauth2_jwt_bearer<
T: std::convert::Into<std::boxed::Box<crate::model::auth_config::Oauth2JwtBearer>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::auth_config::Type::Oauth2JwtBearer(v.into()));
self
}
pub fn oauth2_client_credentials(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentials>>
{
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::auth_config::Type::Oauth2ClientCredentials(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_oauth2_client_credentials<
T: std::convert::Into<std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentials>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::auth_config::Type::Oauth2ClientCredentials(v.into()),
);
self
}
pub fn ssh_public_key(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::SshPublicKey>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::auth_config::Type::SshPublicKey(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_ssh_public_key<
T: std::convert::Into<std::boxed::Box<crate::model::auth_config::SshPublicKey>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::auth_config::Type::SshPublicKey(v.into()));
self
}
}
impl wkt::message::Message for AuthConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig"
}
}
pub mod auth_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserPassword {
pub username: std::string::String,
pub password: std::option::Option<crate::model::Secret>,
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_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_password<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.password = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_password<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.password = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UserPassword {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.UserPassword"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Oauth2JwtBearer {
pub client_key: std::option::Option<crate::model::Secret>,
pub jwt_claims:
std::option::Option<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Oauth2JwtBearer {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_client_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_key = v.map(|x| x.into());
self
}
pub fn set_jwt_claims<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
{
self.jwt_claims = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_jwt_claims<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
{
self.jwt_claims = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Oauth2JwtBearer {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer"
}
}
pub mod oauth_2_jwt_bearer {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JwtClaims {
pub issuer: std::string::String,
pub subject: std::string::String,
pub audience: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JwtClaims {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issuer = v.into();
self
}
pub fn set_subject<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subject = v.into();
self
}
pub fn set_audience<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.audience = v.into();
self
}
}
impl wkt::message::Message for JwtClaims {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Oauth2ClientCredentials {
pub client_id: std::string::String,
pub client_secret: std::option::Option<crate::model::Secret>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Oauth2ClientCredentials {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_id = v.into();
self
}
pub fn set_client_secret<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_secret = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_secret<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_secret = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Oauth2ClientCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SshPublicKey {
pub username: std::string::String,
pub ssh_client_cert: std::option::Option<crate::model::Secret>,
pub cert_type: std::string::String,
pub ssh_client_cert_pass: std::option::Option<crate::model::Secret>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SshPublicKey {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_ssh_client_cert<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.ssh_client_cert = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssh_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.ssh_client_cert = v.map(|x| x.into());
self
}
pub fn set_cert_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cert_type = v.into();
self
}
pub fn set_ssh_client_cert_pass<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.ssh_client_cert_pass = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssh_client_cert_pass<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.ssh_client_cert_pass = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SshPublicKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.SshPublicKey"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
UserPassword(std::boxed::Box<crate::model::auth_config::UserPassword>),
Oauth2JwtBearer(std::boxed::Box<crate::model::auth_config::Oauth2JwtBearer>),
Oauth2ClientCredentials(
std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentials>,
),
SshPublicKey(std::boxed::Box<crate::model::auth_config::SshPublicKey>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthConfigTemplate {
pub auth_type: crate::model::AuthType,
pub config_variable_templates: std::vec::Vec<crate::model::ConfigVariableTemplate>,
pub display_name: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthConfigTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
self.auth_type = v.into();
self
}
pub fn set_config_variable_templates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConfigVariableTemplate>,
{
use std::iter::Iterator;
self.config_variable_templates = v.into_iter().map(|i| i.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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for AuthConfigTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfigTemplate"
}
}
#[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.connectors.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigVariableTemplate {
pub key: std::string::String,
pub value_type: crate::model::config_variable_template::ValueType,
pub display_name: std::string::String,
pub description: std::string::String,
pub validation_regex: std::string::String,
pub required: bool,
pub role_grant: std::option::Option<crate::model::RoleGrant>,
pub enum_options: std::vec::Vec<crate::model::EnumOption>,
pub authorization_code_link: std::option::Option<crate::model::AuthorizationCodeLink>,
pub state: crate::model::config_variable_template::State,
pub is_advanced: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfigVariableTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_value_type<
T: std::convert::Into<crate::model::config_variable_template::ValueType>,
>(
mut self,
v: T,
) -> Self {
self.value_type = 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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.validation_regex = v.into();
self
}
pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.required = v.into();
self
}
pub fn set_role_grant<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RoleGrant>,
{
self.role_grant = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_role_grant<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RoleGrant>,
{
self.role_grant = v.map(|x| x.into());
self
}
pub fn set_enum_options<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EnumOption>,
{
use std::iter::Iterator;
self.enum_options = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_authorization_code_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuthorizationCodeLink>,
{
self.authorization_code_link = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_authorization_code_link<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuthorizationCodeLink>,
{
self.authorization_code_link = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::config_variable_template::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_is_advanced<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.is_advanced = v.into();
self
}
}
impl wkt::message::Message for ConfigVariableTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ConfigVariableTemplate"
}
}
pub mod config_variable_template {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValueType {
Unspecified,
String,
Int,
Bool,
Secret,
Enum,
AuthorizationCode,
UnknownValue(value_type::UnknownValue),
}
#[doc(hidden)]
pub mod value_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ValueType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::String => std::option::Option::Some(1),
Self::Int => std::option::Option::Some(2),
Self::Bool => std::option::Option::Some(3),
Self::Secret => std::option::Option::Some(4),
Self::Enum => std::option::Option::Some(5),
Self::AuthorizationCode => 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("VALUE_TYPE_UNSPECIFIED"),
Self::String => std::option::Option::Some("STRING"),
Self::Int => std::option::Option::Some("INT"),
Self::Bool => std::option::Option::Some("BOOL"),
Self::Secret => std::option::Option::Some("SECRET"),
Self::Enum => std::option::Option::Some("ENUM"),
Self::AuthorizationCode => std::option::Option::Some("AUTHORIZATION_CODE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ValueType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ValueType {
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 ValueType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::String,
2 => Self::Int,
3 => Self::Bool,
4 => Self::Secret,
5 => Self::Enum,
6 => Self::AuthorizationCode,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ValueType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
"STRING" => Self::String,
"INT" => Self::Int,
"BOOL" => Self::Bool,
"SECRET" => Self::Secret,
"ENUM" => Self::Enum,
"AUTHORIZATION_CODE" => Self::AuthorizationCode,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ValueType {
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::String => serializer.serialize_i32(1),
Self::Int => serializer.serialize_i32(2),
Self::Bool => serializer.serialize_i32(3),
Self::Secret => serializer.serialize_i32(4),
Self::Enum => serializer.serialize_i32(5),
Self::AuthorizationCode => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ValueType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
".google.cloud.connectors.v1.ConfigVariableTemplate.ValueType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Deprecated,
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::Active => std::option::Option::Some(1),
Self::Deprecated => 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("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Deprecated => std::option::Option::Some("DEPRECATED"),
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::Active,
2 => Self::Deprecated,
_ => 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,
"ACTIVE" => Self::Active,
"DEPRECATED" => Self::Deprecated,
_ => 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::Active => serializer.serialize_i32(1),
Self::Deprecated => serializer.serialize_i32(2),
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.connectors.v1.ConfigVariableTemplate.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Secret {
pub secret_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Secret {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secret_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.secret_version = v.into();
self
}
}
impl wkt::message::Message for Secret {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Secret"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnumOption {
pub id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnumOption {
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_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 EnumOption {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.EnumOption"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigVariable {
pub key: std::string::String,
pub value: std::option::Option<crate::model::config_variable::Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfigVariable {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_value<
T: std::convert::Into<std::option::Option<crate::model::config_variable::Value>>,
>(
mut self,
v: T,
) -> Self {
self.value = v.into();
self
}
pub fn int_value(&self) -> std::option::Option<&i64> {
#[allow(unreachable_patterns)]
self.value.as_ref().and_then(|v| match v {
crate::model::config_variable::Value::IntValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.value =
std::option::Option::Some(crate::model::config_variable::Value::IntValue(v.into()));
self
}
pub fn bool_value(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.value.as_ref().and_then(|v| match v {
crate::model::config_variable::Value::BoolValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.value =
std::option::Option::Some(crate::model::config_variable::Value::BoolValue(v.into()));
self
}
pub fn string_value(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.value.as_ref().and_then(|v| match v {
crate::model::config_variable::Value::StringValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value =
std::option::Option::Some(crate::model::config_variable::Value::StringValue(v.into()));
self
}
pub fn secret_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Secret>> {
#[allow(unreachable_patterns)]
self.value.as_ref().and_then(|v| match v {
crate::model::config_variable::Value::SecretValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_secret_value<T: std::convert::Into<std::boxed::Box<crate::model::Secret>>>(
mut self,
v: T,
) -> Self {
self.value =
std::option::Option::Some(crate::model::config_variable::Value::SecretValue(v.into()));
self
}
}
impl wkt::message::Message for ConfigVariable {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ConfigVariable"
}
}
pub mod config_variable {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Value {
IntValue(i64),
BoolValue(bool),
StringValue(std::string::String),
SecretValue(std::boxed::Box<crate::model::Secret>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoleGrant {
pub principal: crate::model::role_grant::Principal,
pub roles: std::vec::Vec<std::string::String>,
pub resource: std::option::Option<crate::model::role_grant::Resource>,
pub helper_text_template: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RoleGrant {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_principal<T: std::convert::Into<crate::model::role_grant::Principal>>(
mut self,
v: T,
) -> Self {
self.principal = v.into();
self
}
pub fn set_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::role_grant::Resource>,
{
self.resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::role_grant::Resource>,
{
self.resource = v.map(|x| x.into());
self
}
pub fn set_helper_text_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.helper_text_template = v.into();
self
}
}
impl wkt::message::Message for RoleGrant {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RoleGrant"
}
}
pub mod role_grant {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Resource {
pub r#type: crate::model::role_grant::resource::Type,
pub path_template: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Resource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::role_grant::resource::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_path_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.path_template = v.into();
self
}
}
impl wkt::message::Message for Resource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RoleGrant.Resource"
}
}
pub mod resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
GcpProject,
GcpResource,
GcpSecretmanagerSecret,
GcpSecretmanagerSecretVersion,
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::GcpProject => std::option::Option::Some(1),
Self::GcpResource => std::option::Option::Some(2),
Self::GcpSecretmanagerSecret => std::option::Option::Some(3),
Self::GcpSecretmanagerSecretVersion => 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("TYPE_UNSPECIFIED"),
Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
Self::GcpResource => std::option::Option::Some("GCP_RESOURCE"),
Self::GcpSecretmanagerSecret => {
std::option::Option::Some("GCP_SECRETMANAGER_SECRET")
}
Self::GcpSecretmanagerSecretVersion => {
std::option::Option::Some("GCP_SECRETMANAGER_SECRET_VERSION")
}
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::GcpProject,
2 => Self::GcpResource,
3 => Self::GcpSecretmanagerSecret,
4 => Self::GcpSecretmanagerSecretVersion,
_ => 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,
"GCP_PROJECT" => Self::GcpProject,
"GCP_RESOURCE" => Self::GcpResource,
"GCP_SECRETMANAGER_SECRET" => Self::GcpSecretmanagerSecret,
"GCP_SECRETMANAGER_SECRET_VERSION" => Self::GcpSecretmanagerSecretVersion,
_ => 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::GcpProject => serializer.serialize_i32(1),
Self::GcpResource => serializer.serialize_i32(2),
Self::GcpSecretmanagerSecret => serializer.serialize_i32(3),
Self::GcpSecretmanagerSecretVersion => serializer.serialize_i32(4),
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.connectors.v1.RoleGrant.Resource.Type",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Principal {
Unspecified,
ConnectorSa,
UnknownValue(principal::UnknownValue),
}
#[doc(hidden)]
pub mod principal {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Principal {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ConnectorSa => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PRINCIPAL_UNSPECIFIED"),
Self::ConnectorSa => std::option::Option::Some("CONNECTOR_SA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Principal {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Principal {
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 Principal {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ConnectorSa,
_ => Self::UnknownValue(principal::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Principal {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRINCIPAL_UNSPECIFIED" => Self::Unspecified,
"CONNECTOR_SA" => Self::ConnectorSa,
_ => Self::UnknownValue(principal::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Principal {
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::ConnectorSa => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Principal {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Principal>::new(
".google.cloud.connectors.v1.RoleGrant.Principal",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthorizationCodeLink {
pub uri: std::string::String,
pub scopes: std::vec::Vec<std::string::String>,
pub client_id: std::string::String,
pub enable_pkce: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthorizationCodeLink {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_scopes<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.scopes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_id = v.into();
self
}
pub fn set_enable_pkce<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_pkce = v.into();
self
}
}
impl wkt::message::Message for AuthorizationCodeLink {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthorizationCodeLink"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Connection {
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 description: std::string::String,
pub connector_version: std::string::String,
pub status: std::option::Option<crate::model::ConnectionStatus>,
pub config_variables: std::vec::Vec<crate::model::ConfigVariable>,
pub auth_config: std::option::Option<crate::model::AuthConfig>,
pub lock_config: std::option::Option<crate::model::LockConfig>,
pub destination_configs: std::vec::Vec<crate::model::DestinationConfig>,
pub image_location: std::string::String,
pub service_account: std::string::String,
pub service_directory: std::string::String,
pub envoy_image_location: std::string::String,
pub suspended: bool,
pub node_config: std::option::Option<crate::model::NodeConfig>,
pub ssl_config: std::option::Option<crate::model::SslConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Connection {
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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_connector_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.connector_version = v.into();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConnectionStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConnectionStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_config_variables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConfigVariable>,
{
use std::iter::Iterator;
self.config_variables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_auth_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuthConfig>,
{
self.auth_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuthConfig>,
{
self.auth_config = v.map(|x| x.into());
self
}
pub fn set_lock_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LockConfig>,
{
self.lock_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lock_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LockConfig>,
{
self.lock_config = v.map(|x| x.into());
self
}
pub fn set_destination_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DestinationConfig>,
{
use std::iter::Iterator;
self.destination_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_image_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_location = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_service_directory<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_directory = v.into();
self
}
pub fn set_envoy_image_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.envoy_image_location = v.into();
self
}
pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.suspended = v.into();
self
}
pub fn set_node_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeConfig>,
{
self.node_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeConfig>,
{
self.node_config = v.map(|x| x.into());
self
}
pub fn set_ssl_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslConfig>,
{
self.ssl_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Connection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Connection"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeConfig {
pub min_node_count: i32,
pub max_node_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_node_count = v.into();
self
}
pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_node_count = v.into();
self
}
}
impl wkt::message::Message for NodeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.NodeConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectionSchemaMetadata {
pub entities: std::vec::Vec<std::string::String>,
pub actions: std::vec::Vec<std::string::String>,
pub name: std::string::String,
pub update_time: std::option::Option<wkt::Timestamp>,
pub refresh_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::connection_schema_metadata::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectionSchemaMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_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_refresh_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.refresh_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_refresh_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.refresh_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::connection_schema_metadata::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for ConnectionSchemaMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ConnectionSchemaMetadata"
}
}
pub mod connection_schema_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Refreshing,
Updated,
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::Refreshing => std::option::Option::Some(1),
Self::Updated => 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("STATE_UNSPECIFIED"),
Self::Refreshing => std::option::Option::Some("REFRESHING"),
Self::Updated => std::option::Option::Some("UPDATED"),
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::Refreshing,
2 => Self::Updated,
_ => 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,
"REFRESHING" => Self::Refreshing,
"UPDATED" => Self::Updated,
_ => 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::Refreshing => serializer.serialize_i32(1),
Self::Updated => serializer.serialize_i32(2),
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.connectors.v1.ConnectionSchemaMetadata.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeEntitySchema {
pub entity: std::string::String,
pub fields: std::vec::Vec<crate::model::runtime_entity_schema::Field>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeEntitySchema {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity = v.into();
self
}
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::runtime_entity_schema::Field>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RuntimeEntitySchema {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeEntitySchema"
}
}
pub mod runtime_entity_schema {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Field {
pub field: std::string::String,
pub description: std::string::String,
pub data_type: crate::model::DataType,
pub key: bool,
pub readonly: bool,
pub nullable: bool,
pub default_value: std::option::Option<wkt::Value>,
pub additional_details: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Field {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_data_type<T: std::convert::Into<crate::model::DataType>>(
mut self,
v: T,
) -> Self {
self.data_type = v.into();
self
}
pub fn set_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_readonly<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.readonly = 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_default_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Value>,
{
self.default_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Value>,
{
self.default_value = v.map(|x| x.into());
self
}
pub fn set_additional_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.additional_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_additional_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.additional_details = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Field {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeEntitySchema.Field"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeActionSchema {
pub action: std::string::String,
pub input_parameters: std::vec::Vec<crate::model::runtime_action_schema::InputParameter>,
pub result_metadata: std::vec::Vec<crate::model::runtime_action_schema::ResultMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeActionSchema {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.action = v.into();
self
}
pub fn set_input_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::runtime_action_schema::InputParameter>,
{
use std::iter::Iterator;
self.input_parameters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_result_metadata<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::runtime_action_schema::ResultMetadata>,
{
use std::iter::Iterator;
self.result_metadata = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RuntimeActionSchema {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema"
}
}
pub mod runtime_action_schema {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputParameter {
pub parameter: std::string::String,
pub description: std::string::String,
pub data_type: crate::model::DataType,
pub nullable: bool,
pub default_value: std::option::Option<wkt::Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InputParameter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parameter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parameter = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_data_type<T: std::convert::Into<crate::model::DataType>>(
mut self,
v: T,
) -> Self {
self.data_type = 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_default_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Value>,
{
self.default_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Value>,
{
self.default_value = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InputParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema.InputParameter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResultMetadata {
pub field: std::string::String,
pub description: std::string::String,
pub data_type: crate::model::DataType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResultMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_data_type<T: std::convert::Into<crate::model::DataType>>(
mut self,
v: T,
) -> Self {
self.data_type = v.into();
self
}
}
impl wkt::message::Message for ResultMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LockConfig {
pub locked: bool,
pub reason: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LockConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.locked = v.into();
self
}
pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.reason = v.into();
self
}
}
impl wkt::message::Message for LockConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.LockConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectionsRequest {
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 view: crate::model::ConnectionView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectionsRequest {
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
}
pub fn set_view<T: std::convert::Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListConnectionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListConnectionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectionsResponse {
pub connections: std::vec::Vec<crate::model::Connection>,
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 ListConnectionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Connection>,
{
use std::iter::Iterator;
self.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 ListConnectionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListConnectionsResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
type PageItem = crate::model::Connection;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.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 GetConnectionRequest {
pub name: std::string::String,
pub view: crate::model::ConnectionView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConnectionRequest {
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_view<T: std::convert::Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateConnectionRequest {
pub parent: std::string::String,
pub connection_id: std::string::String,
pub connection: std::option::Option<crate::model::Connection>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateConnectionRequest {
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_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connection_id = v.into();
self
}
pub fn set_connection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Connection>,
{
self.connection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Connection>,
{
self.connection = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.CreateConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateConnectionRequest {
pub connection: std::option::Option<crate::model::Connection>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateConnectionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Connection>,
{
self.connection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Connection>,
{
self.connection = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.UpdateConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteConnectionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteConnectionRequest {
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 DeleteConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.DeleteConnectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConnectionSchemaMetadataRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConnectionSchemaMetadataRequest {
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 GetConnectionSchemaMetadataRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RefreshConnectionSchemaMetadataRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RefreshConnectionSchemaMetadataRequest {
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 RefreshConnectionSchemaMetadataRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuntimeEntitySchemasRequest {
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 ListRuntimeEntitySchemasRequest {
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 ListRuntimeEntitySchemasRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuntimeEntitySchemasResponse {
pub runtime_entity_schemas: std::vec::Vec<crate::model::RuntimeEntitySchema>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuntimeEntitySchemasResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_runtime_entity_schemas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RuntimeEntitySchema>,
{
use std::iter::Iterator;
self.runtime_entity_schemas = 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 ListRuntimeEntitySchemasResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRuntimeEntitySchemasResponse {
type PageItem = crate::model::RuntimeEntitySchema;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.runtime_entity_schemas
}
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 ListRuntimeActionSchemasRequest {
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 ListRuntimeActionSchemasRequest {
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 ListRuntimeActionSchemasRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListRuntimeActionSchemasRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuntimeActionSchemasResponse {
pub runtime_action_schemas: std::vec::Vec<crate::model::RuntimeActionSchema>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuntimeActionSchemasResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_runtime_action_schemas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RuntimeActionSchema>,
{
use std::iter::Iterator;
self.runtime_action_schemas = 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 ListRuntimeActionSchemasResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListRuntimeActionSchemasResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRuntimeActionSchemasResponse {
type PageItem = crate::model::RuntimeActionSchema;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.runtime_action_schemas
}
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 ConnectionStatus {
pub state: crate::model::connection_status::State,
pub description: std::string::String,
pub status: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectionStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::connection_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
}
impl wkt::message::Message for ConnectionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ConnectionStatus"
}
}
pub mod connection_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Active,
Inactive,
Deleting,
Updating,
Error,
AuthorizationRequired,
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::Active => std::option::Option::Some(2),
Self::Inactive => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(4),
Self::Updating => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
Self::AuthorizationRequired => 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::Creating => std::option::Option::Some("CREATING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Inactive => std::option::Option::Some("INACTIVE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::AuthorizationRequired => std::option::Option::Some("AUTHORIZATION_REQUIRED"),
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::Active,
3 => Self::Inactive,
4 => Self::Deleting,
5 => Self::Updating,
6 => Self::Error,
7 => Self::AuthorizationRequired,
_ => 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,
"ACTIVE" => Self::Active,
"INACTIVE" => Self::Inactive,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
"ERROR" => Self::Error,
"AUTHORIZATION_REQUIRED" => Self::AuthorizationRequired,
_ => 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::Active => serializer.serialize_i32(2),
Self::Inactive => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(4),
Self::Updating => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
Self::AuthorizationRequired => 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.connectors.v1.ConnectionStatus.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Connector {
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 documentation_uri: std::string::String,
pub external_uri: std::string::String,
pub description: std::string::String,
pub web_assets_location: std::string::String,
pub display_name: std::string::String,
pub launch_stage: crate::model::LaunchStage,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Connector {
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_documentation_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.documentation_uri = v.into();
self
}
pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.external_uri = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_web_assets_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.web_assets_location = 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_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
}
impl wkt::message::Message for Connector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Connector"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConnectorRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConnectorRequest {
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 GetConnectorRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetConnectorRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectorsRequest {
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 ListConnectorsRequest {
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 ListConnectorsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListConnectorsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectorsResponse {
pub connectors: std::vec::Vec<crate::model::Connector>,
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 ListConnectorsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connectors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Connector>,
{
use std::iter::Iterator;
self.connectors = 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 ListConnectorsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListConnectorsResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListConnectorsResponse {
type PageItem = crate::model::Connector;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.connectors
}
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 ConnectorVersion {
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 launch_stage: crate::model::LaunchStage,
pub release_version: std::string::String,
pub auth_config_templates: std::vec::Vec<crate::model::AuthConfigTemplate>,
pub config_variable_templates: std::vec::Vec<crate::model::ConfigVariableTemplate>,
pub supported_runtime_features: std::option::Option<crate::model::SupportedRuntimeFeatures>,
pub display_name: std::string::String,
pub egress_control_config: std::option::Option<crate::model::EgressControlConfig>,
pub role_grants: std::vec::Vec<crate::model::RoleGrant>,
pub role_grant: std::option::Option<crate::model::RoleGrant>,
pub ssl_config_template: std::option::Option<crate::model::SslConfigTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectorVersion {
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_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_release_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_version = v.into();
self
}
pub fn set_auth_config_templates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuthConfigTemplate>,
{
use std::iter::Iterator;
self.auth_config_templates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_config_variable_templates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConfigVariableTemplate>,
{
use std::iter::Iterator;
self.config_variable_templates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_supported_runtime_features<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SupportedRuntimeFeatures>,
{
self.supported_runtime_features = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_supported_runtime_features<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SupportedRuntimeFeatures>,
{
self.supported_runtime_features = 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
}
pub fn set_egress_control_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EgressControlConfig>,
{
self.egress_control_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_egress_control_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EgressControlConfig>,
{
self.egress_control_config = v.map(|x| x.into());
self
}
pub fn set_role_grants<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RoleGrant>,
{
use std::iter::Iterator;
self.role_grants = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_role_grant<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RoleGrant>,
{
self.role_grant = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_role_grant<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RoleGrant>,
{
self.role_grant = v.map(|x| x.into());
self
}
pub fn set_ssl_config_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SslConfigTemplate>,
{
self.ssl_config_template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ssl_config_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SslConfigTemplate>,
{
self.ssl_config_template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ConnectorVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ConnectorVersion"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConnectorVersionRequest {
pub name: std::string::String,
pub view: crate::model::ConnectorVersionView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConnectorVersionRequest {
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_view<T: std::convert::Into<crate::model::ConnectorVersionView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetConnectorVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetConnectorVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectorVersionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::ConnectorVersionView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectorVersionsRequest {
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_view<T: std::convert::Into<crate::model::ConnectorVersionView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListConnectorVersionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListConnectorVersionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConnectorVersionsResponse {
pub connector_versions: std::vec::Vec<crate::model::ConnectorVersion>,
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 ListConnectorVersionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connector_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConnectorVersion>,
{
use std::iter::Iterator;
self.connector_versions = 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 ListConnectorVersionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListConnectorVersionsResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListConnectorVersionsResponse {
type PageItem = crate::model::ConnectorVersion;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.connector_versions
}
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 SupportedRuntimeFeatures {
pub entity_apis: bool,
pub action_apis: bool,
pub sql_query: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SupportedRuntimeFeatures {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.entity_apis = v.into();
self
}
pub fn set_action_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.action_apis = v.into();
self
}
pub fn set_sql_query<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.sql_query = v.into();
self
}
}
impl wkt::message::Message for SupportedRuntimeFeatures {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.SupportedRuntimeFeatures"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EgressControlConfig {
pub oneof_backends: std::option::Option<crate::model::egress_control_config::OneofBackends>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EgressControlConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_oneof_backends<
T: std::convert::Into<std::option::Option<crate::model::egress_control_config::OneofBackends>>,
>(
mut self,
v: T,
) -> Self {
self.oneof_backends = v.into();
self
}
pub fn backends(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.oneof_backends.as_ref().and_then(|v| match v {
crate::model::egress_control_config::OneofBackends::Backends(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_backends<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.oneof_backends = std::option::Option::Some(
crate::model::egress_control_config::OneofBackends::Backends(v.into()),
);
self
}
pub fn extraction_rules(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExtractionRules>> {
#[allow(unreachable_patterns)]
self.oneof_backends.as_ref().and_then(|v| match v {
crate::model::egress_control_config::OneofBackends::ExtractionRules(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_extraction_rules<
T: std::convert::Into<std::boxed::Box<crate::model::ExtractionRules>>,
>(
mut self,
v: T,
) -> Self {
self.oneof_backends = std::option::Option::Some(
crate::model::egress_control_config::OneofBackends::ExtractionRules(v.into()),
);
self
}
}
impl wkt::message::Message for EgressControlConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.EgressControlConfig"
}
}
pub mod egress_control_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OneofBackends {
Backends(std::string::String),
ExtractionRules(std::boxed::Box<crate::model::ExtractionRules>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExtractionRules {
pub extraction_rule: std::vec::Vec<crate::model::ExtractionRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExtractionRules {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_extraction_rule<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ExtractionRule>,
{
use std::iter::Iterator;
self.extraction_rule = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ExtractionRules {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ExtractionRules"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExtractionRule {
pub source: std::option::Option<crate::model::extraction_rule::Source>,
pub extraction_regex: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExtractionRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::extraction_rule::Source>,
{
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::extraction_rule::Source>,
{
self.source = v.map(|x| x.into());
self
}
pub fn set_extraction_regex<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.extraction_regex = v.into();
self
}
}
impl wkt::message::Message for ExtractionRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ExtractionRule"
}
}
pub mod extraction_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Source {
pub source_type: crate::model::extraction_rule::SourceType,
pub field_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Source {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_type<T: std::convert::Into<crate::model::extraction_rule::SourceType>>(
mut self,
v: T,
) -> Self {
self.source_type = v.into();
self
}
pub fn set_field_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field_id = v.into();
self
}
}
impl wkt::message::Message for Source {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ExtractionRule.Source"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceType {
Unspecified,
ConfigVariable,
UnknownValue(source_type::UnknownValue),
}
#[doc(hidden)]
pub mod source_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SourceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ConfigVariable => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
Self::ConfigVariable => std::option::Option::Some("CONFIG_VARIABLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SourceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SourceType {
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 SourceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ConfigVariable,
_ => Self::UnknownValue(source_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SourceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
"CONFIG_VARIABLE" => Self::ConfigVariable,
_ => Self::UnknownValue(source_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SourceType {
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::ConfigVariable => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SourceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
".google.cloud.connectors.v1.ExtractionRule.SourceType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestinationConfig {
pub key: std::string::String,
pub destinations: std::vec::Vec<crate::model::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestinationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Destination>,
{
use std::iter::Iterator;
self.destinations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DestinationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.DestinationConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Destination {
pub port: i32,
pub destination: std::option::Option<crate::model::destination::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Destination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = v.into();
self
}
pub fn set_destination<
T: std::convert::Into<std::option::Option<crate::model::destination::Destination>>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn service_attachment(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::destination::Destination::ServiceAttachment(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::destination::Destination::ServiceAttachment(v.into()),
);
self
}
pub fn host(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::destination::Destination::Host(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination =
std::option::Option::Some(crate::model::destination::Destination::Host(v.into()));
self
}
}
impl wkt::message::Message for Destination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Destination"
}
}
pub mod destination {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
ServiceAttachment(std::string::String),
Host(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Provider {
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 documentation_uri: std::string::String,
pub external_uri: std::string::String,
pub description: std::string::String,
pub web_assets_location: std::string::String,
pub display_name: std::string::String,
pub launch_stage: crate::model::LaunchStage,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Provider {
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_documentation_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.documentation_uri = v.into();
self
}
pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.external_uri = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_web_assets_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.web_assets_location = 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_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
}
impl wkt::message::Message for Provider {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Provider"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetProviderRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetProviderRequest {
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 GetProviderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetProviderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListProvidersRequest {
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 ListProvidersRequest {
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 ListProvidersRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListProvidersRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListProvidersResponse {
pub providers: std::vec::Vec<crate::model::Provider>,
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 ListProvidersResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_providers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Provider>,
{
use std::iter::Iterator;
self.providers = 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 ListProvidersResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ListProvidersResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListProvidersResponse {
type PageItem = crate::model::Provider;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.providers
}
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 GetRuntimeConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRuntimeConfigRequest {
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 GetRuntimeConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetRuntimeConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeConfig {
pub location_id: std::string::String,
pub connd_topic: std::string::String,
pub connd_subscription: std::string::String,
pub control_plane_topic: std::string::String,
pub control_plane_subscription: std::string::String,
pub runtime_endpoint: std::string::String,
pub state: crate::model::runtime_config::State,
pub schema_gcs_bucket: std::string::String,
pub service_directory: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location_id = v.into();
self
}
pub fn set_connd_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connd_topic = v.into();
self
}
pub fn set_connd_subscription<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.connd_subscription = v.into();
self
}
pub fn set_control_plane_topic<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.control_plane_topic = v.into();
self
}
pub fn set_control_plane_subscription<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.control_plane_subscription = v.into();
self
}
pub fn set_runtime_endpoint<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.runtime_endpoint = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_schema_gcs_bucket<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.schema_gcs_bucket = v.into();
self
}
pub fn set_service_directory<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_directory = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for RuntimeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeConfig"
}
}
pub mod runtime_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
#[deprecated]
Inactive,
#[deprecated]
Activating,
Active,
Creating,
Deleting,
Updating,
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::Inactive => std::option::Option::Some(1),
Self::Activating => std::option::Option::Some(2),
Self::Active => std::option::Option::Some(3),
Self::Creating => std::option::Option::Some(4),
Self::Deleting => std::option::Option::Some(5),
Self::Updating => 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::Inactive => std::option::Option::Some("INACTIVE"),
Self::Activating => std::option::Option::Some("ACTIVATING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
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::Inactive,
2 => Self::Activating,
3 => Self::Active,
4 => Self::Creating,
5 => Self::Deleting,
6 => Self::Updating,
_ => 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,
"INACTIVE" => Self::Inactive,
"ACTIVATING" => Self::Activating,
"ACTIVE" => Self::Active,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
_ => 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::Inactive => serializer.serialize_i32(1),
Self::Activating => serializer.serialize_i32(2),
Self::Active => serializer.serialize_i32(3),
Self::Creating => serializer.serialize_i32(4),
Self::Deleting => serializer.serialize_i32(5),
Self::Updating => 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.connectors.v1.RuntimeConfig.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGlobalSettingsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGlobalSettingsRequest {
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 GetGlobalSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.GetGlobalSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Settings {
pub name: std::string::String,
pub vpcsc: bool,
pub payg: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Settings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_vpcsc<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.vpcsc = v.into();
self
}
pub fn set_payg<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.payg = v.into();
self
}
}
impl wkt::message::Message for Settings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Settings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslConfigTemplate {
pub ssl_type: crate::model::SslType,
pub is_tls_mandatory: bool,
pub server_cert_type: std::vec::Vec<crate::model::CertType>,
pub client_cert_type: std::vec::Vec<crate::model::CertType>,
pub additional_variables: std::vec::Vec<crate::model::ConfigVariableTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SslConfigTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ssl_type<T: std::convert::Into<crate::model::SslType>>(mut self, v: T) -> Self {
self.ssl_type = v.into();
self
}
pub fn set_is_tls_mandatory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.is_tls_mandatory = v.into();
self
}
pub fn set_server_cert_type<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CertType>,
{
use std::iter::Iterator;
self.server_cert_type = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_client_cert_type<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CertType>,
{
use std::iter::Iterator;
self.client_cert_type = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_additional_variables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConfigVariableTemplate>,
{
use std::iter::Iterator;
self.additional_variables = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SslConfigTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.SslConfigTemplate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SslConfig {
pub r#type: crate::model::SslType,
pub trust_model: crate::model::ssl_config::TrustModel,
pub private_server_certificate: std::option::Option<crate::model::Secret>,
pub client_certificate: std::option::Option<crate::model::Secret>,
pub client_private_key: std::option::Option<crate::model::Secret>,
pub client_private_key_pass: std::option::Option<crate::model::Secret>,
pub server_cert_type: crate::model::CertType,
pub client_cert_type: crate::model::CertType,
pub use_ssl: bool,
pub additional_variables: std::vec::Vec<crate::model::ConfigVariable>,
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::SslType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_trust_model<T: std::convert::Into<crate::model::ssl_config::TrustModel>>(
mut self,
v: T,
) -> Self {
self.trust_model = v.into();
self
}
pub fn set_private_server_certificate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.private_server_certificate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_private_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.private_server_certificate = v.map(|x| x.into());
self
}
pub fn set_client_certificate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_certificate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_certificate = v.map(|x| x.into());
self
}
pub fn set_client_private_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_private_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_private_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_private_key = v.map(|x| x.into());
self
}
pub fn set_client_private_key_pass<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_private_key_pass = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_private_key_pass<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Secret>,
{
self.client_private_key_pass = v.map(|x| x.into());
self
}
pub fn set_server_cert_type<T: std::convert::Into<crate::model::CertType>>(
mut self,
v: T,
) -> Self {
self.server_cert_type = v.into();
self
}
pub fn set_client_cert_type<T: std::convert::Into<crate::model::CertType>>(
mut self,
v: T,
) -> Self {
self.client_cert_type = v.into();
self
}
pub fn set_use_ssl<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_ssl = v.into();
self
}
pub fn set_additional_variables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ConfigVariable>,
{
use std::iter::Iterator;
self.additional_variables = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SslConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.SslConfig"
}
}
pub mod ssl_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TrustModel {
Public,
Private,
Insecure,
UnknownValue(trust_model::UnknownValue),
}
#[doc(hidden)]
pub mod trust_model {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TrustModel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Public => std::option::Option::Some(0),
Self::Private => std::option::Option::Some(1),
Self::Insecure => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Public => std::option::Option::Some("PUBLIC"),
Self::Private => std::option::Option::Some("PRIVATE"),
Self::Insecure => std::option::Option::Some("INSECURE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TrustModel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TrustModel {
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 TrustModel {
fn from(value: i32) -> Self {
match value {
0 => Self::Public,
1 => Self::Private,
2 => Self::Insecure,
_ => Self::UnknownValue(trust_model::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TrustModel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PUBLIC" => Self::Public,
"PRIVATE" => Self::Private,
"INSECURE" => Self::Insecure,
_ => Self::UnknownValue(trust_model::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TrustModel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Public => serializer.serialize_i32(0),
Self::Private => serializer.serialize_i32(1),
Self::Insecure => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TrustModel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TrustModel>::new(
".google.cloud.connectors.v1.SslConfig.TrustModel",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthType {
Unspecified,
UserPassword,
Oauth2JwtBearer,
Oauth2ClientCredentials,
SshPublicKey,
Oauth2AuthCodeFlow,
UnknownValue(auth_type::UnknownValue),
}
#[doc(hidden)]
pub mod auth_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AuthType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UserPassword => std::option::Option::Some(1),
Self::Oauth2JwtBearer => std::option::Option::Some(2),
Self::Oauth2ClientCredentials => std::option::Option::Some(3),
Self::SshPublicKey => std::option::Option::Some(4),
Self::Oauth2AuthCodeFlow => 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("AUTH_TYPE_UNSPECIFIED"),
Self::UserPassword => std::option::Option::Some("USER_PASSWORD"),
Self::Oauth2JwtBearer => std::option::Option::Some("OAUTH2_JWT_BEARER"),
Self::Oauth2ClientCredentials => std::option::Option::Some("OAUTH2_CLIENT_CREDENTIALS"),
Self::SshPublicKey => std::option::Option::Some("SSH_PUBLIC_KEY"),
Self::Oauth2AuthCodeFlow => std::option::Option::Some("OAUTH2_AUTH_CODE_FLOW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AuthType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AuthType {
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 AuthType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UserPassword,
2 => Self::Oauth2JwtBearer,
3 => Self::Oauth2ClientCredentials,
4 => Self::SshPublicKey,
5 => Self::Oauth2AuthCodeFlow,
_ => Self::UnknownValue(auth_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AuthType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
"USER_PASSWORD" => Self::UserPassword,
"OAUTH2_JWT_BEARER" => Self::Oauth2JwtBearer,
"OAUTH2_CLIENT_CREDENTIALS" => Self::Oauth2ClientCredentials,
"SSH_PUBLIC_KEY" => Self::SshPublicKey,
"OAUTH2_AUTH_CODE_FLOW" => Self::Oauth2AuthCodeFlow,
_ => Self::UnknownValue(auth_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AuthType {
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::UserPassword => serializer.serialize_i32(1),
Self::Oauth2JwtBearer => serializer.serialize_i32(2),
Self::Oauth2ClientCredentials => serializer.serialize_i32(3),
Self::SshPublicKey => serializer.serialize_i32(4),
Self::Oauth2AuthCodeFlow => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AuthType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
".google.cloud.connectors.v1.AuthType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LaunchStage {
Unspecified,
Preview,
Ga,
Deprecated,
PrivatePreview,
UnknownValue(launch_stage::UnknownValue),
}
#[doc(hidden)]
pub mod launch_stage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LaunchStage {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Preview => std::option::Option::Some(1),
Self::Ga => std::option::Option::Some(2),
Self::Deprecated => std::option::Option::Some(3),
Self::PrivatePreview => 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("LAUNCH_STAGE_UNSPECIFIED"),
Self::Preview => std::option::Option::Some("PREVIEW"),
Self::Ga => std::option::Option::Some("GA"),
Self::Deprecated => std::option::Option::Some("DEPRECATED"),
Self::PrivatePreview => std::option::Option::Some("PRIVATE_PREVIEW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LaunchStage {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LaunchStage {
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 LaunchStage {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Preview,
2 => Self::Ga,
3 => Self::Deprecated,
5 => Self::PrivatePreview,
_ => Self::UnknownValue(launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LaunchStage {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LAUNCH_STAGE_UNSPECIFIED" => Self::Unspecified,
"PREVIEW" => Self::Preview,
"GA" => Self::Ga,
"DEPRECATED" => Self::Deprecated,
"PRIVATE_PREVIEW" => Self::PrivatePreview,
_ => Self::UnknownValue(launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LaunchStage {
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::Preview => serializer.serialize_i32(1),
Self::Ga => serializer.serialize_i32(2),
Self::Deprecated => serializer.serialize_i32(3),
Self::PrivatePreview => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LaunchStage {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LaunchStage>::new(
".google.cloud.connectors.v1.LaunchStage",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataType {
Unspecified,
#[deprecated]
Int,
Smallint,
Double,
Date,
#[deprecated]
Datetime,
Time,
#[deprecated]
String,
#[deprecated]
Long,
Boolean,
Decimal,
#[deprecated]
Uuid,
Blob,
Bit,
Tinyint,
Integer,
Bigint,
Float,
Real,
Numeric,
Char,
Varchar,
Longvarchar,
Timestamp,
Nchar,
Nvarchar,
Longnvarchar,
Null,
Other,
JavaObject,
Distinct,
Struct,
Array,
Clob,
Ref,
Datalink,
Rowid,
Binary,
Varbinary,
Longvarbinary,
Nclob,
Sqlxml,
RefCursor,
TimeWithTimezone,
TimestampWithTimezone,
UnknownValue(data_type::UnknownValue),
}
#[doc(hidden)]
pub mod data_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Int => std::option::Option::Some(1),
Self::Smallint => std::option::Option::Some(2),
Self::Double => std::option::Option::Some(3),
Self::Date => std::option::Option::Some(4),
Self::Datetime => std::option::Option::Some(5),
Self::Time => std::option::Option::Some(6),
Self::String => std::option::Option::Some(7),
Self::Long => std::option::Option::Some(8),
Self::Boolean => std::option::Option::Some(9),
Self::Decimal => std::option::Option::Some(10),
Self::Uuid => std::option::Option::Some(11),
Self::Blob => std::option::Option::Some(12),
Self::Bit => std::option::Option::Some(13),
Self::Tinyint => std::option::Option::Some(14),
Self::Integer => std::option::Option::Some(15),
Self::Bigint => std::option::Option::Some(16),
Self::Float => std::option::Option::Some(17),
Self::Real => std::option::Option::Some(18),
Self::Numeric => std::option::Option::Some(19),
Self::Char => std::option::Option::Some(20),
Self::Varchar => std::option::Option::Some(21),
Self::Longvarchar => std::option::Option::Some(22),
Self::Timestamp => std::option::Option::Some(23),
Self::Nchar => std::option::Option::Some(24),
Self::Nvarchar => std::option::Option::Some(25),
Self::Longnvarchar => std::option::Option::Some(26),
Self::Null => std::option::Option::Some(27),
Self::Other => std::option::Option::Some(28),
Self::JavaObject => std::option::Option::Some(29),
Self::Distinct => std::option::Option::Some(30),
Self::Struct => std::option::Option::Some(31),
Self::Array => std::option::Option::Some(32),
Self::Clob => std::option::Option::Some(33),
Self::Ref => std::option::Option::Some(34),
Self::Datalink => std::option::Option::Some(35),
Self::Rowid => std::option::Option::Some(36),
Self::Binary => std::option::Option::Some(37),
Self::Varbinary => std::option::Option::Some(38),
Self::Longvarbinary => std::option::Option::Some(39),
Self::Nclob => std::option::Option::Some(40),
Self::Sqlxml => std::option::Option::Some(41),
Self::RefCursor => std::option::Option::Some(42),
Self::TimeWithTimezone => std::option::Option::Some(43),
Self::TimestampWithTimezone => std::option::Option::Some(44),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
Self::Int => std::option::Option::Some("DATA_TYPE_INT"),
Self::Smallint => std::option::Option::Some("DATA_TYPE_SMALLINT"),
Self::Double => std::option::Option::Some("DATA_TYPE_DOUBLE"),
Self::Date => std::option::Option::Some("DATA_TYPE_DATE"),
Self::Datetime => std::option::Option::Some("DATA_TYPE_DATETIME"),
Self::Time => std::option::Option::Some("DATA_TYPE_TIME"),
Self::String => std::option::Option::Some("DATA_TYPE_STRING"),
Self::Long => std::option::Option::Some("DATA_TYPE_LONG"),
Self::Boolean => std::option::Option::Some("DATA_TYPE_BOOLEAN"),
Self::Decimal => std::option::Option::Some("DATA_TYPE_DECIMAL"),
Self::Uuid => std::option::Option::Some("DATA_TYPE_UUID"),
Self::Blob => std::option::Option::Some("DATA_TYPE_BLOB"),
Self::Bit => std::option::Option::Some("DATA_TYPE_BIT"),
Self::Tinyint => std::option::Option::Some("DATA_TYPE_TINYINT"),
Self::Integer => std::option::Option::Some("DATA_TYPE_INTEGER"),
Self::Bigint => std::option::Option::Some("DATA_TYPE_BIGINT"),
Self::Float => std::option::Option::Some("DATA_TYPE_FLOAT"),
Self::Real => std::option::Option::Some("DATA_TYPE_REAL"),
Self::Numeric => std::option::Option::Some("DATA_TYPE_NUMERIC"),
Self::Char => std::option::Option::Some("DATA_TYPE_CHAR"),
Self::Varchar => std::option::Option::Some("DATA_TYPE_VARCHAR"),
Self::Longvarchar => std::option::Option::Some("DATA_TYPE_LONGVARCHAR"),
Self::Timestamp => std::option::Option::Some("DATA_TYPE_TIMESTAMP"),
Self::Nchar => std::option::Option::Some("DATA_TYPE_NCHAR"),
Self::Nvarchar => std::option::Option::Some("DATA_TYPE_NVARCHAR"),
Self::Longnvarchar => std::option::Option::Some("DATA_TYPE_LONGNVARCHAR"),
Self::Null => std::option::Option::Some("DATA_TYPE_NULL"),
Self::Other => std::option::Option::Some("DATA_TYPE_OTHER"),
Self::JavaObject => std::option::Option::Some("DATA_TYPE_JAVA_OBJECT"),
Self::Distinct => std::option::Option::Some("DATA_TYPE_DISTINCT"),
Self::Struct => std::option::Option::Some("DATA_TYPE_STRUCT"),
Self::Array => std::option::Option::Some("DATA_TYPE_ARRAY"),
Self::Clob => std::option::Option::Some("DATA_TYPE_CLOB"),
Self::Ref => std::option::Option::Some("DATA_TYPE_REF"),
Self::Datalink => std::option::Option::Some("DATA_TYPE_DATALINK"),
Self::Rowid => std::option::Option::Some("DATA_TYPE_ROWID"),
Self::Binary => std::option::Option::Some("DATA_TYPE_BINARY"),
Self::Varbinary => std::option::Option::Some("DATA_TYPE_VARBINARY"),
Self::Longvarbinary => std::option::Option::Some("DATA_TYPE_LONGVARBINARY"),
Self::Nclob => std::option::Option::Some("DATA_TYPE_NCLOB"),
Self::Sqlxml => std::option::Option::Some("DATA_TYPE_SQLXML"),
Self::RefCursor => std::option::Option::Some("DATA_TYPE_REF_CURSOR"),
Self::TimeWithTimezone => std::option::Option::Some("DATA_TYPE_TIME_WITH_TIMEZONE"),
Self::TimestampWithTimezone => {
std::option::Option::Some("DATA_TYPE_TIMESTAMP_WITH_TIMEZONE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataType {
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 DataType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Int,
2 => Self::Smallint,
3 => Self::Double,
4 => Self::Date,
5 => Self::Datetime,
6 => Self::Time,
7 => Self::String,
8 => Self::Long,
9 => Self::Boolean,
10 => Self::Decimal,
11 => Self::Uuid,
12 => Self::Blob,
13 => Self::Bit,
14 => Self::Tinyint,
15 => Self::Integer,
16 => Self::Bigint,
17 => Self::Float,
18 => Self::Real,
19 => Self::Numeric,
20 => Self::Char,
21 => Self::Varchar,
22 => Self::Longvarchar,
23 => Self::Timestamp,
24 => Self::Nchar,
25 => Self::Nvarchar,
26 => Self::Longnvarchar,
27 => Self::Null,
28 => Self::Other,
29 => Self::JavaObject,
30 => Self::Distinct,
31 => Self::Struct,
32 => Self::Array,
33 => Self::Clob,
34 => Self::Ref,
35 => Self::Datalink,
36 => Self::Rowid,
37 => Self::Binary,
38 => Self::Varbinary,
39 => Self::Longvarbinary,
40 => Self::Nclob,
41 => Self::Sqlxml,
42 => Self::RefCursor,
43 => Self::TimeWithTimezone,
44 => Self::TimestampWithTimezone,
_ => Self::UnknownValue(data_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
"DATA_TYPE_INT" => Self::Int,
"DATA_TYPE_SMALLINT" => Self::Smallint,
"DATA_TYPE_DOUBLE" => Self::Double,
"DATA_TYPE_DATE" => Self::Date,
"DATA_TYPE_DATETIME" => Self::Datetime,
"DATA_TYPE_TIME" => Self::Time,
"DATA_TYPE_STRING" => Self::String,
"DATA_TYPE_LONG" => Self::Long,
"DATA_TYPE_BOOLEAN" => Self::Boolean,
"DATA_TYPE_DECIMAL" => Self::Decimal,
"DATA_TYPE_UUID" => Self::Uuid,
"DATA_TYPE_BLOB" => Self::Blob,
"DATA_TYPE_BIT" => Self::Bit,
"DATA_TYPE_TINYINT" => Self::Tinyint,
"DATA_TYPE_INTEGER" => Self::Integer,
"DATA_TYPE_BIGINT" => Self::Bigint,
"DATA_TYPE_FLOAT" => Self::Float,
"DATA_TYPE_REAL" => Self::Real,
"DATA_TYPE_NUMERIC" => Self::Numeric,
"DATA_TYPE_CHAR" => Self::Char,
"DATA_TYPE_VARCHAR" => Self::Varchar,
"DATA_TYPE_LONGVARCHAR" => Self::Longvarchar,
"DATA_TYPE_TIMESTAMP" => Self::Timestamp,
"DATA_TYPE_NCHAR" => Self::Nchar,
"DATA_TYPE_NVARCHAR" => Self::Nvarchar,
"DATA_TYPE_LONGNVARCHAR" => Self::Longnvarchar,
"DATA_TYPE_NULL" => Self::Null,
"DATA_TYPE_OTHER" => Self::Other,
"DATA_TYPE_JAVA_OBJECT" => Self::JavaObject,
"DATA_TYPE_DISTINCT" => Self::Distinct,
"DATA_TYPE_STRUCT" => Self::Struct,
"DATA_TYPE_ARRAY" => Self::Array,
"DATA_TYPE_CLOB" => Self::Clob,
"DATA_TYPE_REF" => Self::Ref,
"DATA_TYPE_DATALINK" => Self::Datalink,
"DATA_TYPE_ROWID" => Self::Rowid,
"DATA_TYPE_BINARY" => Self::Binary,
"DATA_TYPE_VARBINARY" => Self::Varbinary,
"DATA_TYPE_LONGVARBINARY" => Self::Longvarbinary,
"DATA_TYPE_NCLOB" => Self::Nclob,
"DATA_TYPE_SQLXML" => Self::Sqlxml,
"DATA_TYPE_REF_CURSOR" => Self::RefCursor,
"DATA_TYPE_TIME_WITH_TIMEZONE" => Self::TimeWithTimezone,
"DATA_TYPE_TIMESTAMP_WITH_TIMEZONE" => Self::TimestampWithTimezone,
_ => Self::UnknownValue(data_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataType {
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::Int => serializer.serialize_i32(1),
Self::Smallint => serializer.serialize_i32(2),
Self::Double => serializer.serialize_i32(3),
Self::Date => serializer.serialize_i32(4),
Self::Datetime => serializer.serialize_i32(5),
Self::Time => serializer.serialize_i32(6),
Self::String => serializer.serialize_i32(7),
Self::Long => serializer.serialize_i32(8),
Self::Boolean => serializer.serialize_i32(9),
Self::Decimal => serializer.serialize_i32(10),
Self::Uuid => serializer.serialize_i32(11),
Self::Blob => serializer.serialize_i32(12),
Self::Bit => serializer.serialize_i32(13),
Self::Tinyint => serializer.serialize_i32(14),
Self::Integer => serializer.serialize_i32(15),
Self::Bigint => serializer.serialize_i32(16),
Self::Float => serializer.serialize_i32(17),
Self::Real => serializer.serialize_i32(18),
Self::Numeric => serializer.serialize_i32(19),
Self::Char => serializer.serialize_i32(20),
Self::Varchar => serializer.serialize_i32(21),
Self::Longvarchar => serializer.serialize_i32(22),
Self::Timestamp => serializer.serialize_i32(23),
Self::Nchar => serializer.serialize_i32(24),
Self::Nvarchar => serializer.serialize_i32(25),
Self::Longnvarchar => serializer.serialize_i32(26),
Self::Null => serializer.serialize_i32(27),
Self::Other => serializer.serialize_i32(28),
Self::JavaObject => serializer.serialize_i32(29),
Self::Distinct => serializer.serialize_i32(30),
Self::Struct => serializer.serialize_i32(31),
Self::Array => serializer.serialize_i32(32),
Self::Clob => serializer.serialize_i32(33),
Self::Ref => serializer.serialize_i32(34),
Self::Datalink => serializer.serialize_i32(35),
Self::Rowid => serializer.serialize_i32(36),
Self::Binary => serializer.serialize_i32(37),
Self::Varbinary => serializer.serialize_i32(38),
Self::Longvarbinary => serializer.serialize_i32(39),
Self::Nclob => serializer.serialize_i32(40),
Self::Sqlxml => serializer.serialize_i32(41),
Self::RefCursor => serializer.serialize_i32(42),
Self::TimeWithTimezone => serializer.serialize_i32(43),
Self::TimestampWithTimezone => serializer.serialize_i32(44),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
".google.cloud.connectors.v1.DataType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectionView {
Unspecified,
Basic,
Full,
UnknownValue(connection_view::UnknownValue),
}
#[doc(hidden)]
pub mod connection_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConnectionView {
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::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CONNECTION_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConnectionView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConnectionView {
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 ConnectionView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(connection_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConnectionView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONNECTION_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
_ => Self::UnknownValue(connection_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConnectionView {
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::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConnectionView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionView>::new(
".google.cloud.connectors.v1.ConnectionView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectorVersionView {
Unspecified,
Basic,
Full,
UnknownValue(connector_version_view::UnknownValue),
}
#[doc(hidden)]
pub mod connector_version_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConnectorVersionView {
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::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CONNECTOR_VERSION_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("CONNECTOR_VERSION_VIEW_BASIC"),
Self::Full => std::option::Option::Some("CONNECTOR_VERSION_VIEW_FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConnectorVersionView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConnectorVersionView {
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 ConnectorVersionView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(connector_version_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConnectorVersionView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONNECTOR_VERSION_VIEW_UNSPECIFIED" => Self::Unspecified,
"CONNECTOR_VERSION_VIEW_BASIC" => Self::Basic,
"CONNECTOR_VERSION_VIEW_FULL" => Self::Full,
_ => Self::UnknownValue(connector_version_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConnectorVersionView {
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::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConnectorVersionView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorVersionView>::new(
".google.cloud.connectors.v1.ConnectorVersionView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SslType {
Unspecified,
Tls,
Mtls,
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::Tls => std::option::Option::Some(1),
Self::Mtls => 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::Tls => std::option::Option::Some("TLS"),
Self::Mtls => std::option::Option::Some("MTLS"),
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::Tls,
2 => Self::Mtls,
_ => 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,
"TLS" => Self::Tls,
"MTLS" => Self::Mtls,
_ => 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::Tls => serializer.serialize_i32(1),
Self::Mtls => 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.connectors.v1.SslType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CertType {
Unspecified,
Pem,
UnknownValue(cert_type::UnknownValue),
}
#[doc(hidden)]
pub mod cert_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CertType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pem => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CERT_TYPE_UNSPECIFIED"),
Self::Pem => std::option::Option::Some("PEM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CertType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CertType {
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 CertType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pem,
_ => Self::UnknownValue(cert_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CertType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CERT_TYPE_UNSPECIFIED" => Self::Unspecified,
"PEM" => Self::Pem,
_ => Self::UnknownValue(cert_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CertType {
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::Pem => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CertType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CertType>::new(
".google.cloud.connectors.v1.CertType",
))
}
}