aws_sdk_resiliencehub/operation/create_app/_create_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)]
5pub struct CreateAppInput {
6 /// <p>Name of the application.</p>
7 pub name: ::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>Tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key/value pair.</p>
13 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14 /// <p>Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.</p>
15 pub client_token: ::std::option::Option<::std::string::String>,
16 /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
17 pub assessment_schedule: ::std::option::Option<crate::types::AppAssessmentScheduleType>,
18 /// <p>Defines the roles and credentials that Resilience Hub would use while creating the application, importing its resources, and running an assessment.</p>
19 pub permission_model: ::std::option::Option<crate::types::PermissionModel>,
20 /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports only <b>Drift detected</b> and <b>Scheduled assessment failure</b> events notification.</p>
21 pub event_subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>>,
22 /// <p>Amazon Resource Name (ARN) of Resource Groups group that is integrated with an AppRegistry application. 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 aws_application_arn: ::std::option::Option<::std::string::String>,
24}
25impl CreateAppInput {
26 /// <p>Name of the application.</p>
27 pub fn name(&self) -> ::std::option::Option<&str> {
28 self.name.as_deref()
29 }
30 /// <p>The optional description for an app.</p>
31 pub fn description(&self) -> ::std::option::Option<&str> {
32 self.description.as_deref()
33 }
34 /// <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>
35 pub fn policy_arn(&self) -> ::std::option::Option<&str> {
36 self.policy_arn.as_deref()
37 }
38 /// <p>Tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key/value pair.</p>
39 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40 self.tags.as_ref()
41 }
42 /// <p>Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.</p>
43 pub fn client_token(&self) -> ::std::option::Option<&str> {
44 self.client_token.as_deref()
45 }
46 /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
47 pub fn assessment_schedule(&self) -> ::std::option::Option<&crate::types::AppAssessmentScheduleType> {
48 self.assessment_schedule.as_ref()
49 }
50 /// <p>Defines the roles and credentials that Resilience Hub would use while creating the application, importing its resources, and running an assessment.</p>
51 pub fn permission_model(&self) -> ::std::option::Option<&crate::types::PermissionModel> {
52 self.permission_model.as_ref()
53 }
54 /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports only <b>Drift detected</b> and <b>Scheduled assessment failure</b> events notification.</p>
55 ///
56 /// 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()`.
57 pub fn event_subscriptions(&self) -> &[crate::types::EventSubscription] {
58 self.event_subscriptions.as_deref().unwrap_or_default()
59 }
60 /// <p>Amazon Resource Name (ARN) of Resource Groups group that is integrated with an AppRegistry application. 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>
61 pub fn aws_application_arn(&self) -> ::std::option::Option<&str> {
62 self.aws_application_arn.as_deref()
63 }
64}
65impl ::std::fmt::Debug for CreateAppInput {
66 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
67 let mut formatter = f.debug_struct("CreateAppInput");
68 formatter.field("name", &self.name);
69 formatter.field("description", &self.description);
70 formatter.field("policy_arn", &self.policy_arn);
71 formatter.field("tags", &"*** Sensitive Data Redacted ***");
72 formatter.field("client_token", &self.client_token);
73 formatter.field("assessment_schedule", &self.assessment_schedule);
74 formatter.field("permission_model", &self.permission_model);
75 formatter.field("event_subscriptions", &self.event_subscriptions);
76 formatter.field("aws_application_arn", &self.aws_application_arn);
77 formatter.finish()
78 }
79}
80impl CreateAppInput {
81 /// Creates a new builder-style object to manufacture [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
82 pub fn builder() -> crate::operation::create_app::builders::CreateAppInputBuilder {
83 crate::operation::create_app::builders::CreateAppInputBuilder::default()
84 }
85}
86
87/// A builder for [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
88#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
89#[non_exhaustive]
90pub struct CreateAppInputBuilder {
91 pub(crate) name: ::std::option::Option<::std::string::String>,
92 pub(crate) description: ::std::option::Option<::std::string::String>,
93 pub(crate) policy_arn: ::std::option::Option<::std::string::String>,
94 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
95 pub(crate) client_token: ::std::option::Option<::std::string::String>,
96 pub(crate) assessment_schedule: ::std::option::Option<crate::types::AppAssessmentScheduleType>,
97 pub(crate) permission_model: ::std::option::Option<crate::types::PermissionModel>,
98 pub(crate) event_subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>>,
99 pub(crate) aws_application_arn: ::std::option::Option<::std::string::String>,
100}
101impl CreateAppInputBuilder {
102 /// <p>Name of the application.</p>
103 /// This field is required.
104 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.name = ::std::option::Option::Some(input.into());
106 self
107 }
108 /// <p>Name of the application.</p>
109 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.name = input;
111 self
112 }
113 /// <p>Name of the application.</p>
114 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
115 &self.name
116 }
117 /// <p>The optional description for an app.</p>
118 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.description = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>The optional description for an app.</p>
123 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.description = input;
125 self
126 }
127 /// <p>The optional description for an app.</p>
128 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
129 &self.description
130 }
131 /// <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>
132 pub fn policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.policy_arn = ::std::option::Option::Some(input.into());
134 self
135 }
136 /// <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>
137 pub fn set_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.policy_arn = input;
139 self
140 }
141 /// <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>
142 pub fn get_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
143 &self.policy_arn
144 }
145 /// Adds a key-value pair to `tags`.
146 ///
147 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
148 ///
149 /// <p>Tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key/value pair.</p>
150 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
151 let mut hash_map = self.tags.unwrap_or_default();
152 hash_map.insert(k.into(), v.into());
153 self.tags = ::std::option::Option::Some(hash_map);
154 self
155 }
156 /// <p>Tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key/value pair.</p>
157 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
158 self.tags = input;
159 self
160 }
161 /// <p>Tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key/value pair.</p>
162 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
163 &self.tags
164 }
165 /// <p>Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.</p>
166 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.client_token = ::std::option::Option::Some(input.into());
168 self
169 }
170 /// <p>Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.</p>
171 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.client_token = input;
173 self
174 }
175 /// <p>Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests.</p>
176 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
177 &self.client_token
178 }
179 /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
180 pub fn assessment_schedule(mut self, input: crate::types::AppAssessmentScheduleType) -> Self {
181 self.assessment_schedule = ::std::option::Option::Some(input);
182 self
183 }
184 /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
185 pub fn set_assessment_schedule(mut self, input: ::std::option::Option<crate::types::AppAssessmentScheduleType>) -> Self {
186 self.assessment_schedule = input;
187 self
188 }
189 /// <p>Assessment execution schedule with 'Daily' or 'Disabled' values.</p>
190 pub fn get_assessment_schedule(&self) -> &::std::option::Option<crate::types::AppAssessmentScheduleType> {
191 &self.assessment_schedule
192 }
193 /// <p>Defines the roles and credentials that Resilience Hub would use while creating the application, importing its resources, and running an assessment.</p>
194 pub fn permission_model(mut self, input: crate::types::PermissionModel) -> Self {
195 self.permission_model = ::std::option::Option::Some(input);
196 self
197 }
198 /// <p>Defines the roles and credentials that Resilience Hub would use while creating the application, importing its resources, and running an assessment.</p>
199 pub fn set_permission_model(mut self, input: ::std::option::Option<crate::types::PermissionModel>) -> Self {
200 self.permission_model = input;
201 self
202 }
203 /// <p>Defines the roles and credentials that Resilience Hub would use while creating the application, importing its resources, and running an assessment.</p>
204 pub fn get_permission_model(&self) -> &::std::option::Option<crate::types::PermissionModel> {
205 &self.permission_model
206 }
207 /// Appends an item to `event_subscriptions`.
208 ///
209 /// To override the contents of this collection use [`set_event_subscriptions`](Self::set_event_subscriptions).
210 ///
211 /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports only <b>Drift detected</b> and <b>Scheduled assessment failure</b> events notification.</p>
212 pub fn event_subscriptions(mut self, input: crate::types::EventSubscription) -> Self {
213 let mut v = self.event_subscriptions.unwrap_or_default();
214 v.push(input);
215 self.event_subscriptions = ::std::option::Option::Some(v);
216 self
217 }
218 /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports only <b>Drift detected</b> and <b>Scheduled assessment failure</b> events notification.</p>
219 pub fn set_event_subscriptions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>>) -> Self {
220 self.event_subscriptions = input;
221 self
222 }
223 /// <p>The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports only <b>Drift detected</b> and <b>Scheduled assessment failure</b> events notification.</p>
224 pub fn get_event_subscriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EventSubscription>> {
225 &self.event_subscriptions
226 }
227 /// <p>Amazon Resource Name (ARN) of Resource Groups group that is integrated with an AppRegistry application. 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>
228 pub fn aws_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229 self.aws_application_arn = ::std::option::Option::Some(input.into());
230 self
231 }
232 /// <p>Amazon Resource Name (ARN) of Resource Groups group that is integrated with an AppRegistry application. 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>
233 pub fn set_aws_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234 self.aws_application_arn = input;
235 self
236 }
237 /// <p>Amazon Resource Name (ARN) of Resource Groups group that is integrated with an AppRegistry application. 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>
238 pub fn get_aws_application_arn(&self) -> &::std::option::Option<::std::string::String> {
239 &self.aws_application_arn
240 }
241 /// Consumes the builder and constructs a [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
242 pub fn build(self) -> ::std::result::Result<crate::operation::create_app::CreateAppInput, ::aws_smithy_types::error::operation::BuildError> {
243 ::std::result::Result::Ok(crate::operation::create_app::CreateAppInput {
244 name: self.name,
245 description: self.description,
246 policy_arn: self.policy_arn,
247 tags: self.tags,
248 client_token: self.client_token,
249 assessment_schedule: self.assessment_schedule,
250 permission_model: self.permission_model,
251 event_subscriptions: self.event_subscriptions,
252 aws_application_arn: self.aws_application_arn,
253 })
254 }
255}
256impl ::std::fmt::Debug for CreateAppInputBuilder {
257 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
258 let mut formatter = f.debug_struct("CreateAppInputBuilder");
259 formatter.field("name", &self.name);
260 formatter.field("description", &self.description);
261 formatter.field("policy_arn", &self.policy_arn);
262 formatter.field("tags", &"*** Sensitive Data Redacted ***");
263 formatter.field("client_token", &self.client_token);
264 formatter.field("assessment_schedule", &self.assessment_schedule);
265 formatter.field("permission_model", &self.permission_model);
266 formatter.field("event_subscriptions", &self.event_subscriptions);
267 formatter.field("aws_application_arn", &self.aws_application_arn);
268 formatter.finish()
269 }
270}