#[non_exhaustive]pub struct AuthenticationRule {
pub selector: String,
pub oauth: Option<OAuthRequirements>,
pub allow_without_credential: bool,
pub requirements: Vec<AuthRequirement>,
/* private fields */
}Expand description
Authentication rules for the service.
By default, if a method has any authentication requirements, every request must include a valid credential matching one of the requirements. It’s an error to include more than one kind of credential in a single request.
If a method doesn’t have any auth requirements, request credentials will be ignored.
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.selector: StringSelects the methods to which this rule applies.
Refer to selector for syntax details.
oauth: Option<OAuthRequirements>The requirements for OAuth credentials.
allow_without_credential: boolIf true, the service accepts API keys without any other credential. This flag only applies to HTTP and gRPC requests.
requirements: Vec<AuthRequirement>Requirements for additional authentication providers.
Implementations§
Source§impl AuthenticationRule
impl AuthenticationRule
pub fn new() -> Self
Sourcepub fn set_selector<T: Into<String>>(self, v: T) -> Self
pub fn set_selector<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_oauth<T>(self, v: T) -> Selfwhere
T: Into<OAuthRequirements>,
pub fn set_oauth<T>(self, v: T) -> Selfwhere
T: Into<OAuthRequirements>,
Sourcepub fn set_or_clear_oauth<T>(self, v: Option<T>) -> Selfwhere
T: Into<OAuthRequirements>,
pub fn set_or_clear_oauth<T>(self, v: Option<T>) -> Selfwhere
T: Into<OAuthRequirements>,
Sourcepub fn set_allow_without_credential<T: Into<bool>>(self, v: T) -> Self
pub fn set_allow_without_credential<T: Into<bool>>(self, v: T) -> Self
Sets the value of allow_without_credential.
§Example
ⓘ
let x = AuthenticationRule::new().set_allow_without_credential(true);Sourcepub fn set_requirements<T, V>(self, v: T) -> Self
pub fn set_requirements<T, V>(self, v: T) -> Self
Sets the value of requirements.
§Example
ⓘ
use google_cloud_api::model::AuthRequirement;
let x = AuthenticationRule::new()
.set_requirements([
AuthRequirement::default()/* use setters */,
AuthRequirement::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for AuthenticationRule
impl Clone for AuthenticationRule
Source§fn clone(&self) -> AuthenticationRule
fn clone(&self) -> AuthenticationRule
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 AuthenticationRule
impl Debug for AuthenticationRule
Source§impl Default for AuthenticationRule
impl Default for AuthenticationRule
Source§fn default() -> AuthenticationRule
fn default() -> AuthenticationRule
Returns the “default value” for a type. Read more
Source§impl Message for AuthenticationRule
impl Message for AuthenticationRule
Source§impl PartialEq for AuthenticationRule
impl PartialEq for AuthenticationRule
impl StructuralPartialEq for AuthenticationRule
Auto Trait Implementations§
impl Freeze for AuthenticationRule
impl RefUnwindSafe for AuthenticationRule
impl Send for AuthenticationRule
impl Sync for AuthenticationRule
impl Unpin for AuthenticationRule
impl UnwindSafe for AuthenticationRule
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