#[non_exhaustive]pub struct ParamValue {
pub kind: Option<Kind>,
/* private fields */
}Expand description
The possible parameter value types.
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.kind: Option<Kind>The list of possible parameter value types.
Implementations§
Source§impl ParamValue
impl ParamValue
pub fn new() -> Self
Sourcepub fn string_value(&self) -> Option<&String>
pub fn string_value(&self) -> Option<&String>
The value of kind
if it holds a StringValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_value<T: Into<String>>(self, v: T) -> Self
pub fn set_string_value<T: Into<String>>(self, v: T) -> Self
Sets the value of kind
to hold a StringValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
let x = ParamValue::new().set_string_value("example");
assert!(x.string_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.number_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn bool_value(&self) -> Option<&bool>
pub fn bool_value(&self) -> Option<&bool>
The value of kind
if it holds a BoolValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_bool_value<T: Into<bool>>(self, v: T) -> Self
pub fn set_bool_value<T: Into<bool>>(self, v: T) -> Self
Sets the value of kind
to hold a BoolValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
let x = ParamValue::new().set_bool_value(true);
assert!(x.bool_value().is_some());
assert!(x.string_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.number_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn string_list_value(&self) -> Option<&Box<StringList>>
pub fn string_list_value(&self) -> Option<&Box<StringList>>
The value of kind
if it holds a StringListValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_list_value<T: Into<Box<StringList>>>(self, v: T) -> Self
pub fn set_string_list_value<T: Into<Box<StringList>>>(self, v: T) -> Self
Sets the value of kind
to hold a StringListValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::StringList;
let x = ParamValue::new().set_string_list_value(StringList::default()/* use setters */);
assert!(x.string_list_value().is_some());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());
assert!(x.number_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn number_value(&self) -> Option<&f64>
pub fn number_value(&self) -> Option<&f64>
The value of kind
if it holds a NumberValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_number_value<T: Into<f64>>(self, v: T) -> Self
pub fn set_number_value<T: Into<f64>>(self, v: T) -> Self
Sets the value of kind
to hold a NumberValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
let x = ParamValue::new().set_number_value(42.0);
assert!(x.number_value().is_some());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn oneof_value(&self) -> Option<&Box<Parameter>>
pub fn oneof_value(&self) -> Option<&Box<Parameter>>
The value of kind
if it holds a OneofValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_oneof_value<T: Into<Box<Parameter>>>(self, v: T) -> Self
pub fn set_oneof_value<T: Into<Box<Parameter>>>(self, v: T) -> Self
Sets the value of kind
to hold a OneofValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
let x = ParamValue::new().set_oneof_value(Parameter::default()/* use setters */);
assert!(x.oneof_value().is_some());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.number_value().is_none());Trait Implementations§
Source§impl Clone for ParamValue
impl Clone for ParamValue
Source§fn clone(&self) -> ParamValue
fn clone(&self) -> ParamValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more