#[non_exhaustive]pub struct OAuthConfig {
pub oauth_grant_type: OauthGrantType,
pub client_id: String,
pub client_secret: String,
pub secret_version_for_client_secret: String,
pub token_endpoint: String,
pub scopes: Vec<String>,
/* private fields */
}Available on crate feature
tools only.Expand description
Config for authentication with OAuth.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.oauth_grant_type: OauthGrantTypeRequired. OAuth grant types.
client_id: StringRequired. The client ID from the OAuth provider.
client_secret: StringOptional. The client secret from the OAuth provider. If the
secret_version_for_client_secret field is set, this field will be
ignored.
secret_version_for_client_secret: StringOptional. The name of the SecretManager secret version resource storing
the client secret. If this field is set, the client_secret field will
be ignored. Format:
projects/{project}/secrets/{secret}/versions/{version}
token_endpoint: StringRequired. The token endpoint in the OAuth provider to exchange for an access token.
scopes: Vec<String>Optional. The OAuth scopes to grant.
Implementations§
Source§impl OAuthConfig
impl OAuthConfig
pub fn new() -> Self
Sourcepub fn set_oauth_grant_type<T: Into<OauthGrantType>>(self, v: T) -> Self
pub fn set_oauth_grant_type<T: Into<OauthGrantType>>(self, v: T) -> Self
Sets the value of oauth_grant_type.
§Example
ⓘ
use google_cloud_dialogflow_v2::model::tool::authentication::o_auth_config::OauthGrantType;
let x0 = OAuthConfig::new().set_oauth_grant_type(OauthGrantType::ClientCredential);Sourcepub fn set_client_id<T: Into<String>>(self, v: T) -> Self
pub fn set_client_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_client_secret<T: Into<String>>(self, v: T) -> Self
pub fn set_client_secret<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_secret_version_for_client_secret<T: Into<String>>(self, v: T) -> Self
pub fn set_secret_version_for_client_secret<T: Into<String>>(self, v: T) -> Self
Sets the value of secret_version_for_client_secret.
§Example
ⓘ
let x = OAuthConfig::new().set_secret_version_for_client_secret("example");Sourcepub fn set_token_endpoint<T: Into<String>>(self, v: T) -> Self
pub fn set_token_endpoint<T: Into<String>>(self, v: T) -> Self
Sets the value of token_endpoint.
§Example
ⓘ
let x = OAuthConfig::new().set_token_endpoint("example");Sourcepub fn set_scopes<T, V>(self, v: T) -> Self
pub fn set_scopes<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for OAuthConfig
impl Clone for OAuthConfig
Source§fn clone(&self) -> OAuthConfig
fn clone(&self) -> OAuthConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuthConfig
impl Debug for OAuthConfig
Source§impl Default for OAuthConfig
impl Default for OAuthConfig
Source§fn default() -> OAuthConfig
fn default() -> OAuthConfig
Returns the “default value” for a type. Read more
Source§impl Message for OAuthConfig
impl Message for OAuthConfig
Source§impl PartialEq for OAuthConfig
impl PartialEq for OAuthConfig
impl StructuralPartialEq for OAuthConfig
Auto Trait Implementations§
impl Freeze for OAuthConfig
impl RefUnwindSafe for OAuthConfig
impl Send for OAuthConfig
impl Sync for OAuthConfig
impl Unpin for OAuthConfig
impl UnsafeUnpin for OAuthConfig
impl UnwindSafe for OAuthConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more