aws_sdk_databrew/operation/describe_ruleset/
_describe_ruleset_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeRulesetOutput {
6    pub name: ::std::string::String,
8    pub description: ::std::option::Option<::std::string::String>,
10    pub target_arn: ::std::option::Option<::std::string::String>,
12    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
14    pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
16    pub created_by: ::std::option::Option<::std::string::String>,
18    pub last_modified_by: ::std::option::Option<::std::string::String>,
20    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
22    pub resource_arn: ::std::option::Option<::std::string::String>,
24    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26    _request_id: Option<String>,
27}
28impl DescribeRulesetOutput {
29    pub fn name(&self) -> &str {
31        use std::ops::Deref;
32        self.name.deref()
33    }
34    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    pub fn target_arn(&self) -> ::std::option::Option<&str> {
40        self.target_arn.as_deref()
41    }
42    pub fn rules(&self) -> &[crate::types::Rule] {
46        self.rules.as_deref().unwrap_or_default()
47    }
48    pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
50        self.create_date.as_ref()
51    }
52    pub fn created_by(&self) -> ::std::option::Option<&str> {
54        self.created_by.as_deref()
55    }
56    pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
58        self.last_modified_by.as_deref()
59    }
60    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
62        self.last_modified_date.as_ref()
63    }
64    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
66        self.resource_arn.as_deref()
67    }
68    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    pub fn builder() -> crate::operation::describe_ruleset::builders::DescribeRulesetOutputBuilder {
81        crate::operation::describe_ruleset::builders::DescribeRulesetOutputBuilder::default()
82    }
83}
84
85#[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    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    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.name = input;
111        self
112    }
113    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
115        &self.name
116    }
117    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    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.description = input;
125        self
126    }
127    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
129        &self.description
130    }
131    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    pub fn set_target_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.target_arn = input;
139        self
140    }
141    pub fn get_target_arn(&self) -> &::std::option::Option<::std::string::String> {
143        &self.target_arn
144    }
145    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    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    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
163        &self.rules
164    }
165    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    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    pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177        &self.create_date
178    }
179    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    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.created_by = input;
187        self
188    }
189    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
191        &self.created_by
192    }
193    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    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    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
205        &self.last_modified_by
206    }
207    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    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    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
219        &self.last_modified_date
220    }
221    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    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.resource_arn = input;
229        self
230    }
231    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
233        &self.resource_arn
234    }
235    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    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    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    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}