#[non_exhaustive]pub struct ApiKeyConfig {
pub key_name: String,
pub api_key: String,
pub secret_version_for_api_key: String,
pub request_location: RequestLocation,
/* private fields */
}Available on crate feature
tools only.Expand description
Config for authentication with API key.
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.key_name: StringRequired. The parameter name or the header name of the API key. E.g., If the API request is “https://example.com/act?X-Api-Key=<API KEY>”, “X-Api-Key” would be the parameter name.
api_key: StringOptional. The API key. If the secret_version_for_api_key field is
set, this field will be ignored.
secret_version_for_api_key: StringOptional. The name of the SecretManager secret version resource storing
the API key. If this field is set, the api_key field will be ignored.
Format: projects/{project}/secrets/{secret}/versions/{version}
request_location: RequestLocationRequired. Key location in the request.
Implementations§
Source§impl ApiKeyConfig
impl ApiKeyConfig
pub fn new() -> Self
Sourcepub fn set_key_name<T: Into<String>>(self, v: T) -> Self
pub fn set_key_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_api_key<T: Into<String>>(self, v: T) -> Self
pub fn set_api_key<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_secret_version_for_api_key<T: Into<String>>(self, v: T) -> Self
pub fn set_secret_version_for_api_key<T: Into<String>>(self, v: T) -> Self
Sets the value of secret_version_for_api_key.
§Example
ⓘ
let x = ApiKeyConfig::new().set_secret_version_for_api_key("example");Sourcepub fn set_request_location<T: Into<RequestLocation>>(self, v: T) -> Self
pub fn set_request_location<T: Into<RequestLocation>>(self, v: T) -> Self
Sets the value of request_location.
§Example
ⓘ
use google_cloud_dialogflow_v2::model::tool::authentication::RequestLocation;
let x0 = ApiKeyConfig::new().set_request_location(RequestLocation::Header);
let x1 = ApiKeyConfig::new().set_request_location(RequestLocation::QueryString);Trait Implementations§
Source§impl Clone for ApiKeyConfig
impl Clone for ApiKeyConfig
Source§fn clone(&self) -> ApiKeyConfig
fn clone(&self) -> ApiKeyConfig
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 ApiKeyConfig
impl Debug for ApiKeyConfig
Source§impl Default for ApiKeyConfig
impl Default for ApiKeyConfig
Source§fn default() -> ApiKeyConfig
fn default() -> ApiKeyConfig
Returns the “default value” for a type. Read more
Source§impl Message for ApiKeyConfig
impl Message for ApiKeyConfig
Source§impl PartialEq for ApiKeyConfig
impl PartialEq for ApiKeyConfig
impl StructuralPartialEq for ApiKeyConfig
Auto Trait Implementations§
impl Freeze for ApiKeyConfig
impl RefUnwindSafe for ApiKeyConfig
impl Send for ApiKeyConfig
impl Sync for ApiKeyConfig
impl Unpin for ApiKeyConfig
impl UnsafeUnpin for ApiKeyConfig
impl UnwindSafe for ApiKeyConfig
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