aws_sdk_waf/operation/update_regex_pattern_set/_update_regex_pattern_set_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateRegexPatternSetInput {
6 /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
7 pub regex_pattern_set_id: ::std::option::Option<::std::string::String>,
8 /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
9 pub updates: ::std::option::Option<::std::vec::Vec<crate::types::RegexPatternSetUpdate>>,
10 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
11 pub change_token: ::std::option::Option<::std::string::String>,
12}
13impl UpdateRegexPatternSetInput {
14 /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
15 pub fn regex_pattern_set_id(&self) -> ::std::option::Option<&str> {
16 self.regex_pattern_set_id.as_deref()
17 }
18 /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
19 ///
20 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.updates.is_none()`.
21 pub fn updates(&self) -> &[crate::types::RegexPatternSetUpdate] {
22 self.updates.as_deref().unwrap_or_default()
23 }
24 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
25 pub fn change_token(&self) -> ::std::option::Option<&str> {
26 self.change_token.as_deref()
27 }
28}
29impl UpdateRegexPatternSetInput {
30 /// Creates a new builder-style object to manufacture [`UpdateRegexPatternSetInput`](crate::operation::update_regex_pattern_set::UpdateRegexPatternSetInput).
31 pub fn builder() -> crate::operation::update_regex_pattern_set::builders::UpdateRegexPatternSetInputBuilder {
32 crate::operation::update_regex_pattern_set::builders::UpdateRegexPatternSetInputBuilder::default()
33 }
34}
35
36/// A builder for [`UpdateRegexPatternSetInput`](crate::operation::update_regex_pattern_set::UpdateRegexPatternSetInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateRegexPatternSetInputBuilder {
40 pub(crate) regex_pattern_set_id: ::std::option::Option<::std::string::String>,
41 pub(crate) updates: ::std::option::Option<::std::vec::Vec<crate::types::RegexPatternSetUpdate>>,
42 pub(crate) change_token: ::std::option::Option<::std::string::String>,
43}
44impl UpdateRegexPatternSetInputBuilder {
45 /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
46 /// This field is required.
47 pub fn regex_pattern_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.regex_pattern_set_id = ::std::option::Option::Some(input.into());
49 self
50 }
51 /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
52 pub fn set_regex_pattern_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.regex_pattern_set_id = input;
54 self
55 }
56 /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
57 pub fn get_regex_pattern_set_id(&self) -> &::std::option::Option<::std::string::String> {
58 &self.regex_pattern_set_id
59 }
60 /// Appends an item to `updates`.
61 ///
62 /// To override the contents of this collection use [`set_updates`](Self::set_updates).
63 ///
64 /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
65 pub fn updates(mut self, input: crate::types::RegexPatternSetUpdate) -> Self {
66 let mut v = self.updates.unwrap_or_default();
67 v.push(input);
68 self.updates = ::std::option::Option::Some(v);
69 self
70 }
71 /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
72 pub fn set_updates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RegexPatternSetUpdate>>) -> Self {
73 self.updates = input;
74 self
75 }
76 /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
77 pub fn get_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RegexPatternSetUpdate>> {
78 &self.updates
79 }
80 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
81 /// This field is required.
82 pub fn change_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.change_token = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
87 pub fn set_change_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.change_token = input;
89 self
90 }
91 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
92 pub fn get_change_token(&self) -> &::std::option::Option<::std::string::String> {
93 &self.change_token
94 }
95 /// Consumes the builder and constructs a [`UpdateRegexPatternSetInput`](crate::operation::update_regex_pattern_set::UpdateRegexPatternSetInput).
96 pub fn build(
97 self,
98 ) -> ::std::result::Result<crate::operation::update_regex_pattern_set::UpdateRegexPatternSetInput, ::aws_smithy_types::error::operation::BuildError>
99 {
100 ::std::result::Result::Ok(crate::operation::update_regex_pattern_set::UpdateRegexPatternSetInput {
101 regex_pattern_set_id: self.regex_pattern_set_id,
102 updates: self.updates,
103 change_token: self.change_token,
104 })
105 }
106}