aws_sdk_arcregionswitch/operation/update_plan/
_update_plan_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 UpdatePlanInput {
6    /// <p>The Amazon Resource Name (ARN) of the plan.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The updated description for the Region switch plan.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The updated workflows for the Region switch plan.</p>
11    pub workflows: ::std::option::Option<::std::vec::Vec<crate::types::Workflow>>,
12    /// <p>The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.</p>
13    pub execution_role: ::std::option::Option<::std::string::String>,
14    /// <p>The updated target recovery time objective (RTO) in minutes for the plan.</p>
15    pub recovery_time_objective_minutes: ::std::option::Option<i32>,
16    /// <p>The updated CloudWatch alarms associated with the plan.</p>
17    pub associated_alarms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>>,
18    /// <p>The updated conditions that can automatically trigger the execution of the plan.</p>
19    pub triggers: ::std::option::Option<::std::vec::Vec<crate::types::Trigger>>,
20}
21impl UpdatePlanInput {
22    /// <p>The Amazon Resource Name (ARN) of the plan.</p>
23    pub fn arn(&self) -> ::std::option::Option<&str> {
24        self.arn.as_deref()
25    }
26    /// <p>The updated description for the Region switch plan.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>The updated workflows for the Region switch plan.</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 `.workflows.is_none()`.
33    pub fn workflows(&self) -> &[crate::types::Workflow] {
34        self.workflows.as_deref().unwrap_or_default()
35    }
36    /// <p>The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.</p>
37    pub fn execution_role(&self) -> ::std::option::Option<&str> {
38        self.execution_role.as_deref()
39    }
40    /// <p>The updated target recovery time objective (RTO) in minutes for the plan.</p>
41    pub fn recovery_time_objective_minutes(&self) -> ::std::option::Option<i32> {
42        self.recovery_time_objective_minutes
43    }
44    /// <p>The updated CloudWatch alarms associated with the plan.</p>
45    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    /// <p>The updated conditions that can automatically trigger the execution of the plan.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.triggers.is_none()`.
51    pub fn triggers(&self) -> &[crate::types::Trigger] {
52        self.triggers.as_deref().unwrap_or_default()
53    }
54}
55impl UpdatePlanInput {
56    /// Creates a new builder-style object to manufacture [`UpdatePlanInput`](crate::operation::update_plan::UpdatePlanInput).
57    pub fn builder() -> crate::operation::update_plan::builders::UpdatePlanInputBuilder {
58        crate::operation::update_plan::builders::UpdatePlanInputBuilder::default()
59    }
60}
61
62/// A builder for [`UpdatePlanInput`](crate::operation::update_plan::UpdatePlanInput).
63#[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    /// <p>The Amazon Resource Name (ARN) of the plan.</p>
76    /// This field is required.
77    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    /// <p>The Amazon Resource Name (ARN) of the plan.</p>
82    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.arn = input;
84        self
85    }
86    /// <p>The Amazon Resource Name (ARN) of the plan.</p>
87    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
88        &self.arn
89    }
90    /// <p>The updated description for the Region switch plan.</p>
91    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    /// <p>The updated description for the Region switch plan.</p>
96    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.description = input;
98        self
99    }
100    /// <p>The updated description for the Region switch plan.</p>
101    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
102        &self.description
103    }
104    /// Appends an item to `workflows`.
105    ///
106    /// To override the contents of this collection use [`set_workflows`](Self::set_workflows).
107    ///
108    /// <p>The updated workflows for the Region switch plan.</p>
109    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    /// <p>The updated workflows for the Region switch plan.</p>
116    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    /// <p>The updated workflows for the Region switch plan.</p>
121    pub fn get_workflows(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Workflow>> {
122        &self.workflows
123    }
124    /// <p>The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.</p>
125    /// This field is required.
126    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    /// <p>The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.</p>
131    pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.execution_role = input;
133        self
134    }
135    /// <p>The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.</p>
136    pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
137        &self.execution_role
138    }
139    /// <p>The updated target recovery time objective (RTO) in minutes for the plan.</p>
140    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    /// <p>The updated target recovery time objective (RTO) in minutes for the plan.</p>
145    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    /// <p>The updated target recovery time objective (RTO) in minutes for the plan.</p>
150    pub fn get_recovery_time_objective_minutes(&self) -> &::std::option::Option<i32> {
151        &self.recovery_time_objective_minutes
152    }
153    /// Adds a key-value pair to `associated_alarms`.
154    ///
155    /// To override the contents of this collection use [`set_associated_alarms`](Self::set_associated_alarms).
156    ///
157    /// <p>The updated CloudWatch alarms associated with the plan.</p>
158    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    /// <p>The updated CloudWatch alarms associated with the plan.</p>
165    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    /// <p>The updated CloudWatch alarms associated with the plan.</p>
173    pub fn get_associated_alarms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssociatedAlarm>> {
174        &self.associated_alarms
175    }
176    /// Appends an item to `triggers`.
177    ///
178    /// To override the contents of this collection use [`set_triggers`](Self::set_triggers).
179    ///
180    /// <p>The updated conditions that can automatically trigger the execution of the plan.</p>
181    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    /// <p>The updated conditions that can automatically trigger the execution of the plan.</p>
188    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    /// <p>The updated conditions that can automatically trigger the execution of the plan.</p>
193    pub fn get_triggers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Trigger>> {
194        &self.triggers
195    }
196    /// Consumes the builder and constructs a [`UpdatePlanInput`](crate::operation::update_plan::UpdatePlanInput).
197    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}