Skip to main content

aws_sdk_macie2/operation/update_allow_list/
_update_allow_list_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 UpdateAllowListInput {
6    /// <p>The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression that defines a text pattern to ignore (regex).</p>
7    /// <p>You can change a list's underlying criteria, such as the name of the S3 object or the regular expression to use. However, you can't change the type from s3WordsList to regex or the other way around.</p>
8    pub criteria: ::std::option::Option<crate::types::AllowListCriteria>,
9    /// <p>A custom description of the allow list. The description can contain as many as 512 characters.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>The unique identifier for the Amazon Macie resource that the request applies to.</p>
12    pub id: ::std::option::Option<::std::string::String>,
13    /// <p>A custom name for the allow list. The name can contain as many as 128 characters.</p>
14    pub name: ::std::option::Option<::std::string::String>,
15}
16impl UpdateAllowListInput {
17    /// <p>The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression that defines a text pattern to ignore (regex).</p>
18    /// <p>You can change a list's underlying criteria, such as the name of the S3 object or the regular expression to use. However, you can't change the type from s3WordsList to regex or the other way around.</p>
19    pub fn criteria(&self) -> ::std::option::Option<&crate::types::AllowListCriteria> {
20        self.criteria.as_ref()
21    }
22    /// <p>A custom description of the allow list. The description can contain as many as 512 characters.</p>
23    pub fn description(&self) -> ::std::option::Option<&str> {
24        self.description.as_deref()
25    }
26    /// <p>The unique identifier for the Amazon Macie resource that the request applies to.</p>
27    pub fn id(&self) -> ::std::option::Option<&str> {
28        self.id.as_deref()
29    }
30    /// <p>A custom name for the allow list. The name can contain as many as 128 characters.</p>
31    pub fn name(&self) -> ::std::option::Option<&str> {
32        self.name.as_deref()
33    }
34}
35impl UpdateAllowListInput {
36    /// Creates a new builder-style object to manufacture [`UpdateAllowListInput`](crate::operation::update_allow_list::UpdateAllowListInput).
37    pub fn builder() -> crate::operation::update_allow_list::builders::UpdateAllowListInputBuilder {
38        crate::operation::update_allow_list::builders::UpdateAllowListInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateAllowListInput`](crate::operation::update_allow_list::UpdateAllowListInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateAllowListInputBuilder {
46    pub(crate) criteria: ::std::option::Option<crate::types::AllowListCriteria>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48    pub(crate) id: ::std::option::Option<::std::string::String>,
49    pub(crate) name: ::std::option::Option<::std::string::String>,
50}
51impl UpdateAllowListInputBuilder {
52    /// <p>The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression that defines a text pattern to ignore (regex).</p>
53    /// <p>You can change a list's underlying criteria, such as the name of the S3 object or the regular expression to use. However, you can't change the type from s3WordsList to regex or the other way around.</p>
54    /// This field is required.
55    pub fn criteria(mut self, input: crate::types::AllowListCriteria) -> Self {
56        self.criteria = ::std::option::Option::Some(input);
57        self
58    }
59    /// <p>The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression that defines a text pattern to ignore (regex).</p>
60    /// <p>You can change a list's underlying criteria, such as the name of the S3 object or the regular expression to use. However, you can't change the type from s3WordsList to regex or the other way around.</p>
61    pub fn set_criteria(mut self, input: ::std::option::Option<crate::types::AllowListCriteria>) -> Self {
62        self.criteria = input;
63        self
64    }
65    /// <p>The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression that defines a text pattern to ignore (regex).</p>
66    /// <p>You can change a list's underlying criteria, such as the name of the S3 object or the regular expression to use. However, you can't change the type from s3WordsList to regex or the other way around.</p>
67    pub fn get_criteria(&self) -> &::std::option::Option<crate::types::AllowListCriteria> {
68        &self.criteria
69    }
70    /// <p>A custom description of the allow list. The description can contain as many as 512 characters.</p>
71    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.description = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>A custom description of the allow list. The description can contain as many as 512 characters.</p>
76    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.description = input;
78        self
79    }
80    /// <p>A custom description of the allow list. The description can contain as many as 512 characters.</p>
81    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
82        &self.description
83    }
84    /// <p>The unique identifier for the Amazon Macie resource that the request applies to.</p>
85    /// This field is required.
86    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.id = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The unique identifier for the Amazon Macie resource that the request applies to.</p>
91    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.id = input;
93        self
94    }
95    /// <p>The unique identifier for the Amazon Macie resource that the request applies to.</p>
96    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
97        &self.id
98    }
99    /// <p>A custom name for the allow list. The name can contain as many as 128 characters.</p>
100    /// This field is required.
101    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.name = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>A custom name for the allow list. The name can contain as many as 128 characters.</p>
106    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.name = input;
108        self
109    }
110    /// <p>A custom name for the allow list. The name can contain as many as 128 characters.</p>
111    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
112        &self.name
113    }
114    /// Consumes the builder and constructs a [`UpdateAllowListInput`](crate::operation::update_allow_list::UpdateAllowListInput).
115    pub fn build(
116        self,
117    ) -> ::std::result::Result<crate::operation::update_allow_list::UpdateAllowListInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::update_allow_list::UpdateAllowListInput {
119            criteria: self.criteria,
120            description: self.description,
121            id: self.id,
122            name: self.name,
123        })
124    }
125}