aws_sdk_databrew/operation/update_ruleset/
_update_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 UpdateRulesetInput {
6    /// <p>The name of the ruleset to be updated.</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>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>
11    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
12}
13impl UpdateRulesetInput {
14    /// <p>The name of the ruleset to be updated.</p>
15    pub fn name(&self) -> ::std::option::Option<&str> {
16        self.name.as_deref()
17    }
18    /// <p>The description of the ruleset.</p>
19    pub fn description(&self) -> ::std::option::Option<&str> {
20        self.description.as_deref()
21    }
22    /// <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>
23    ///
24    /// 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()`.
25    pub fn rules(&self) -> &[crate::types::Rule] {
26        self.rules.as_deref().unwrap_or_default()
27    }
28}
29impl UpdateRulesetInput {
30    /// Creates a new builder-style object to manufacture [`UpdateRulesetInput`](crate::operation::update_ruleset::UpdateRulesetInput).
31    pub fn builder() -> crate::operation::update_ruleset::builders::UpdateRulesetInputBuilder {
32        crate::operation::update_ruleset::builders::UpdateRulesetInputBuilder::default()
33    }
34}
35
36/// A builder for [`UpdateRulesetInput`](crate::operation::update_ruleset::UpdateRulesetInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateRulesetInputBuilder {
40    pub(crate) name: ::std::option::Option<::std::string::String>,
41    pub(crate) description: ::std::option::Option<::std::string::String>,
42    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
43}
44impl UpdateRulesetInputBuilder {
45    /// <p>The name of the ruleset to be updated.</p>
46    /// This field is required.
47    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The name of the ruleset to be updated.</p>
52    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.name = input;
54        self
55    }
56    /// <p>The name of the ruleset to be updated.</p>
57    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.name
59    }
60    /// <p>The description of the ruleset.</p>
61    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.description = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The description of the ruleset.</p>
66    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.description = input;
68        self
69    }
70    /// <p>The description of the ruleset.</p>
71    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
72        &self.description
73    }
74    /// Appends an item to `rules`.
75    ///
76    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
77    ///
78    /// <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>
79    pub fn rules(mut self, input: crate::types::Rule) -> Self {
80        let mut v = self.rules.unwrap_or_default();
81        v.push(input);
82        self.rules = ::std::option::Option::Some(v);
83        self
84    }
85    /// <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>
86    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
87        self.rules = input;
88        self
89    }
90    /// <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>
91    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
92        &self.rules
93    }
94    /// Consumes the builder and constructs a [`UpdateRulesetInput`](crate::operation::update_ruleset::UpdateRulesetInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<crate::operation::update_ruleset::UpdateRulesetInput, ::aws_smithy_types::error::operation::BuildError> {
98        ::std::result::Result::Ok(crate::operation::update_ruleset::UpdateRulesetInput {
99            name: self.name,
100            description: self.description,
101            rules: self.rules,
102        })
103    }
104}