aws_sdk_databrew/operation/describe_ruleset/
_describe_ruleset_output.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 DescribeRulesetOutput {
6    /// <p>The name of the ruleset.</p>
7    pub name: ::std::string::String,
8    /// <p>The description of the ruleset.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
11    pub target_arn: ::std::option::Option<::std::string::String>,
12    /// <p>A list of rules that are defined with the ruleset. A rule includes one or more checks to be validated on a DataBrew dataset.</p>
13    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
14    /// <p>The date and time that the ruleset was created.</p>
15    pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
16    /// <p>The Amazon Resource Name (ARN) of the user who created the ruleset.</p>
17    pub created_by: ::std::option::Option<::std::string::String>,
18    /// <p>The Amazon Resource Name (ARN) of the user who last modified the ruleset.</p>
19    pub last_modified_by: ::std::option::Option<::std::string::String>,
20    /// <p>The modification date and time of the ruleset.</p>
21    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
22    /// <p>The Amazon Resource Name (ARN) for the ruleset.</p>
23    pub resource_arn: ::std::option::Option<::std::string::String>,
24    /// <p>Metadata tags that have been applied to the ruleset.</p>
25    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26    _request_id: Option<String>,
27}
28impl DescribeRulesetOutput {
29    /// <p>The name of the ruleset.</p>
30    pub fn name(&self) -> &str {
31        use std::ops::Deref;
32        self.name.deref()
33    }
34    /// <p>The description of the ruleset.</p>
35    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
39    pub fn target_arn(&self) -> ::std::option::Option<&str> {
40        self.target_arn.as_deref()
41    }
42    /// <p>A list of rules that are defined with the ruleset. A rule includes one or more checks to be validated on a DataBrew dataset.</p>
43    ///
44    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rules.is_none()`.
45    pub fn rules(&self) -> &[crate::types::Rule] {
46        self.rules.as_deref().unwrap_or_default()
47    }
48    /// <p>The date and time that the ruleset was created.</p>
49    pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
50        self.create_date.as_ref()
51    }
52    /// <p>The Amazon Resource Name (ARN) of the user who created the ruleset.</p>
53    pub fn created_by(&self) -> ::std::option::Option<&str> {
54        self.created_by.as_deref()
55    }
56    /// <p>The Amazon Resource Name (ARN) of the user who last modified the ruleset.</p>
57    pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
58        self.last_modified_by.as_deref()
59    }
60    /// <p>The modification date and time of the ruleset.</p>
61    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
62        self.last_modified_date.as_ref()
63    }
64    /// <p>The Amazon Resource Name (ARN) for the ruleset.</p>
65    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
66        self.resource_arn.as_deref()
67    }
68    /// <p>Metadata tags that have been applied to the ruleset.</p>
69    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
70        self.tags.as_ref()
71    }
72}
73impl ::aws_types::request_id::RequestId for DescribeRulesetOutput {
74    fn request_id(&self) -> Option<&str> {
75        self._request_id.as_deref()
76    }
77}
78impl DescribeRulesetOutput {
79    /// Creates a new builder-style object to manufacture [`DescribeRulesetOutput`](crate::operation::describe_ruleset::DescribeRulesetOutput).
80    pub fn builder() -> crate::operation::describe_ruleset::builders::DescribeRulesetOutputBuilder {
81        crate::operation::describe_ruleset::builders::DescribeRulesetOutputBuilder::default()
82    }
83}
84
85/// A builder for [`DescribeRulesetOutput`](crate::operation::describe_ruleset::DescribeRulesetOutput).
86#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
87#[non_exhaustive]
88pub struct DescribeRulesetOutputBuilder {
89    pub(crate) name: ::std::option::Option<::std::string::String>,
90    pub(crate) description: ::std::option::Option<::std::string::String>,
91    pub(crate) target_arn: ::std::option::Option<::std::string::String>,
92    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
93    pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
94    pub(crate) created_by: ::std::option::Option<::std::string::String>,
95    pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
96    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
97    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
98    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
99    _request_id: Option<String>,
100}
101impl DescribeRulesetOutputBuilder {
102    /// <p>The name of the ruleset.</p>
103    /// This field is required.
104    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.name = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The name of the ruleset.</p>
109    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.name = input;
111        self
112    }
113    /// <p>The name of the ruleset.</p>
114    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
115        &self.name
116    }
117    /// <p>The description of the ruleset.</p>
118    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.description = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The description of the ruleset.</p>
123    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.description = input;
125        self
126    }
127    /// <p>The description of the ruleset.</p>
128    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
129        &self.description
130    }
131    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
132    pub fn target_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.target_arn = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
137    pub fn set_target_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.target_arn = input;
139        self
140    }
141    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
142    pub fn get_target_arn(&self) -> &::std::option::Option<::std::string::String> {
143        &self.target_arn
144    }
145    /// Appends an item to `rules`.
146    ///
147    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
148    ///
149    /// <p>A list of rules that are defined with the ruleset. A rule includes one or more checks to be validated on a DataBrew dataset.</p>
150    pub fn rules(mut self, input: crate::types::Rule) -> Self {
151        let mut v = self.rules.unwrap_or_default();
152        v.push(input);
153        self.rules = ::std::option::Option::Some(v);
154        self
155    }
156    /// <p>A list of rules that are defined with the ruleset. A rule includes one or more checks to be validated on a DataBrew dataset.</p>
157    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
158        self.rules = input;
159        self
160    }
161    /// <p>A list of rules that are defined with the ruleset. A rule includes one or more checks to be validated on a DataBrew dataset.</p>
162    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
163        &self.rules
164    }
165    /// <p>The date and time that the ruleset was created.</p>
166    pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
167        self.create_date = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>The date and time that the ruleset was created.</p>
171    pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
172        self.create_date = input;
173        self
174    }
175    /// <p>The date and time that the ruleset was created.</p>
176    pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177        &self.create_date
178    }
179    /// <p>The Amazon Resource Name (ARN) of the user who created the ruleset.</p>
180    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.created_by = ::std::option::Option::Some(input.into());
182        self
183    }
184    /// <p>The Amazon Resource Name (ARN) of the user who created the ruleset.</p>
185    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.created_by = input;
187        self
188    }
189    /// <p>The Amazon Resource Name (ARN) of the user who created the ruleset.</p>
190    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
191        &self.created_by
192    }
193    /// <p>The Amazon Resource Name (ARN) of the user who last modified the ruleset.</p>
194    pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.last_modified_by = ::std::option::Option::Some(input.into());
196        self
197    }
198    /// <p>The Amazon Resource Name (ARN) of the user who last modified the ruleset.</p>
199    pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.last_modified_by = input;
201        self
202    }
203    /// <p>The Amazon Resource Name (ARN) of the user who last modified the ruleset.</p>
204    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
205        &self.last_modified_by
206    }
207    /// <p>The modification date and time of the ruleset.</p>
208    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
209        self.last_modified_date = ::std::option::Option::Some(input);
210        self
211    }
212    /// <p>The modification date and time of the ruleset.</p>
213    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
214        self.last_modified_date = input;
215        self
216    }
217    /// <p>The modification date and time of the ruleset.</p>
218    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
219        &self.last_modified_date
220    }
221    /// <p>The Amazon Resource Name (ARN) for the ruleset.</p>
222    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.resource_arn = ::std::option::Option::Some(input.into());
224        self
225    }
226    /// <p>The Amazon Resource Name (ARN) for the ruleset.</p>
227    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.resource_arn = input;
229        self
230    }
231    /// <p>The Amazon Resource Name (ARN) for the ruleset.</p>
232    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
233        &self.resource_arn
234    }
235    /// Adds a key-value pair to `tags`.
236    ///
237    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
238    ///
239    /// <p>Metadata tags that have been applied to the ruleset.</p>
240    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
241        let mut hash_map = self.tags.unwrap_or_default();
242        hash_map.insert(k.into(), v.into());
243        self.tags = ::std::option::Option::Some(hash_map);
244        self
245    }
246    /// <p>Metadata tags that have been applied to the ruleset.</p>
247    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
248        self.tags = input;
249        self
250    }
251    /// <p>Metadata tags that have been applied to the ruleset.</p>
252    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
253        &self.tags
254    }
255    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
256        self._request_id = Some(request_id.into());
257        self
258    }
259
260    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
261        self._request_id = request_id;
262        self
263    }
264    /// Consumes the builder and constructs a [`DescribeRulesetOutput`](crate::operation::describe_ruleset::DescribeRulesetOutput).
265    /// This method will fail if any of the following fields are not set:
266    /// - [`name`](crate::operation::describe_ruleset::builders::DescribeRulesetOutputBuilder::name)
267    pub fn build(
268        self,
269    ) -> ::std::result::Result<crate::operation::describe_ruleset::DescribeRulesetOutput, ::aws_smithy_types::error::operation::BuildError> {
270        ::std::result::Result::Ok(crate::operation::describe_ruleset::DescribeRulesetOutput {
271            name: self.name.ok_or_else(|| {
272                ::aws_smithy_types::error::operation::BuildError::missing_field(
273                    "name",
274                    "name was not specified but it is required when building DescribeRulesetOutput",
275                )
276            })?,
277            description: self.description,
278            target_arn: self.target_arn,
279            rules: self.rules,
280            create_date: self.create_date,
281            created_by: self.created_by,
282            last_modified_by: self.last_modified_by,
283            last_modified_date: self.last_modified_date,
284            resource_arn: self.resource_arn,
285            tags: self.tags,
286            _request_id: self._request_id,
287        })
288    }
289}