aws_sdk_databrew/operation/create_ruleset/
_create_ruleset_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 CreateRulesetInput {
6    /// <p>The name of the ruleset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
7    pub name: ::std::option::Option<::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>Metadata tags to apply to the ruleset.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl CreateRulesetInput {
18    /// <p>The name of the ruleset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
19    pub fn name(&self) -> ::std::option::Option<&str> {
20        self.name.as_deref()
21    }
22    /// <p>The description of the ruleset.</p>
23    pub fn description(&self) -> ::std::option::Option<&str> {
24        self.description.as_deref()
25    }
26    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
27    pub fn target_arn(&self) -> ::std::option::Option<&str> {
28        self.target_arn.as_deref()
29    }
30    /// <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>
31    ///
32    /// 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()`.
33    pub fn rules(&self) -> &[crate::types::Rule] {
34        self.rules.as_deref().unwrap_or_default()
35    }
36    /// <p>Metadata tags to apply to the ruleset.</p>
37    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38        self.tags.as_ref()
39    }
40}
41impl CreateRulesetInput {
42    /// Creates a new builder-style object to manufacture [`CreateRulesetInput`](crate::operation::create_ruleset::CreateRulesetInput).
43    pub fn builder() -> crate::operation::create_ruleset::builders::CreateRulesetInputBuilder {
44        crate::operation::create_ruleset::builders::CreateRulesetInputBuilder::default()
45    }
46}
47
48/// A builder for [`CreateRulesetInput`](crate::operation::create_ruleset::CreateRulesetInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateRulesetInputBuilder {
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) description: ::std::option::Option<::std::string::String>,
54    pub(crate) target_arn: ::std::option::Option<::std::string::String>,
55    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
56    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57}
58impl CreateRulesetInputBuilder {
59    /// <p>The name of the ruleset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
60    /// This field is required.
61    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the ruleset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
66    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.name = input;
68        self
69    }
70    /// <p>The name of the ruleset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
71    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.name
73    }
74    /// <p>The description of the ruleset.</p>
75    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.description = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The description of the ruleset.</p>
80    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.description = input;
82        self
83    }
84    /// <p>The description of the ruleset.</p>
85    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
86        &self.description
87    }
88    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
89    /// This field is required.
90    pub fn target_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.target_arn = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
95    pub fn set_target_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.target_arn = input;
97        self
98    }
99    /// <p>The Amazon Resource Name (ARN) of a resource (dataset) that the ruleset is associated with.</p>
100    pub fn get_target_arn(&self) -> &::std::option::Option<::std::string::String> {
101        &self.target_arn
102    }
103    /// Appends an item to `rules`.
104    ///
105    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
106    ///
107    /// <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>
108    pub fn rules(mut self, input: crate::types::Rule) -> Self {
109        let mut v = self.rules.unwrap_or_default();
110        v.push(input);
111        self.rules = ::std::option::Option::Some(v);
112        self
113    }
114    /// <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>
115    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
116        self.rules = input;
117        self
118    }
119    /// <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>
120    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
121        &self.rules
122    }
123    /// Adds a key-value pair to `tags`.
124    ///
125    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
126    ///
127    /// <p>Metadata tags to apply to the ruleset.</p>
128    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut hash_map = self.tags.unwrap_or_default();
130        hash_map.insert(k.into(), v.into());
131        self.tags = ::std::option::Option::Some(hash_map);
132        self
133    }
134    /// <p>Metadata tags to apply to the ruleset.</p>
135    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
136        self.tags = input;
137        self
138    }
139    /// <p>Metadata tags to apply to the ruleset.</p>
140    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
141        &self.tags
142    }
143    /// Consumes the builder and constructs a [`CreateRulesetInput`](crate::operation::create_ruleset::CreateRulesetInput).
144    pub fn build(
145        self,
146    ) -> ::std::result::Result<crate::operation::create_ruleset::CreateRulesetInput, ::aws_smithy_types::error::operation::BuildError> {
147        ::std::result::Result::Ok(crate::operation::create_ruleset::CreateRulesetInput {
148            name: self.name,
149            description: self.description,
150            target_arn: self.target_arn,
151            rules: self.rules,
152            tags: self.tags,
153        })
154    }
155}