aws_sdk_elasticloadbalancingv2/operation/modify_rule/
_modify_rule_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 ModifyRuleInput {
6    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
7    pub rule_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The conditions.</p>
9    pub conditions: ::std::option::Option<::std::vec::Vec<crate::types::RuleCondition>>,
10    /// <p>The actions.</p>
11    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::Action>>,
12}
13impl ModifyRuleInput {
14    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
15    pub fn rule_arn(&self) -> ::std::option::Option<&str> {
16        self.rule_arn.as_deref()
17    }
18    /// <p>The conditions.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.conditions.is_none()`.
21    pub fn conditions(&self) -> &[crate::types::RuleCondition] {
22        self.conditions.as_deref().unwrap_or_default()
23    }
24    /// <p>The actions.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.actions.is_none()`.
27    pub fn actions(&self) -> &[crate::types::Action] {
28        self.actions.as_deref().unwrap_or_default()
29    }
30}
31impl ModifyRuleInput {
32    /// Creates a new builder-style object to manufacture [`ModifyRuleInput`](crate::operation::modify_rule::ModifyRuleInput).
33    pub fn builder() -> crate::operation::modify_rule::builders::ModifyRuleInputBuilder {
34        crate::operation::modify_rule::builders::ModifyRuleInputBuilder::default()
35    }
36}
37
38/// A builder for [`ModifyRuleInput`](crate::operation::modify_rule::ModifyRuleInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct ModifyRuleInputBuilder {
42    pub(crate) rule_arn: ::std::option::Option<::std::string::String>,
43    pub(crate) conditions: ::std::option::Option<::std::vec::Vec<crate::types::RuleCondition>>,
44    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::Action>>,
45}
46impl ModifyRuleInputBuilder {
47    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
48    /// This field is required.
49    pub fn rule_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.rule_arn = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
54    pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.rule_arn = input;
56        self
57    }
58    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
59    pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
60        &self.rule_arn
61    }
62    /// Appends an item to `conditions`.
63    ///
64    /// To override the contents of this collection use [`set_conditions`](Self::set_conditions).
65    ///
66    /// <p>The conditions.</p>
67    pub fn conditions(mut self, input: crate::types::RuleCondition) -> Self {
68        let mut v = self.conditions.unwrap_or_default();
69        v.push(input);
70        self.conditions = ::std::option::Option::Some(v);
71        self
72    }
73    /// <p>The conditions.</p>
74    pub fn set_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuleCondition>>) -> Self {
75        self.conditions = input;
76        self
77    }
78    /// <p>The conditions.</p>
79    pub fn get_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleCondition>> {
80        &self.conditions
81    }
82    /// Appends an item to `actions`.
83    ///
84    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
85    ///
86    /// <p>The actions.</p>
87    pub fn actions(mut self, input: crate::types::Action) -> Self {
88        let mut v = self.actions.unwrap_or_default();
89        v.push(input);
90        self.actions = ::std::option::Option::Some(v);
91        self
92    }
93    /// <p>The actions.</p>
94    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Action>>) -> Self {
95        self.actions = input;
96        self
97    }
98    /// <p>The actions.</p>
99    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Action>> {
100        &self.actions
101    }
102    /// Consumes the builder and constructs a [`ModifyRuleInput`](crate::operation::modify_rule::ModifyRuleInput).
103    pub fn build(self) -> ::std::result::Result<crate::operation::modify_rule::ModifyRuleInput, ::aws_smithy_types::error::operation::BuildError> {
104        ::std::result::Result::Ok(crate::operation::modify_rule::ModifyRuleInput {
105            rule_arn: self.rule_arn,
106            conditions: self.conditions,
107            actions: self.actions,
108        })
109    }
110}