#![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;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct AuthConfig {
pub auth_type: crate::model::AuthType,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub additional_variables: std::vec::Vec<crate::model::ConfigVariable>,
#[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
pub r#type: std::option::Option<crate::model::auth_config::Type>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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 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 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 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_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 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 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 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::*;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct UserPassword {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub username: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub password: std::option::Option<crate::model::Secret>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Secret>>>(
mut self,
v: T,
) -> Self {
self.password = v.into();
self
}
}
impl wkt::message::Message for UserPassword {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.UserPassword"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Oauth2JwtBearer {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub client_key: std::option::Option<crate::model::Secret>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub jwt_claims:
std::option::Option<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Secret>>>(
mut self,
v: T,
) -> Self {
self.client_key = v.into();
self
}
pub fn set_jwt_claims<
T: std::convert::Into<
std::option::Option<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
>,
>(
mut self,
v: T,
) -> Self {
self.jwt_claims = v.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::*;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct JwtClaims {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub issuer: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub subject: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub audience: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Oauth2ClientCredentials {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub client_id: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub client_secret: std::option::Option<crate::model::Secret>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.client_secret = v.into();
self
}
}
impl wkt::message::Message for Oauth2ClientCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct SshPublicKey {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub username: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub ssh_client_cert: std::option::Option<crate::model::Secret>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub cert_type: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub ssh_client_cert_pass: std::option::Option<crate::model::Secret>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.ssh_client_cert = v.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: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.ssh_client_cert_pass = v.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, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
#[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>),
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct AuthConfigTemplate {
pub auth_type: crate::model::AuthType,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub config_variable_templates: std::vec::Vec<crate::model::ConfigVariableTemplate>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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_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_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
}
}
impl wkt::message::Message for AuthConfigTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthConfigTemplate"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct OperationMetadata {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub create_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub end_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub target: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub verb: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub status_message: std::string::String,
pub requested_cancellation: bool,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub api_version: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.create_time = v.into();
self
}
pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.end_time = v.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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ConfigVariableTemplate {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub key: std::string::String,
pub value_type: crate::model::config_variable_template::ValueType,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub validation_regex: std::string::String,
pub required: bool,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub role_grant: std::option::Option<crate::model::RoleGrant>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub enum_options: std::vec::Vec<crate::model::EnumOption>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub authorization_code_link: std::option::Option<crate::model::AuthorizationCodeLink>,
pub state: crate::model::config_variable_template::State,
pub is_advanced: bool,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::RoleGrant>>>(
mut self,
v: T,
) -> Self {
self.role_grant = v.into();
self
}
pub fn set_authorization_code_link<
T: std::convert::Into<std::option::Option<crate::model::AuthorizationCodeLink>>,
>(
mut self,
v: T,
) -> Self {
self.authorization_code_link = v.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
}
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
}
}
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, serde::Deserialize, serde::Serialize)]
pub struct ValueType(i32);
impl ValueType {
pub const VALUE_TYPE_UNSPECIFIED: ValueType = ValueType::new(0);
pub const STRING: ValueType = ValueType::new(1);
pub const INT: ValueType = ValueType::new(2);
pub const BOOL: ValueType = ValueType::new(3);
pub const SECRET: ValueType = ValueType::new(4);
pub const ENUM: ValueType = ValueType::new(5);
pub const AUTHORIZATION_CODE: ValueType = ValueType::new(6);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("VALUE_TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("STRING"),
2 => std::borrow::Cow::Borrowed("INT"),
3 => std::borrow::Cow::Borrowed("BOOL"),
4 => std::borrow::Cow::Borrowed("SECRET"),
5 => std::borrow::Cow::Borrowed("ENUM"),
6 => std::borrow::Cow::Borrowed("AUTHORIZATION_CODE"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"VALUE_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::VALUE_TYPE_UNSPECIFIED),
"STRING" => std::option::Option::Some(Self::STRING),
"INT" => std::option::Option::Some(Self::INT),
"BOOL" => std::option::Option::Some(Self::BOOL),
"SECRET" => std::option::Option::Some(Self::SECRET),
"ENUM" => std::option::Option::Some(Self::ENUM),
"AUTHORIZATION_CODE" => std::option::Option::Some(Self::AUTHORIZATION_CODE),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for ValueType {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for ValueType {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct State(i32);
impl State {
pub const STATE_UNSPECIFIED: State = State::new(0);
pub const ACTIVE: State = State::new(1);
pub const DEPRECATED: State = State::new(2);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("ACTIVE"),
2 => std::borrow::Cow::Borrowed("DEPRECATED"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
"ACTIVE" => std::option::Option::Some(Self::ACTIVE),
"DEPRECATED" => std::option::Option::Some(Self::DEPRECATED),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for State {
fn default() -> Self {
Self::new(0)
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Secret {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub secret_version: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct EnumOption {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub id: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ConfigVariable {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub key: std::string::String,
#[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
pub value: std::option::Option<crate::model::config_variable::Value>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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 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 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 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_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 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 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 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, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub enum Value {
IntValue(i64),
BoolValue(bool),
StringValue(std::string::String),
SecretValue(std::boxed::Box<crate::model::Secret>),
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct RoleGrant {
pub principal: crate::model::role_grant::Principal,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub roles: std::vec::Vec<std::string::String>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub resource: std::option::Option<crate::model::role_grant::Resource>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub helper_text_template: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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_resource<
T: std::convert::Into<std::option::Option<crate::model::role_grant::Resource>>,
>(
mut self,
v: T,
) -> Self {
self.resource = v.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
}
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
}
}
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::*;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Resource {
#[serde(rename = "type")]
pub r#type: crate::model::role_grant::resource::Type,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub path_template: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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, serde::Deserialize, serde::Serialize)]
pub struct Type(i32);
impl Type {
pub const TYPE_UNSPECIFIED: Type = Type::new(0);
pub const GCP_PROJECT: Type = Type::new(1);
pub const GCP_RESOURCE: Type = Type::new(2);
pub const GCP_SECRETMANAGER_SECRET: Type = Type::new(3);
pub const GCP_SECRETMANAGER_SECRET_VERSION: Type = Type::new(4);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("GCP_PROJECT"),
2 => std::borrow::Cow::Borrowed("GCP_RESOURCE"),
3 => std::borrow::Cow::Borrowed("GCP_SECRETMANAGER_SECRET"),
4 => std::borrow::Cow::Borrowed("GCP_SECRETMANAGER_SECRET_VERSION"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"TYPE_UNSPECIFIED" => std::option::Option::Some(Self::TYPE_UNSPECIFIED),
"GCP_PROJECT" => std::option::Option::Some(Self::GCP_PROJECT),
"GCP_RESOURCE" => std::option::Option::Some(Self::GCP_RESOURCE),
"GCP_SECRETMANAGER_SECRET" => {
std::option::Option::Some(Self::GCP_SECRETMANAGER_SECRET)
}
"GCP_SECRETMANAGER_SECRET_VERSION" => {
std::option::Option::Some(Self::GCP_SECRETMANAGER_SECRET_VERSION)
}
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for Type {
fn default() -> Self {
Self::new(0)
}
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct Principal(i32);
impl Principal {
pub const PRINCIPAL_UNSPECIFIED: Principal = Principal::new(0);
pub const CONNECTOR_SA: Principal = Principal::new(1);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("PRINCIPAL_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("CONNECTOR_SA"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"PRINCIPAL_UNSPECIFIED" => std::option::Option::Some(Self::PRINCIPAL_UNSPECIFIED),
"CONNECTOR_SA" => std::option::Option::Some(Self::CONNECTOR_SA),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for Principal {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for Principal {
fn default() -> Self {
Self::new(0)
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct AuthorizationCodeLink {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub uri: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub scopes: std::vec::Vec<std::string::String>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub client_id: std::string::String,
pub enable_pkce: bool,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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_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
}
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
}
}
impl wkt::message::Message for AuthorizationCodeLink {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.AuthorizationCodeLink"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Connection {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub create_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub update_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub connector_version: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub status: std::option::Option<crate::model::ConnectionStatus>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub config_variables: std::vec::Vec<crate::model::ConfigVariable>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub auth_config: std::option::Option<crate::model::AuthConfig>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub lock_config: std::option::Option<crate::model::LockConfig>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub destination_configs: std::vec::Vec<crate::model::DestinationConfig>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub image_location: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub service_account: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub service_directory: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub envoy_image_location: std::string::String,
pub suspended: bool,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub node_config: std::option::Option<crate::model::NodeConfig>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub ssl_config: std::option::Option<crate::model::SslConfig>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.create_time = v.into();
self
}
pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.update_time = 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_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: std::convert::Into<std::option::Option<crate::model::ConnectionStatus>>,
>(
mut self,
v: T,
) -> Self {
self.status = v.into();
self
}
pub fn set_auth_config<T: std::convert::Into<std::option::Option<crate::model::AuthConfig>>>(
mut self,
v: T,
) -> Self {
self.auth_config = v.into();
self
}
pub fn set_lock_config<T: std::convert::Into<std::option::Option<crate::model::LockConfig>>>(
mut self,
v: T,
) -> Self {
self.lock_config = v.into();
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: std::convert::Into<std::option::Option<crate::model::NodeConfig>>>(
mut self,
v: T,
) -> Self {
self.node_config = v.into();
self
}
pub fn set_ssl_config<T: std::convert::Into<std::option::Option<crate::model::SslConfig>>>(
mut self,
v: T,
) -> Self {
self.ssl_config = v.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_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_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
}
}
impl wkt::message::Message for Connection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Connection"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct NodeConfig {
pub min_node_count: i32,
pub max_node_count: i32,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ConnectionSchemaMetadata {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub entities: std::vec::Vec<std::string::String>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub actions: std::vec::Vec<std::string::String>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub update_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub refresh_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::connection_schema_metadata::State,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectionSchemaMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.update_time = v.into();
self
}
pub fn set_refresh_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.refresh_time = v.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
}
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
}
}
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, serde::Deserialize, serde::Serialize)]
pub struct State(i32);
impl State {
pub const STATE_UNSPECIFIED: State = State::new(0);
pub const REFRESHING: State = State::new(1);
pub const UPDATED: State = State::new(2);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("REFRESHING"),
2 => std::borrow::Cow::Borrowed("UPDATED"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
"REFRESHING" => std::option::Option::Some(Self::REFRESHING),
"UPDATED" => std::option::Option::Some(Self::UPDATED),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for State {
fn default() -> Self {
Self::new(0)
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct RuntimeEntitySchema {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub entity: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub fields: std::vec::Vec<crate::model::runtime_entity_schema::Field>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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::*;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Field {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub field: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
pub data_type: crate::model::DataType,
pub key: bool,
pub readonly: bool,
pub nullable: bool,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub default_value: std::option::Option<wkt::Value>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub additional_details: std::option::Option<wkt::Struct>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Value>>>(
mut self,
v: T,
) -> Self {
self.default_value = v.into();
self
}
pub fn set_additional_details<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.additional_details = v.into();
self
}
}
impl wkt::message::Message for Field {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeEntitySchema.Field"
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct RuntimeActionSchema {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub action: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub input_parameters: std::vec::Vec<crate::model::runtime_action_schema::InputParameter>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub result_metadata: std::vec::Vec<crate::model::runtime_action_schema::ResultMetadata>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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::*;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct InputParameter {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parameter: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
pub data_type: crate::model::DataType,
pub nullable: bool,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub default_value: std::option::Option<wkt::Value>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Value>>>(
mut self,
v: T,
) -> Self {
self.default_value = v.into();
self
}
}
impl wkt::message::Message for InputParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema.InputParameter"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ResultMetadata {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub field: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
pub data_type: crate::model::DataType,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct LockConfig {
pub locked: bool,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub reason: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListConnectionsRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub filter: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub order_by: std::string::String,
pub view: crate::model::ConnectionView,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListConnectionsResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub connections: std::vec::Vec<crate::model::Connection>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub unreachable: std::vec::Vec<std::string::String>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_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()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetConnectionRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
pub view: crate::model::ConnectionView,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct CreateConnectionRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub connection_id: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub connection: std::option::Option<crate::model::Connection>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Connection>>>(
mut self,
v: T,
) -> Self {
self.connection = v.into();
self
}
}
impl wkt::message::Message for CreateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.CreateConnectionRequest"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct UpdateConnectionRequest {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub connection: std::option::Option<crate::model::Connection>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub update_mask: std::option::Option<wkt::FieldMask>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Connection>>>(
mut self,
v: T,
) -> Self {
self.connection = v.into();
self
}
pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.update_mask = v.into();
self
}
}
impl wkt::message::Message for UpdateConnectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.UpdateConnectionRequest"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct DeleteConnectionRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetConnectionSchemaMetadataRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct RefreshConnectionSchemaMetadataRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListRuntimeEntitySchemasRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub filter: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListRuntimeEntitySchemasResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub runtime_entity_schemas: std::vec::Vec<crate::model::RuntimeEntitySchema>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuntimeEntitySchemasResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_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
}
}
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()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListRuntimeActionSchemasRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub filter: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListRuntimeActionSchemasResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub runtime_action_schemas: std::vec::Vec<crate::model::RuntimeActionSchema>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuntimeActionSchemasResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_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
}
}
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()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ConnectionStatus {
pub state: crate::model::connection_status::State,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub status: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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, serde::Deserialize, serde::Serialize)]
pub struct State(i32);
impl State {
pub const STATE_UNSPECIFIED: State = State::new(0);
pub const CREATING: State = State::new(1);
pub const ACTIVE: State = State::new(2);
pub const INACTIVE: State = State::new(3);
pub const DELETING: State = State::new(4);
pub const UPDATING: State = State::new(5);
pub const ERROR: State = State::new(6);
pub const AUTHORIZATION_REQUIRED: State = State::new(7);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("CREATING"),
2 => std::borrow::Cow::Borrowed("ACTIVE"),
3 => std::borrow::Cow::Borrowed("INACTIVE"),
4 => std::borrow::Cow::Borrowed("DELETING"),
5 => std::borrow::Cow::Borrowed("UPDATING"),
6 => std::borrow::Cow::Borrowed("ERROR"),
7 => std::borrow::Cow::Borrowed("AUTHORIZATION_REQUIRED"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
"CREATING" => std::option::Option::Some(Self::CREATING),
"ACTIVE" => std::option::Option::Some(Self::ACTIVE),
"INACTIVE" => std::option::Option::Some(Self::INACTIVE),
"DELETING" => std::option::Option::Some(Self::DELETING),
"UPDATING" => std::option::Option::Some(Self::UPDATING),
"ERROR" => std::option::Option::Some(Self::ERROR),
"AUTHORIZATION_REQUIRED" => std::option::Option::Some(Self::AUTHORIZATION_REQUIRED),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for State {
fn default() -> Self {
Self::new(0)
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Connector {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub create_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub update_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub documentation_uri: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub external_uri: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub web_assets_location: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
pub launch_stage: crate::model::LaunchStage,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.create_time = v.into();
self
}
pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.update_time = v.into();
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
}
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
}
}
impl wkt::message::Message for Connector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Connector"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetConnectorRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListConnectorsRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListConnectorsResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub connectors: std::vec::Vec<crate::model::Connector>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub unreachable: std::vec::Vec<std::string::String>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectorsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_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()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ConnectorVersion {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub create_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub update_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub launch_stage: crate::model::LaunchStage,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub release_version: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub auth_config_templates: std::vec::Vec<crate::model::AuthConfigTemplate>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub config_variable_templates: std::vec::Vec<crate::model::ConfigVariableTemplate>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub supported_runtime_features: std::option::Option<crate::model::SupportedRuntimeFeatures>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub egress_control_config: std::option::Option<crate::model::EgressControlConfig>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub role_grants: std::vec::Vec<crate::model::RoleGrant>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub role_grant: std::option::Option<crate::model::RoleGrant>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub ssl_config_template: std::option::Option<crate::model::SslConfigTemplate>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.create_time = v.into();
self
}
pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.update_time = 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
}
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_supported_runtime_features<
T: std::convert::Into<std::option::Option<crate::model::SupportedRuntimeFeatures>>,
>(
mut self,
v: T,
) -> Self {
self.supported_runtime_features = 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_egress_control_config<
T: std::convert::Into<std::option::Option<crate::model::EgressControlConfig>>,
>(
mut self,
v: T,
) -> Self {
self.egress_control_config = v.into();
self
}
pub fn set_role_grant<T: std::convert::Into<std::option::Option<crate::model::RoleGrant>>>(
mut self,
v: T,
) -> Self {
self.role_grant = v.into();
self
}
pub fn set_ssl_config_template<
T: std::convert::Into<std::option::Option<crate::model::SslConfigTemplate>>,
>(
mut self,
v: T,
) -> Self {
self.ssl_config_template = 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_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_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
}
}
impl wkt::message::Message for ConnectorVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.ConnectorVersion"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetConnectorVersionRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
pub view: crate::model::ConnectorVersionView,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListConnectorVersionsRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
pub view: crate::model::ConnectorVersionView,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListConnectorVersionsResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub connector_versions: std::vec::Vec<crate::model::ConnectorVersion>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub unreachable: std::vec::Vec<std::string::String>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConnectorVersionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_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()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct SupportedRuntimeFeatures {
pub entity_apis: bool,
pub action_apis: bool,
pub sql_query: bool,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct EgressControlConfig {
#[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
pub oneof_backends: std::option::Option<crate::model::egress_control_config::OneofBackends>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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 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_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 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, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub enum OneofBackends {
Backends(std::string::String),
ExtractionRules(std::boxed::Box<crate::model::ExtractionRules>),
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ExtractionRules {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub extraction_rule: std::vec::Vec<crate::model::ExtractionRule>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ExtractionRule {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub source: std::option::Option<crate::model::extraction_rule::Source>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub extraction_regex: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::extraction_rule::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.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::*;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Source {
pub source_type: crate::model::extraction_rule::SourceType,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub field_id: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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, serde::Deserialize, serde::Serialize)]
pub struct SourceType(i32);
impl SourceType {
pub const SOURCE_TYPE_UNSPECIFIED: SourceType = SourceType::new(0);
pub const CONFIG_VARIABLE: SourceType = SourceType::new(1);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("SOURCE_TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("CONFIG_VARIABLE"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"SOURCE_TYPE_UNSPECIFIED" => {
std::option::Option::Some(Self::SOURCE_TYPE_UNSPECIFIED)
}
"CONFIG_VARIABLE" => std::option::Option::Some(Self::CONFIG_VARIABLE),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for SourceType {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for SourceType {
fn default() -> Self {
Self::new(0)
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct DestinationConfig {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub key: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub destinations: std::vec::Vec<crate::model::Destination>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Destination {
pub port: i32,
#[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
pub destination: std::option::Option<crate::model::destination::Destination>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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 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_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 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, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub enum Destination {
ServiceAttachment(std::string::String),
Host(std::string::String),
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Provider {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub create_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub update_time: std::option::Option<wkt::Timestamp>,
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub documentation_uri: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub external_uri: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub description: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub web_assets_location: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
pub launch_stage: crate::model::LaunchStage,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.create_time = v.into();
self
}
pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.update_time = v.into();
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
}
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
}
}
impl wkt::message::Message for Provider {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.connectors.v1.Provider"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetProviderRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListProvidersRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub parent: std::string::String,
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListProvidersResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub providers: std::vec::Vec<crate::model::Provider>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub unreachable: std::vec::Vec<std::string::String>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListProvidersResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_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()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetRuntimeConfigRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct RuntimeConfig {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub location_id: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub connd_topic: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub connd_subscription: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub control_plane_topic: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub control_plane_subscription: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub runtime_endpoint: std::string::String,
pub state: crate::model::runtime_config::State,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub schema_gcs_bucket: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub service_directory: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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, serde::Deserialize, serde::Serialize)]
pub struct State(i32);
impl State {
pub const STATE_UNSPECIFIED: State = State::new(0);
pub const INACTIVE: State = State::new(1);
pub const ACTIVATING: State = State::new(2);
pub const ACTIVE: State = State::new(3);
pub const CREATING: State = State::new(4);
pub const DELETING: State = State::new(5);
pub const UPDATING: State = State::new(6);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("INACTIVE"),
2 => std::borrow::Cow::Borrowed("ACTIVATING"),
3 => std::borrow::Cow::Borrowed("ACTIVE"),
4 => std::borrow::Cow::Borrowed("CREATING"),
5 => std::borrow::Cow::Borrowed("DELETING"),
6 => std::borrow::Cow::Borrowed("UPDATING"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
"INACTIVE" => std::option::Option::Some(Self::INACTIVE),
"ACTIVATING" => std::option::Option::Some(Self::ACTIVATING),
"ACTIVE" => std::option::Option::Some(Self::ACTIVE),
"CREATING" => std::option::Option::Some(Self::CREATING),
"DELETING" => std::option::Option::Some(Self::DELETING),
"UPDATING" => std::option::Option::Some(Self::UPDATING),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for State {
fn default() -> Self {
Self::new(0)
}
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetGlobalSettingsRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Settings {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
pub vpcsc: bool,
pub payg: bool,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct SslConfigTemplate {
pub ssl_type: crate::model::SslType,
pub is_tls_mandatory: bool,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub server_cert_type: std::vec::Vec<crate::model::CertType>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub client_cert_type: std::vec::Vec<crate::model::CertType>,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub additional_variables: std::vec::Vec<crate::model::ConfigVariableTemplate>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct SslConfig {
#[serde(rename = "type")]
pub r#type: crate::model::SslType,
pub trust_model: crate::model::ssl_config::TrustModel,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub private_server_certificate: std::option::Option<crate::model::Secret>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub client_certificate: std::option::Option<crate::model::Secret>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub client_private_key: std::option::Option<crate::model::Secret>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
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,
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub additional_variables: std::vec::Vec<crate::model::ConfigVariable>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_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: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.private_server_certificate = v.into();
self
}
pub fn set_client_certificate<
T: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.client_certificate = v.into();
self
}
pub fn set_client_private_key<
T: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.client_private_key = v.into();
self
}
pub fn set_client_private_key_pass<
T: std::convert::Into<std::option::Option<crate::model::Secret>>,
>(
mut self,
v: T,
) -> Self {
self.client_private_key_pass = v.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, serde::Deserialize, serde::Serialize)]
pub struct TrustModel(i32);
impl TrustModel {
pub const PUBLIC: TrustModel = TrustModel::new(0);
pub const PRIVATE: TrustModel = TrustModel::new(1);
pub const INSECURE: TrustModel = TrustModel::new(2);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("PUBLIC"),
1 => std::borrow::Cow::Borrowed("PRIVATE"),
2 => std::borrow::Cow::Borrowed("INSECURE"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"PUBLIC" => std::option::Option::Some(Self::PUBLIC),
"PRIVATE" => std::option::Option::Some(Self::PRIVATE),
"INSECURE" => std::option::Option::Some(Self::INSECURE),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for TrustModel {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for TrustModel {
fn default() -> Self {
Self::new(0)
}
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct AuthType(i32);
impl AuthType {
pub const AUTH_TYPE_UNSPECIFIED: AuthType = AuthType::new(0);
pub const USER_PASSWORD: AuthType = AuthType::new(1);
pub const OAUTH2_JWT_BEARER: AuthType = AuthType::new(2);
pub const OAUTH2_CLIENT_CREDENTIALS: AuthType = AuthType::new(3);
pub const SSH_PUBLIC_KEY: AuthType = AuthType::new(4);
pub const OAUTH2_AUTH_CODE_FLOW: AuthType = AuthType::new(5);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("AUTH_TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("USER_PASSWORD"),
2 => std::borrow::Cow::Borrowed("OAUTH2_JWT_BEARER"),
3 => std::borrow::Cow::Borrowed("OAUTH2_CLIENT_CREDENTIALS"),
4 => std::borrow::Cow::Borrowed("SSH_PUBLIC_KEY"),
5 => std::borrow::Cow::Borrowed("OAUTH2_AUTH_CODE_FLOW"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"AUTH_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::AUTH_TYPE_UNSPECIFIED),
"USER_PASSWORD" => std::option::Option::Some(Self::USER_PASSWORD),
"OAUTH2_JWT_BEARER" => std::option::Option::Some(Self::OAUTH2_JWT_BEARER),
"OAUTH2_CLIENT_CREDENTIALS" => {
std::option::Option::Some(Self::OAUTH2_CLIENT_CREDENTIALS)
}
"SSH_PUBLIC_KEY" => std::option::Option::Some(Self::SSH_PUBLIC_KEY),
"OAUTH2_AUTH_CODE_FLOW" => std::option::Option::Some(Self::OAUTH2_AUTH_CODE_FLOW),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for AuthType {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for AuthType {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct LaunchStage(i32);
impl LaunchStage {
pub const LAUNCH_STAGE_UNSPECIFIED: LaunchStage = LaunchStage::new(0);
pub const PREVIEW: LaunchStage = LaunchStage::new(1);
pub const GA: LaunchStage = LaunchStage::new(2);
pub const DEPRECATED: LaunchStage = LaunchStage::new(3);
pub const PRIVATE_PREVIEW: LaunchStage = LaunchStage::new(5);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("LAUNCH_STAGE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("PREVIEW"),
2 => std::borrow::Cow::Borrowed("GA"),
3 => std::borrow::Cow::Borrowed("DEPRECATED"),
5 => std::borrow::Cow::Borrowed("PRIVATE_PREVIEW"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"LAUNCH_STAGE_UNSPECIFIED" => std::option::Option::Some(Self::LAUNCH_STAGE_UNSPECIFIED),
"PREVIEW" => std::option::Option::Some(Self::PREVIEW),
"GA" => std::option::Option::Some(Self::GA),
"DEPRECATED" => std::option::Option::Some(Self::DEPRECATED),
"PRIVATE_PREVIEW" => std::option::Option::Some(Self::PRIVATE_PREVIEW),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for LaunchStage {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for LaunchStage {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DataType(i32);
impl DataType {
pub const DATA_TYPE_UNSPECIFIED: DataType = DataType::new(0);
pub const DATA_TYPE_INT: DataType = DataType::new(1);
pub const DATA_TYPE_SMALLINT: DataType = DataType::new(2);
pub const DATA_TYPE_DOUBLE: DataType = DataType::new(3);
pub const DATA_TYPE_DATE: DataType = DataType::new(4);
pub const DATA_TYPE_DATETIME: DataType = DataType::new(5);
pub const DATA_TYPE_TIME: DataType = DataType::new(6);
pub const DATA_TYPE_STRING: DataType = DataType::new(7);
pub const DATA_TYPE_LONG: DataType = DataType::new(8);
pub const DATA_TYPE_BOOLEAN: DataType = DataType::new(9);
pub const DATA_TYPE_DECIMAL: DataType = DataType::new(10);
pub const DATA_TYPE_UUID: DataType = DataType::new(11);
pub const DATA_TYPE_BLOB: DataType = DataType::new(12);
pub const DATA_TYPE_BIT: DataType = DataType::new(13);
pub const DATA_TYPE_TINYINT: DataType = DataType::new(14);
pub const DATA_TYPE_INTEGER: DataType = DataType::new(15);
pub const DATA_TYPE_BIGINT: DataType = DataType::new(16);
pub const DATA_TYPE_FLOAT: DataType = DataType::new(17);
pub const DATA_TYPE_REAL: DataType = DataType::new(18);
pub const DATA_TYPE_NUMERIC: DataType = DataType::new(19);
pub const DATA_TYPE_CHAR: DataType = DataType::new(20);
pub const DATA_TYPE_VARCHAR: DataType = DataType::new(21);
pub const DATA_TYPE_LONGVARCHAR: DataType = DataType::new(22);
pub const DATA_TYPE_TIMESTAMP: DataType = DataType::new(23);
pub const DATA_TYPE_NCHAR: DataType = DataType::new(24);
pub const DATA_TYPE_NVARCHAR: DataType = DataType::new(25);
pub const DATA_TYPE_LONGNVARCHAR: DataType = DataType::new(26);
pub const DATA_TYPE_NULL: DataType = DataType::new(27);
pub const DATA_TYPE_OTHER: DataType = DataType::new(28);
pub const DATA_TYPE_JAVA_OBJECT: DataType = DataType::new(29);
pub const DATA_TYPE_DISTINCT: DataType = DataType::new(30);
pub const DATA_TYPE_STRUCT: DataType = DataType::new(31);
pub const DATA_TYPE_ARRAY: DataType = DataType::new(32);
pub const DATA_TYPE_CLOB: DataType = DataType::new(33);
pub const DATA_TYPE_REF: DataType = DataType::new(34);
pub const DATA_TYPE_DATALINK: DataType = DataType::new(35);
pub const DATA_TYPE_ROWID: DataType = DataType::new(36);
pub const DATA_TYPE_BINARY: DataType = DataType::new(37);
pub const DATA_TYPE_VARBINARY: DataType = DataType::new(38);
pub const DATA_TYPE_LONGVARBINARY: DataType = DataType::new(39);
pub const DATA_TYPE_NCLOB: DataType = DataType::new(40);
pub const DATA_TYPE_SQLXML: DataType = DataType::new(41);
pub const DATA_TYPE_REF_CURSOR: DataType = DataType::new(42);
pub const DATA_TYPE_TIME_WITH_TIMEZONE: DataType = DataType::new(43);
pub const DATA_TYPE_TIMESTAMP_WITH_TIMEZONE: DataType = DataType::new(44);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("DATA_TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("DATA_TYPE_INT"),
2 => std::borrow::Cow::Borrowed("DATA_TYPE_SMALLINT"),
3 => std::borrow::Cow::Borrowed("DATA_TYPE_DOUBLE"),
4 => std::borrow::Cow::Borrowed("DATA_TYPE_DATE"),
5 => std::borrow::Cow::Borrowed("DATA_TYPE_DATETIME"),
6 => std::borrow::Cow::Borrowed("DATA_TYPE_TIME"),
7 => std::borrow::Cow::Borrowed("DATA_TYPE_STRING"),
8 => std::borrow::Cow::Borrowed("DATA_TYPE_LONG"),
9 => std::borrow::Cow::Borrowed("DATA_TYPE_BOOLEAN"),
10 => std::borrow::Cow::Borrowed("DATA_TYPE_DECIMAL"),
11 => std::borrow::Cow::Borrowed("DATA_TYPE_UUID"),
12 => std::borrow::Cow::Borrowed("DATA_TYPE_BLOB"),
13 => std::borrow::Cow::Borrowed("DATA_TYPE_BIT"),
14 => std::borrow::Cow::Borrowed("DATA_TYPE_TINYINT"),
15 => std::borrow::Cow::Borrowed("DATA_TYPE_INTEGER"),
16 => std::borrow::Cow::Borrowed("DATA_TYPE_BIGINT"),
17 => std::borrow::Cow::Borrowed("DATA_TYPE_FLOAT"),
18 => std::borrow::Cow::Borrowed("DATA_TYPE_REAL"),
19 => std::borrow::Cow::Borrowed("DATA_TYPE_NUMERIC"),
20 => std::borrow::Cow::Borrowed("DATA_TYPE_CHAR"),
21 => std::borrow::Cow::Borrowed("DATA_TYPE_VARCHAR"),
22 => std::borrow::Cow::Borrowed("DATA_TYPE_LONGVARCHAR"),
23 => std::borrow::Cow::Borrowed("DATA_TYPE_TIMESTAMP"),
24 => std::borrow::Cow::Borrowed("DATA_TYPE_NCHAR"),
25 => std::borrow::Cow::Borrowed("DATA_TYPE_NVARCHAR"),
26 => std::borrow::Cow::Borrowed("DATA_TYPE_LONGNVARCHAR"),
27 => std::borrow::Cow::Borrowed("DATA_TYPE_NULL"),
28 => std::borrow::Cow::Borrowed("DATA_TYPE_OTHER"),
29 => std::borrow::Cow::Borrowed("DATA_TYPE_JAVA_OBJECT"),
30 => std::borrow::Cow::Borrowed("DATA_TYPE_DISTINCT"),
31 => std::borrow::Cow::Borrowed("DATA_TYPE_STRUCT"),
32 => std::borrow::Cow::Borrowed("DATA_TYPE_ARRAY"),
33 => std::borrow::Cow::Borrowed("DATA_TYPE_CLOB"),
34 => std::borrow::Cow::Borrowed("DATA_TYPE_REF"),
35 => std::borrow::Cow::Borrowed("DATA_TYPE_DATALINK"),
36 => std::borrow::Cow::Borrowed("DATA_TYPE_ROWID"),
37 => std::borrow::Cow::Borrowed("DATA_TYPE_BINARY"),
38 => std::borrow::Cow::Borrowed("DATA_TYPE_VARBINARY"),
39 => std::borrow::Cow::Borrowed("DATA_TYPE_LONGVARBINARY"),
40 => std::borrow::Cow::Borrowed("DATA_TYPE_NCLOB"),
41 => std::borrow::Cow::Borrowed("DATA_TYPE_SQLXML"),
42 => std::borrow::Cow::Borrowed("DATA_TYPE_REF_CURSOR"),
43 => std::borrow::Cow::Borrowed("DATA_TYPE_TIME_WITH_TIMEZONE"),
44 => std::borrow::Cow::Borrowed("DATA_TYPE_TIMESTAMP_WITH_TIMEZONE"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"DATA_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::DATA_TYPE_UNSPECIFIED),
"DATA_TYPE_INT" => std::option::Option::Some(Self::DATA_TYPE_INT),
"DATA_TYPE_SMALLINT" => std::option::Option::Some(Self::DATA_TYPE_SMALLINT),
"DATA_TYPE_DOUBLE" => std::option::Option::Some(Self::DATA_TYPE_DOUBLE),
"DATA_TYPE_DATE" => std::option::Option::Some(Self::DATA_TYPE_DATE),
"DATA_TYPE_DATETIME" => std::option::Option::Some(Self::DATA_TYPE_DATETIME),
"DATA_TYPE_TIME" => std::option::Option::Some(Self::DATA_TYPE_TIME),
"DATA_TYPE_STRING" => std::option::Option::Some(Self::DATA_TYPE_STRING),
"DATA_TYPE_LONG" => std::option::Option::Some(Self::DATA_TYPE_LONG),
"DATA_TYPE_BOOLEAN" => std::option::Option::Some(Self::DATA_TYPE_BOOLEAN),
"DATA_TYPE_DECIMAL" => std::option::Option::Some(Self::DATA_TYPE_DECIMAL),
"DATA_TYPE_UUID" => std::option::Option::Some(Self::DATA_TYPE_UUID),
"DATA_TYPE_BLOB" => std::option::Option::Some(Self::DATA_TYPE_BLOB),
"DATA_TYPE_BIT" => std::option::Option::Some(Self::DATA_TYPE_BIT),
"DATA_TYPE_TINYINT" => std::option::Option::Some(Self::DATA_TYPE_TINYINT),
"DATA_TYPE_INTEGER" => std::option::Option::Some(Self::DATA_TYPE_INTEGER),
"DATA_TYPE_BIGINT" => std::option::Option::Some(Self::DATA_TYPE_BIGINT),
"DATA_TYPE_FLOAT" => std::option::Option::Some(Self::DATA_TYPE_FLOAT),
"DATA_TYPE_REAL" => std::option::Option::Some(Self::DATA_TYPE_REAL),
"DATA_TYPE_NUMERIC" => std::option::Option::Some(Self::DATA_TYPE_NUMERIC),
"DATA_TYPE_CHAR" => std::option::Option::Some(Self::DATA_TYPE_CHAR),
"DATA_TYPE_VARCHAR" => std::option::Option::Some(Self::DATA_TYPE_VARCHAR),
"DATA_TYPE_LONGVARCHAR" => std::option::Option::Some(Self::DATA_TYPE_LONGVARCHAR),
"DATA_TYPE_TIMESTAMP" => std::option::Option::Some(Self::DATA_TYPE_TIMESTAMP),
"DATA_TYPE_NCHAR" => std::option::Option::Some(Self::DATA_TYPE_NCHAR),
"DATA_TYPE_NVARCHAR" => std::option::Option::Some(Self::DATA_TYPE_NVARCHAR),
"DATA_TYPE_LONGNVARCHAR" => std::option::Option::Some(Self::DATA_TYPE_LONGNVARCHAR),
"DATA_TYPE_NULL" => std::option::Option::Some(Self::DATA_TYPE_NULL),
"DATA_TYPE_OTHER" => std::option::Option::Some(Self::DATA_TYPE_OTHER),
"DATA_TYPE_JAVA_OBJECT" => std::option::Option::Some(Self::DATA_TYPE_JAVA_OBJECT),
"DATA_TYPE_DISTINCT" => std::option::Option::Some(Self::DATA_TYPE_DISTINCT),
"DATA_TYPE_STRUCT" => std::option::Option::Some(Self::DATA_TYPE_STRUCT),
"DATA_TYPE_ARRAY" => std::option::Option::Some(Self::DATA_TYPE_ARRAY),
"DATA_TYPE_CLOB" => std::option::Option::Some(Self::DATA_TYPE_CLOB),
"DATA_TYPE_REF" => std::option::Option::Some(Self::DATA_TYPE_REF),
"DATA_TYPE_DATALINK" => std::option::Option::Some(Self::DATA_TYPE_DATALINK),
"DATA_TYPE_ROWID" => std::option::Option::Some(Self::DATA_TYPE_ROWID),
"DATA_TYPE_BINARY" => std::option::Option::Some(Self::DATA_TYPE_BINARY),
"DATA_TYPE_VARBINARY" => std::option::Option::Some(Self::DATA_TYPE_VARBINARY),
"DATA_TYPE_LONGVARBINARY" => std::option::Option::Some(Self::DATA_TYPE_LONGVARBINARY),
"DATA_TYPE_NCLOB" => std::option::Option::Some(Self::DATA_TYPE_NCLOB),
"DATA_TYPE_SQLXML" => std::option::Option::Some(Self::DATA_TYPE_SQLXML),
"DATA_TYPE_REF_CURSOR" => std::option::Option::Some(Self::DATA_TYPE_REF_CURSOR),
"DATA_TYPE_TIME_WITH_TIMEZONE" => {
std::option::Option::Some(Self::DATA_TYPE_TIME_WITH_TIMEZONE)
}
"DATA_TYPE_TIMESTAMP_WITH_TIMEZONE" => {
std::option::Option::Some(Self::DATA_TYPE_TIMESTAMP_WITH_TIMEZONE)
}
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for DataType {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for DataType {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct ConnectionView(i32);
impl ConnectionView {
pub const CONNECTION_VIEW_UNSPECIFIED: ConnectionView = ConnectionView::new(0);
pub const BASIC: ConnectionView = ConnectionView::new(1);
pub const FULL: ConnectionView = ConnectionView::new(2);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("CONNECTION_VIEW_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("BASIC"),
2 => std::borrow::Cow::Borrowed("FULL"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"CONNECTION_VIEW_UNSPECIFIED" => {
std::option::Option::Some(Self::CONNECTION_VIEW_UNSPECIFIED)
}
"BASIC" => std::option::Option::Some(Self::BASIC),
"FULL" => std::option::Option::Some(Self::FULL),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for ConnectionView {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for ConnectionView {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct ConnectorVersionView(i32);
impl ConnectorVersionView {
pub const CONNECTOR_VERSION_VIEW_UNSPECIFIED: ConnectorVersionView =
ConnectorVersionView::new(0);
pub const CONNECTOR_VERSION_VIEW_BASIC: ConnectorVersionView = ConnectorVersionView::new(1);
pub const CONNECTOR_VERSION_VIEW_FULL: ConnectorVersionView = ConnectorVersionView::new(2);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("CONNECTOR_VERSION_VIEW_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("CONNECTOR_VERSION_VIEW_BASIC"),
2 => std::borrow::Cow::Borrowed("CONNECTOR_VERSION_VIEW_FULL"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"CONNECTOR_VERSION_VIEW_UNSPECIFIED" => {
std::option::Option::Some(Self::CONNECTOR_VERSION_VIEW_UNSPECIFIED)
}
"CONNECTOR_VERSION_VIEW_BASIC" => {
std::option::Option::Some(Self::CONNECTOR_VERSION_VIEW_BASIC)
}
"CONNECTOR_VERSION_VIEW_FULL" => {
std::option::Option::Some(Self::CONNECTOR_VERSION_VIEW_FULL)
}
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for ConnectorVersionView {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for ConnectorVersionView {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct SslType(i32);
impl SslType {
pub const SSL_TYPE_UNSPECIFIED: SslType = SslType::new(0);
pub const TLS: SslType = SslType::new(1);
pub const MTLS: SslType = SslType::new(2);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("SSL_TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("TLS"),
2 => std::borrow::Cow::Borrowed("MTLS"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"SSL_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::SSL_TYPE_UNSPECIFIED),
"TLS" => std::option::Option::Some(Self::TLS),
"MTLS" => std::option::Option::Some(Self::MTLS),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for SslType {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for SslType {
fn default() -> Self {
Self::new(0)
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct CertType(i32);
impl CertType {
pub const CERT_TYPE_UNSPECIFIED: CertType = CertType::new(0);
pub const PEM: CertType = CertType::new(1);
pub(crate) const fn new(value: i32) -> Self {
Self(value)
}
pub fn value(&self) -> i32 {
self.0
}
pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
match self.0 {
0 => std::borrow::Cow::Borrowed("CERT_TYPE_UNSPECIFIED"),
1 => std::borrow::Cow::Borrowed("PEM"),
_ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
}
}
pub fn from_str_name(name: &str) -> std::option::Option<Self> {
match name {
"CERT_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::CERT_TYPE_UNSPECIFIED),
"PEM" => std::option::Option::Some(Self::PEM),
_ => std::option::Option::None,
}
}
}
impl std::convert::From<i32> for CertType {
fn from(value: i32) -> Self {
Self::new(value)
}
}
impl std::default::Default for CertType {
fn default() -> Self {
Self::new(0)
}
}