aws_sdk_resiliencehub/operation/update_app/
_update_app_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 UpdateAppInput {
6    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
7    pub app_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The optional description for an app.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:resiliency-policy/<code>policy-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
11    pub policy_arn: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies if the resiliency policy ARN should be cleared.</p>
13    pub clear_resiliency_policy_arn: ::std::option::Option<bool>,
14    /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
15    pub assessment_schedule: ::std::option::Option<crate::types::AppAssessmentScheduleType>,
16    /// <p>Defines the roles and credentials that Resilience Hub would use while creating an application, importing its resources, and running an assessment.</p>
17    pub permission_model: ::std::option::Option<crate::types::PermissionModel>,
18    /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports notifications only for <b>Drift detected</b> and <b>Scheduled assessment failure</b> events.</p>
19    pub event_subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>>,
20}
21impl UpdateAppInput {
22    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
23    pub fn app_arn(&self) -> ::std::option::Option<&str> {
24        self.app_arn.as_deref()
25    }
26    /// <p>The optional description for an app.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:resiliency-policy/<code>policy-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
31    pub fn policy_arn(&self) -> ::std::option::Option<&str> {
32        self.policy_arn.as_deref()
33    }
34    /// <p>Specifies if the resiliency policy ARN should be cleared.</p>
35    pub fn clear_resiliency_policy_arn(&self) -> ::std::option::Option<bool> {
36        self.clear_resiliency_policy_arn
37    }
38    /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
39    pub fn assessment_schedule(&self) -> ::std::option::Option<&crate::types::AppAssessmentScheduleType> {
40        self.assessment_schedule.as_ref()
41    }
42    /// <p>Defines the roles and credentials that Resilience Hub would use while creating an application, importing its resources, and running an assessment.</p>
43    pub fn permission_model(&self) -> ::std::option::Option<&crate::types::PermissionModel> {
44        self.permission_model.as_ref()
45    }
46    /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports notifications only for <b>Drift detected</b> and <b>Scheduled assessment failure</b> events.</p>
47    ///
48    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.event_subscriptions.is_none()`.
49    pub fn event_subscriptions(&self) -> &[crate::types::EventSubscription] {
50        self.event_subscriptions.as_deref().unwrap_or_default()
51    }
52}
53impl UpdateAppInput {
54    /// Creates a new builder-style object to manufacture [`UpdateAppInput`](crate::operation::update_app::UpdateAppInput).
55    pub fn builder() -> crate::operation::update_app::builders::UpdateAppInputBuilder {
56        crate::operation::update_app::builders::UpdateAppInputBuilder::default()
57    }
58}
59
60/// A builder for [`UpdateAppInput`](crate::operation::update_app::UpdateAppInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct UpdateAppInputBuilder {
64    pub(crate) app_arn: ::std::option::Option<::std::string::String>,
65    pub(crate) description: ::std::option::Option<::std::string::String>,
66    pub(crate) policy_arn: ::std::option::Option<::std::string::String>,
67    pub(crate) clear_resiliency_policy_arn: ::std::option::Option<bool>,
68    pub(crate) assessment_schedule: ::std::option::Option<crate::types::AppAssessmentScheduleType>,
69    pub(crate) permission_model: ::std::option::Option<crate::types::PermissionModel>,
70    pub(crate) event_subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>>,
71}
72impl UpdateAppInputBuilder {
73    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
74    /// This field is required.
75    pub fn app_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.app_arn = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
80    pub fn set_app_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.app_arn = input;
82        self
83    }
84    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
85    pub fn get_app_arn(&self) -> &::std::option::Option<::std::string::String> {
86        &self.app_arn
87    }
88    /// <p>The optional description for an app.</p>
89    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.description = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The optional description for an app.</p>
94    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.description = input;
96        self
97    }
98    /// <p>The optional description for an app.</p>
99    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
100        &self.description
101    }
102    /// <p>Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:resiliency-policy/<code>policy-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
103    pub fn policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.policy_arn = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:resiliency-policy/<code>policy-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
108    pub fn set_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.policy_arn = input;
110        self
111    }
112    /// <p>Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:resiliency-policy/<code>policy-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
113    pub fn get_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
114        &self.policy_arn
115    }
116    /// <p>Specifies if the resiliency policy ARN should be cleared.</p>
117    pub fn clear_resiliency_policy_arn(mut self, input: bool) -> Self {
118        self.clear_resiliency_policy_arn = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>Specifies if the resiliency policy ARN should be cleared.</p>
122    pub fn set_clear_resiliency_policy_arn(mut self, input: ::std::option::Option<bool>) -> Self {
123        self.clear_resiliency_policy_arn = input;
124        self
125    }
126    /// <p>Specifies if the resiliency policy ARN should be cleared.</p>
127    pub fn get_clear_resiliency_policy_arn(&self) -> &::std::option::Option<bool> {
128        &self.clear_resiliency_policy_arn
129    }
130    /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
131    pub fn assessment_schedule(mut self, input: crate::types::AppAssessmentScheduleType) -> Self {
132        self.assessment_schedule = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
136    pub fn set_assessment_schedule(mut self, input: ::std::option::Option<crate::types::AppAssessmentScheduleType>) -> Self {
137        self.assessment_schedule = input;
138        self
139    }
140    /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
141    pub fn get_assessment_schedule(&self) -> &::std::option::Option<crate::types::AppAssessmentScheduleType> {
142        &self.assessment_schedule
143    }
144    /// <p>Defines the roles and credentials that Resilience Hub would use while creating an application, importing its resources, and running an assessment.</p>
145    pub fn permission_model(mut self, input: crate::types::PermissionModel) -> Self {
146        self.permission_model = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>Defines the roles and credentials that Resilience Hub would use while creating an application, importing its resources, and running an assessment.</p>
150    pub fn set_permission_model(mut self, input: ::std::option::Option<crate::types::PermissionModel>) -> Self {
151        self.permission_model = input;
152        self
153    }
154    /// <p>Defines the roles and credentials that Resilience Hub would use while creating an application, importing its resources, and running an assessment.</p>
155    pub fn get_permission_model(&self) -> &::std::option::Option<crate::types::PermissionModel> {
156        &self.permission_model
157    }
158    /// Appends an item to `event_subscriptions`.
159    ///
160    /// To override the contents of this collection use [`set_event_subscriptions`](Self::set_event_subscriptions).
161    ///
162    /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports notifications only for <b>Drift detected</b> and <b>Scheduled assessment failure</b> events.</p>
163    pub fn event_subscriptions(mut self, input: crate::types::EventSubscription) -> Self {
164        let mut v = self.event_subscriptions.unwrap_or_default();
165        v.push(input);
166        self.event_subscriptions = ::std::option::Option::Some(v);
167        self
168    }
169    /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports notifications only for <b>Drift detected</b> and <b>Scheduled assessment failure</b> events.</p>
170    pub fn set_event_subscriptions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>>) -> Self {
171        self.event_subscriptions = input;
172        self
173    }
174    /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports notifications only for <b>Drift detected</b> and <b>Scheduled assessment failure</b> events.</p>
175    pub fn get_event_subscriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>> {
176        &self.event_subscriptions
177    }
178    /// Consumes the builder and constructs a [`UpdateAppInput`](crate::operation::update_app::UpdateAppInput).
179    pub fn build(self) -> ::std::result::Result<crate::operation::update_app::UpdateAppInput, ::aws_smithy_types::error::operation::BuildError> {
180        ::std::result::Result::Ok(crate::operation::update_app::UpdateAppInput {
181            app_arn: self.app_arn,
182            description: self.description,
183            policy_arn: self.policy_arn,
184            clear_resiliency_policy_arn: self.clear_resiliency_policy_arn,
185            assessment_schedule: self.assessment_schedule,
186            permission_model: self.permission_model,
187            event_subscriptions: self.event_subscriptions,
188        })
189    }
190}