Skip to main content

aws_sdk_wafv2/types/
_regex_pattern_set_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>High-level information about a <code>RegexPatternSet</code>, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a <code>RegexPatternSet</code>, and the ARN, that you provide to the <code>RegexPatternSetReferenceStatement</code> to use the pattern set in a <code>Rule</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RegexPatternSetSummary {
7    /// <p>The name of the data type instance. You cannot change the name after you create the instance.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
10    pub id: ::std::option::Option<::std::string::String>,
11    /// <p>A description of the set that helps with identification.</p>
12    pub description: ::std::option::Option<::std::string::String>,
13    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
14    pub lock_token: ::std::option::Option<::std::string::String>,
15    /// <p>The Amazon Resource Name (ARN) of the entity.</p>
16    pub arn: ::std::option::Option<::std::string::String>,
17}
18impl RegexPatternSetSummary {
19    /// <p>The name of the data type instance. You cannot change the name after you create the instance.</p>
20    pub fn name(&self) -> ::std::option::Option<&str> {
21        self.name.as_deref()
22    }
23    /// <p>A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
24    pub fn id(&self) -> ::std::option::Option<&str> {
25        self.id.as_deref()
26    }
27    /// <p>A description of the set that helps with identification.</p>
28    pub fn description(&self) -> ::std::option::Option<&str> {
29        self.description.as_deref()
30    }
31    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
32    pub fn lock_token(&self) -> ::std::option::Option<&str> {
33        self.lock_token.as_deref()
34    }
35    /// <p>The Amazon Resource Name (ARN) of the entity.</p>
36    pub fn arn(&self) -> ::std::option::Option<&str> {
37        self.arn.as_deref()
38    }
39}
40impl RegexPatternSetSummary {
41    /// Creates a new builder-style object to manufacture [`RegexPatternSetSummary`](crate::types::RegexPatternSetSummary).
42    pub fn builder() -> crate::types::builders::RegexPatternSetSummaryBuilder {
43        crate::types::builders::RegexPatternSetSummaryBuilder::default()
44    }
45}
46
47/// A builder for [`RegexPatternSetSummary`](crate::types::RegexPatternSetSummary).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct RegexPatternSetSummaryBuilder {
51    pub(crate) name: ::std::option::Option<::std::string::String>,
52    pub(crate) id: ::std::option::Option<::std::string::String>,
53    pub(crate) description: ::std::option::Option<::std::string::String>,
54    pub(crate) lock_token: ::std::option::Option<::std::string::String>,
55    pub(crate) arn: ::std::option::Option<::std::string::String>,
56}
57impl RegexPatternSetSummaryBuilder {
58    /// <p>The name of the data type instance. You cannot change the name after you create the instance.</p>
59    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the data type instance. You cannot change the name after you create the instance.</p>
64    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.name = input;
66        self
67    }
68    /// <p>The name of the data type instance. You cannot change the name after you create the instance.</p>
69    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.name
71    }
72    /// <p>A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
73    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
78    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.id = input;
80        self
81    }
82    /// <p>A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
83    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.id
85    }
86    /// <p>A description of the set that helps with identification.</p>
87    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.description = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>A description of the set that helps with identification.</p>
92    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.description = input;
94        self
95    }
96    /// <p>A description of the set that helps with identification.</p>
97    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
98        &self.description
99    }
100    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
101    pub fn lock_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.lock_token = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
106    pub fn set_lock_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.lock_token = input;
108        self
109    }
110    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
111    pub fn get_lock_token(&self) -> &::std::option::Option<::std::string::String> {
112        &self.lock_token
113    }
114    /// <p>The Amazon Resource Name (ARN) of the entity.</p>
115    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.arn = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The Amazon Resource Name (ARN) of the entity.</p>
120    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.arn = input;
122        self
123    }
124    /// <p>The Amazon Resource Name (ARN) of the entity.</p>
125    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
126        &self.arn
127    }
128    /// Consumes the builder and constructs a [`RegexPatternSetSummary`](crate::types::RegexPatternSetSummary).
129    pub fn build(self) -> crate::types::RegexPatternSetSummary {
130        crate::types::RegexPatternSetSummary {
131            name: self.name,
132            id: self.id,
133            description: self.description,
134            lock_token: self.lock_token,
135            arn: self.arn,
136        }
137    }
138}