#[non_exhaustive]pub struct AuthConfig {
pub auth_type: AuthType,
pub additional_variables: Vec<ConfigVariable>,
pub type: Option<Type>,
/* private fields */
}Expand description
AuthConfig defines details of a authentication type.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.auth_type: AuthTypeThe type of authentication configured.
additional_variables: Vec<ConfigVariable>List containing additional auth configs.
type: Option<Type>Supported auth types.
Implementations§
Source§impl AuthConfig
impl AuthConfig
pub fn new() -> Self
Sourcepub fn set_auth_type<T: Into<AuthType>>(self, v: T) -> Self
pub fn set_auth_type<T: Into<AuthType>>(self, v: T) -> Self
Sourcepub fn set_additional_variables<T, V>(self, v: T) -> Self
pub fn set_additional_variables<T, V>(self, v: T) -> Self
Sets the value of additional_variables.
§Example
use google_cloud_connectors_v1::model::ConfigVariable;
let x = AuthConfig::new()
.set_additional_variables([
ConfigVariable::default()/* use setters */,
ConfigVariable::default()/* use (different) setters */,
]);Sourcepub fn set_type<T: Into<Option<Type>>>(self, v: T) -> Self
pub fn set_type<T: Into<Option<Type>>>(self, v: T) -> Self
Sets the value of r#type.
Note that all the setters affecting r#type are mutually
exclusive.
§Example
use google_cloud_connectors_v1::model::auth_config::UserPassword;
let x = AuthConfig::new().set_type(Some(
google_cloud_connectors_v1::model::auth_config::Type::UserPassword(UserPassword::default().into())));Sourcepub fn user_password(&self) -> Option<&Box<UserPassword>>
pub fn user_password(&self) -> Option<&Box<UserPassword>>
The value of [r#type][crate::model::AuthConfig::r#type]
if it holds a UserPassword, None if the field is not set or
holds a different branch.
Sourcepub fn set_user_password<T: Into<Box<UserPassword>>>(self, v: T) -> Self
pub fn set_user_password<T: Into<Box<UserPassword>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::AuthConfig::r#type]
to hold a UserPassword.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_connectors_v1::model::auth_config::UserPassword;
let x = AuthConfig::new().set_user_password(UserPassword::default()/* use setters */);
assert!(x.user_password().is_some());
assert!(x.oauth2_jwt_bearer().is_none());
assert!(x.oauth2_client_credentials().is_none());
assert!(x.ssh_public_key().is_none());Sourcepub fn oauth2_jwt_bearer(&self) -> Option<&Box<Oauth2JwtBearer>>
pub fn oauth2_jwt_bearer(&self) -> Option<&Box<Oauth2JwtBearer>>
The value of [r#type][crate::model::AuthConfig::r#type]
if it holds a Oauth2JwtBearer, None if the field is not set or
holds a different branch.
Sourcepub fn set_oauth2_jwt_bearer<T: Into<Box<Oauth2JwtBearer>>>(self, v: T) -> Self
pub fn set_oauth2_jwt_bearer<T: Into<Box<Oauth2JwtBearer>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::AuthConfig::r#type]
to hold a Oauth2JwtBearer.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_connectors_v1::model::auth_config::Oauth2JwtBearer;
let x = AuthConfig::new().set_oauth2_jwt_bearer(Oauth2JwtBearer::default()/* use setters */);
assert!(x.oauth2_jwt_bearer().is_some());
assert!(x.user_password().is_none());
assert!(x.oauth2_client_credentials().is_none());
assert!(x.ssh_public_key().is_none());Sourcepub fn oauth2_client_credentials(&self) -> Option<&Box<Oauth2ClientCredentials>>
pub fn oauth2_client_credentials(&self) -> Option<&Box<Oauth2ClientCredentials>>
The value of [r#type][crate::model::AuthConfig::r#type]
if it holds a Oauth2ClientCredentials, None if the field is not set or
holds a different branch.
Sourcepub fn set_oauth2_client_credentials<T: Into<Box<Oauth2ClientCredentials>>>(
self,
v: T,
) -> Self
pub fn set_oauth2_client_credentials<T: Into<Box<Oauth2ClientCredentials>>>( self, v: T, ) -> Self
Sets the value of [r#type][crate::model::AuthConfig::r#type]
to hold a Oauth2ClientCredentials.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_connectors_v1::model::auth_config::Oauth2ClientCredentials;
let x = AuthConfig::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
assert!(x.oauth2_client_credentials().is_some());
assert!(x.user_password().is_none());
assert!(x.oauth2_jwt_bearer().is_none());
assert!(x.ssh_public_key().is_none());Sourcepub fn ssh_public_key(&self) -> Option<&Box<SshPublicKey>>
pub fn ssh_public_key(&self) -> Option<&Box<SshPublicKey>>
The value of [r#type][crate::model::AuthConfig::r#type]
if it holds a SshPublicKey, None if the field is not set or
holds a different branch.
Sourcepub fn set_ssh_public_key<T: Into<Box<SshPublicKey>>>(self, v: T) -> Self
pub fn set_ssh_public_key<T: Into<Box<SshPublicKey>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::AuthConfig::r#type]
to hold a SshPublicKey.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
let x = AuthConfig::new().set_ssh_public_key(SshPublicKey::default()/* use setters */);
assert!(x.ssh_public_key().is_some());
assert!(x.user_password().is_none());
assert!(x.oauth2_jwt_bearer().is_none());
assert!(x.oauth2_client_credentials().is_none());Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more