#[non_exhaustive]pub struct Authentication {
pub auth_config: Option<AuthConfig>,
/* private fields */
}tools only.Expand description
Authentication information required for API calls
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_config: Option<AuthConfig>The auth configuration.
Implementations§
Source§impl Authentication
impl Authentication
pub fn new() -> Self
Sourcepub fn set_auth_config<T: Into<Option<AuthConfig>>>(self, v: T) -> Self
pub fn set_auth_config<T: Into<Option<AuthConfig>>>(self, v: T) -> Self
Sets the value of auth_config.
Note that all the setters affecting auth_config are mutually
exclusive.
§Example
use google_cloud_dialogflow_v2::model::tool::authentication::ApiKeyConfig;
let x = Authentication::new().set_auth_config(Some(
google_cloud_dialogflow_v2::model::tool::authentication::AuthConfig::ApiKeyConfig(ApiKeyConfig::default().into())));Sourcepub fn api_key_config(&self) -> Option<&Box<ApiKeyConfig>>
pub fn api_key_config(&self) -> Option<&Box<ApiKeyConfig>>
The value of auth_config
if it holds a ApiKeyConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_api_key_config<T: Into<Box<ApiKeyConfig>>>(self, v: T) -> Self
pub fn set_api_key_config<T: Into<Box<ApiKeyConfig>>>(self, v: T) -> Self
Sets the value of auth_config
to hold a ApiKeyConfig.
Note that all the setters affecting auth_config are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::tool::authentication::ApiKeyConfig;
let x = Authentication::new().set_api_key_config(ApiKeyConfig::default()/* use setters */);
assert!(x.api_key_config().is_some());
assert!(x.oauth_config().is_none());
assert!(x.service_agent_auth_config().is_none());
assert!(x.bearer_token_config().is_none());Sourcepub fn oauth_config(&self) -> Option<&Box<OAuthConfig>>
pub fn oauth_config(&self) -> Option<&Box<OAuthConfig>>
The value of auth_config
if it holds a OauthConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_oauth_config<T: Into<Box<OAuthConfig>>>(self, v: T) -> Self
pub fn set_oauth_config<T: Into<Box<OAuthConfig>>>(self, v: T) -> Self
Sets the value of auth_config
to hold a OauthConfig.
Note that all the setters affecting auth_config are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::tool::authentication::OAuthConfig;
let x = Authentication::new().set_oauth_config(OAuthConfig::default()/* use setters */);
assert!(x.oauth_config().is_some());
assert!(x.api_key_config().is_none());
assert!(x.service_agent_auth_config().is_none());
assert!(x.bearer_token_config().is_none());Sourcepub fn service_agent_auth_config(&self) -> Option<&Box<ServiceAgentAuthConfig>>
pub fn service_agent_auth_config(&self) -> Option<&Box<ServiceAgentAuthConfig>>
The value of auth_config
if it holds a ServiceAgentAuthConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_service_agent_auth_config<T: Into<Box<ServiceAgentAuthConfig>>>(
self,
v: T,
) -> Self
pub fn set_service_agent_auth_config<T: Into<Box<ServiceAgentAuthConfig>>>( self, v: T, ) -> Self
Sets the value of auth_config
to hold a ServiceAgentAuthConfig.
Note that all the setters affecting auth_config are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::tool::authentication::ServiceAgentAuthConfig;
let x = Authentication::new().set_service_agent_auth_config(ServiceAgentAuthConfig::default()/* use setters */);
assert!(x.service_agent_auth_config().is_some());
assert!(x.api_key_config().is_none());
assert!(x.oauth_config().is_none());
assert!(x.bearer_token_config().is_none());Sourcepub fn bearer_token_config(&self) -> Option<&Box<BearerTokenConfig>>
pub fn bearer_token_config(&self) -> Option<&Box<BearerTokenConfig>>
The value of auth_config
if it holds a BearerTokenConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_bearer_token_config<T: Into<Box<BearerTokenConfig>>>(
self,
v: T,
) -> Self
pub fn set_bearer_token_config<T: Into<Box<BearerTokenConfig>>>( self, v: T, ) -> Self
Sets the value of auth_config
to hold a BearerTokenConfig.
Note that all the setters affecting auth_config are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::tool::authentication::BearerTokenConfig;
let x = Authentication::new().set_bearer_token_config(BearerTokenConfig::default()/* use setters */);
assert!(x.bearer_token_config().is_some());
assert!(x.api_key_config().is_none());
assert!(x.oauth_config().is_none());
assert!(x.service_agent_auth_config().is_none());Trait Implementations§
Source§impl Clone for Authentication
impl Clone for Authentication
Source§fn clone(&self) -> Authentication
fn clone(&self) -> Authentication
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more