#[non_exhaustive]pub struct Validation {
pub constraint: Option<Constraint>,
/* private fields */
}Expand description
The validation of the parameter.
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.constraint: Option<Constraint>Defines validators for parameter values.
Implementations§
Source§impl Validation
impl Validation
pub fn new() -> Self
Sourcepub fn set_constraint<T: Into<Option<Constraint>>>(self, v: T) -> Self
pub fn set_constraint<T: Into<Option<Constraint>>>(self, v: T) -> Self
Sets the value of constraint.
Note that all the setters affecting constraint are mutually
exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
let x = Validation::new().set_constraint(Some(
google_cloud_cloudsecuritycompliance_v1::model::validation::Constraint::AllowedValues(AllowedValues::default().into())));Sourcepub fn allowed_values(&self) -> Option<&Box<AllowedValues>>
pub fn allowed_values(&self) -> Option<&Box<AllowedValues>>
The value of constraint
if it holds a AllowedValues, None if the field is not set or
holds a different branch.
Sourcepub fn set_allowed_values<T: Into<Box<AllowedValues>>>(self, v: T) -> Self
pub fn set_allowed_values<T: Into<Box<AllowedValues>>>(self, v: T) -> Self
Sets the value of constraint
to hold a AllowedValues.
Note that all the setters affecting constraint are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
let x = Validation::new().set_allowed_values(AllowedValues::default()/* use setters */);
assert!(x.allowed_values().is_some());
assert!(x.int_range().is_none());
assert!(x.regexp_pattern().is_none());Sourcepub fn int_range(&self) -> Option<&Box<IntRange>>
pub fn int_range(&self) -> Option<&Box<IntRange>>
The value of constraint
if it holds a IntRange, None if the field is not set or
holds a different branch.
Sourcepub fn set_int_range<T: Into<Box<IntRange>>>(self, v: T) -> Self
pub fn set_int_range<T: Into<Box<IntRange>>>(self, v: T) -> Self
Sets the value of constraint
to hold a IntRange.
Note that all the setters affecting constraint are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
let x = Validation::new().set_int_range(IntRange::default()/* use setters */);
assert!(x.int_range().is_some());
assert!(x.allowed_values().is_none());
assert!(x.regexp_pattern().is_none());Sourcepub fn regexp_pattern(&self) -> Option<&Box<RegexpPattern>>
pub fn regexp_pattern(&self) -> Option<&Box<RegexpPattern>>
The value of constraint
if it holds a RegexpPattern, None if the field is not set or
holds a different branch.
Sourcepub fn set_regexp_pattern<T: Into<Box<RegexpPattern>>>(self, v: T) -> Self
pub fn set_regexp_pattern<T: Into<Box<RegexpPattern>>>(self, v: T) -> Self
Sets the value of constraint
to hold a RegexpPattern.
Note that all the setters affecting constraint are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
let x = Validation::new().set_regexp_pattern(RegexpPattern::default()/* use setters */);
assert!(x.regexp_pattern().is_some());
assert!(x.allowed_values().is_none());
assert!(x.int_range().is_none());Trait Implementations§
Source§impl Clone for Validation
impl Clone for Validation
Source§fn clone(&self) -> Validation
fn clone(&self) -> Validation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more