1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A regular expression representing a restriction on a string configuration option value.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct OptionRestrictionRegex {
/// <p>The regular expression pattern that a string configuration option value with this restriction must match.</p>
pub pattern: ::std::option::Option<::std::string::String>,
/// <p>A unique name representing this regular expression.</p>
pub label: ::std::option::Option<::std::string::String>,
}
impl OptionRestrictionRegex {
/// <p>The regular expression pattern that a string configuration option value with this restriction must match.</p>
pub fn pattern(&self) -> ::std::option::Option<&str> {
self.pattern.as_deref()
}
/// <p>A unique name representing this regular expression.</p>
pub fn label(&self) -> ::std::option::Option<&str> {
self.label.as_deref()
}
}
impl OptionRestrictionRegex {
/// Creates a new builder-style object to manufacture [`OptionRestrictionRegex`](crate::types::OptionRestrictionRegex).
pub fn builder() -> crate::types::builders::OptionRestrictionRegexBuilder {
crate::types::builders::OptionRestrictionRegexBuilder::default()
}
}
/// A builder for [`OptionRestrictionRegex`](crate::types::OptionRestrictionRegex).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct OptionRestrictionRegexBuilder {
pub(crate) pattern: ::std::option::Option<::std::string::String>,
pub(crate) label: ::std::option::Option<::std::string::String>,
}
impl OptionRestrictionRegexBuilder {
/// <p>The regular expression pattern that a string configuration option value with this restriction must match.</p>
pub fn pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.pattern = ::std::option::Option::Some(input.into());
self
}
/// <p>The regular expression pattern that a string configuration option value with this restriction must match.</p>
pub fn set_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.pattern = input;
self
}
/// <p>The regular expression pattern that a string configuration option value with this restriction must match.</p>
pub fn get_pattern(&self) -> &::std::option::Option<::std::string::String> {
&self.pattern
}
/// <p>A unique name representing this regular expression.</p>
pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.label = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique name representing this regular expression.</p>
pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.label = input;
self
}
/// <p>A unique name representing this regular expression.</p>
pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
&self.label
}
/// Consumes the builder and constructs a [`OptionRestrictionRegex`](crate::types::OptionRestrictionRegex).
pub fn build(self) -> crate::types::OptionRestrictionRegex {
crate::types::OptionRestrictionRegex {
pattern: self.pattern,
label: self.label,
}
}
}