aws_sdk_elasticloadbalancingv2/operation/modify_rule/
_modify_rule_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyRuleInput {
6 pub rule_arn: ::std::option::Option<::std::string::String>,
8 pub conditions: ::std::option::Option<::std::vec::Vec<crate::types::RuleCondition>>,
10 pub actions: ::std::option::Option<::std::vec::Vec<crate::types::Action>>,
12}
13impl ModifyRuleInput {
14 pub fn rule_arn(&self) -> ::std::option::Option<&str> {
16 self.rule_arn.as_deref()
17 }
18 pub fn conditions(&self) -> &[crate::types::RuleCondition] {
22 self.conditions.as_deref().unwrap_or_default()
23 }
24 pub fn actions(&self) -> &[crate::types::Action] {
28 self.actions.as_deref().unwrap_or_default()
29 }
30}
31impl ModifyRuleInput {
32 pub fn builder() -> crate::operation::modify_rule::builders::ModifyRuleInputBuilder {
34 crate::operation::modify_rule::builders::ModifyRuleInputBuilder::default()
35 }
36}
37
38#[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 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 pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55 self.rule_arn = input;
56 self
57 }
58 pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
60 &self.rule_arn
61 }
62 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 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 pub fn get_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleCondition>> {
80 &self.conditions
81 }
82 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 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 pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Action>> {
100 &self.actions
101 }
102 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}