aws_sdk_arcregionswitch/operation/update_plan/
_update_plan_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdatePlanInput {
6 pub arn: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub workflows: ::std::option::Option<::std::vec::Vec<crate::types::Workflow>>,
12 pub execution_role: ::std::option::Option<::std::string::String>,
14 pub recovery_time_objective_minutes: ::std::option::Option<i32>,
16 pub associated_alarms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>>,
18 pub triggers: ::std::option::Option<::std::vec::Vec<crate::types::Trigger>>,
20}
21impl UpdatePlanInput {
22 pub fn arn(&self) -> ::std::option::Option<&str> {
24 self.arn.as_deref()
25 }
26 pub fn description(&self) -> ::std::option::Option<&str> {
28 self.description.as_deref()
29 }
30 pub fn workflows(&self) -> &[crate::types::Workflow] {
34 self.workflows.as_deref().unwrap_or_default()
35 }
36 pub fn execution_role(&self) -> ::std::option::Option<&str> {
38 self.execution_role.as_deref()
39 }
40 pub fn recovery_time_objective_minutes(&self) -> ::std::option::Option<i32> {
42 self.recovery_time_objective_minutes
43 }
44 pub fn associated_alarms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>> {
46 self.associated_alarms.as_ref()
47 }
48 pub fn triggers(&self) -> &[crate::types::Trigger] {
52 self.triggers.as_deref().unwrap_or_default()
53 }
54}
55impl UpdatePlanInput {
56 pub fn builder() -> crate::operation::update_plan::builders::UpdatePlanInputBuilder {
58 crate::operation::update_plan::builders::UpdatePlanInputBuilder::default()
59 }
60}
61
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct UpdatePlanInputBuilder {
66 pub(crate) arn: ::std::option::Option<::std::string::String>,
67 pub(crate) description: ::std::option::Option<::std::string::String>,
68 pub(crate) workflows: ::std::option::Option<::std::vec::Vec<crate::types::Workflow>>,
69 pub(crate) execution_role: ::std::option::Option<::std::string::String>,
70 pub(crate) recovery_time_objective_minutes: ::std::option::Option<i32>,
71 pub(crate) associated_alarms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>>,
72 pub(crate) triggers: ::std::option::Option<::std::vec::Vec<crate::types::Trigger>>,
73}
74impl UpdatePlanInputBuilder {
75 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78 self.arn = ::std::option::Option::Some(input.into());
79 self
80 }
81 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83 self.arn = input;
84 self
85 }
86 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
88 &self.arn
89 }
90 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92 self.description = ::std::option::Option::Some(input.into());
93 self
94 }
95 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97 self.description = input;
98 self
99 }
100 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
102 &self.description
103 }
104 pub fn workflows(mut self, input: crate::types::Workflow) -> Self {
110 let mut v = self.workflows.unwrap_or_default();
111 v.push(input);
112 self.workflows = ::std::option::Option::Some(v);
113 self
114 }
115 pub fn set_workflows(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Workflow>>) -> Self {
117 self.workflows = input;
118 self
119 }
120 pub fn get_workflows(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Workflow>> {
122 &self.workflows
123 }
124 pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.execution_role = ::std::option::Option::Some(input.into());
128 self
129 }
130 pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.execution_role = input;
133 self
134 }
135 pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
137 &self.execution_role
138 }
139 pub fn recovery_time_objective_minutes(mut self, input: i32) -> Self {
141 self.recovery_time_objective_minutes = ::std::option::Option::Some(input);
142 self
143 }
144 pub fn set_recovery_time_objective_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
146 self.recovery_time_objective_minutes = input;
147 self
148 }
149 pub fn get_recovery_time_objective_minutes(&self) -> &::std::option::Option<i32> {
151 &self.recovery_time_objective_minutes
152 }
153 pub fn associated_alarms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssociatedAlarm) -> Self {
159 let mut hash_map = self.associated_alarms.unwrap_or_default();
160 hash_map.insert(k.into(), v);
161 self.associated_alarms = ::std::option::Option::Some(hash_map);
162 self
163 }
164 pub fn set_associated_alarms(
166 mut self,
167 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>>,
168 ) -> Self {
169 self.associated_alarms = input;
170 self
171 }
172 pub fn get_associated_alarms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>> {
174 &self.associated_alarms
175 }
176 pub fn triggers(mut self, input: crate::types::Trigger) -> Self {
182 let mut v = self.triggers.unwrap_or_default();
183 v.push(input);
184 self.triggers = ::std::option::Option::Some(v);
185 self
186 }
187 pub fn set_triggers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Trigger>>) -> Self {
189 self.triggers = input;
190 self
191 }
192 pub fn get_triggers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Trigger>> {
194 &self.triggers
195 }
196 pub fn build(self) -> ::std::result::Result<crate::operation::update_plan::UpdatePlanInput, ::aws_smithy_types::error::operation::BuildError> {
198 ::std::result::Result::Ok(crate::operation::update_plan::UpdatePlanInput {
199 arn: self.arn,
200 description: self.description,
201 workflows: self.workflows,
202 execution_role: self.execution_role,
203 recovery_time_objective_minutes: self.recovery_time_objective_minutes,
204 associated_alarms: self.associated_alarms,
205 triggers: self.triggers,
206 })
207 }
208}