aws_sdk_elasticbeanstalk/types/
_option_restriction_regex.rs

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