aws_sdk_applicationinsights/operation/create_application/_create_application_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 CreateApplicationInput {
6 /// <p>The name of the resource group.</p>
7 pub resource_group_name: ::std::option::Option<::std::string::String>,
8 /// <p>When set to <code>true</code>, creates opsItems for any problems detected on an application.</p>
9 pub ops_center_enabled: ::std::option::Option<bool>,
10 /// <p>Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others.</p>
11 pub cwe_monitor_enabled: ::std::option::Option<bool>,
12 /// <p>The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.</p>
13 pub ops_item_sns_topic_arn: ::std::option::Option<::std::string::String>,
14 /// <p>The SNS notification topic ARN.</p>
15 pub sns_notification_arn: ::std::option::Option<::std::string::String>,
16 /// <p>List of tags to add to the application. tag key (<code>Key</code>) and an associated tag value (<code>Value</code>). The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
17 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18 /// <p>Indicates whether Application Insights automatically configures unmonitored resources in the resource group.</p>
19 pub auto_config_enabled: ::std::option::Option<bool>,
20 /// <p>Configures all of the resources in the resource group by applying the recommended configurations.</p>
21 pub auto_create: ::std::option::Option<bool>,
22 /// <p>Application Insights can create applications based on a resource group or on an account. To create an account-based application using all of the resources in the account, set this parameter to <code>ACCOUNT_BASED</code>.</p>
23 pub grouping_type: ::std::option::Option<crate::types::GroupingType>,
24 /// <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>
25 pub attach_missing_permission: ::std::option::Option<bool>,
26}
27impl CreateApplicationInput {
28 /// <p>The name of the resource group.</p>
29 pub fn resource_group_name(&self) -> ::std::option::Option<&str> {
30 self.resource_group_name.as_deref()
31 }
32 /// <p>When set to <code>true</code>, creates opsItems for any problems detected on an application.</p>
33 pub fn ops_center_enabled(&self) -> ::std::option::Option<bool> {
34 self.ops_center_enabled
35 }
36 /// <p>Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others.</p>
37 pub fn cwe_monitor_enabled(&self) -> ::std::option::Option<bool> {
38 self.cwe_monitor_enabled
39 }
40 /// <p>The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.</p>
41 pub fn ops_item_sns_topic_arn(&self) -> ::std::option::Option<&str> {
42 self.ops_item_sns_topic_arn.as_deref()
43 }
44 /// <p>The SNS notification topic ARN.</p>
45 pub fn sns_notification_arn(&self) -> ::std::option::Option<&str> {
46 self.sns_notification_arn.as_deref()
47 }
48 /// <p>List of tags to add to the application. tag key (<code>Key</code>) and an associated tag value (<code>Value</code>). The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</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 `.tags.is_none()`.
51 pub fn tags(&self) -> &[crate::types::Tag] {
52 self.tags.as_deref().unwrap_or_default()
53 }
54 /// <p>Indicates whether Application Insights automatically configures unmonitored resources in the resource group.</p>
55 pub fn auto_config_enabled(&self) -> ::std::option::Option<bool> {
56 self.auto_config_enabled
57 }
58 /// <p>Configures all of the resources in the resource group by applying the recommended configurations.</p>
59 pub fn auto_create(&self) -> ::std::option::Option<bool> {
60 self.auto_create
61 }
62 /// <p>Application Insights can create applications based on a resource group or on an account. To create an account-based application using all of the resources in the account, set this parameter to <code>ACCOUNT_BASED</code>.</p>
63 pub fn grouping_type(&self) -> ::std::option::Option<&crate::types::GroupingType> {
64 self.grouping_type.as_ref()
65 }
66 /// <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>
67 pub fn attach_missing_permission(&self) -> ::std::option::Option<bool> {
68 self.attach_missing_permission
69 }
70}
71impl CreateApplicationInput {
72 /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
73 pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
74 crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
75 }
76}
77
78/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct CreateApplicationInputBuilder {
82 pub(crate) resource_group_name: ::std::option::Option<::std::string::String>,
83 pub(crate) ops_center_enabled: ::std::option::Option<bool>,
84 pub(crate) cwe_monitor_enabled: ::std::option::Option<bool>,
85 pub(crate) ops_item_sns_topic_arn: ::std::option::Option<::std::string::String>,
86 pub(crate) sns_notification_arn: ::std::option::Option<::std::string::String>,
87 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
88 pub(crate) auto_config_enabled: ::std::option::Option<bool>,
89 pub(crate) auto_create: ::std::option::Option<bool>,
90 pub(crate) grouping_type: ::std::option::Option<crate::types::GroupingType>,
91 pub(crate) attach_missing_permission: ::std::option::Option<bool>,
92}
93impl CreateApplicationInputBuilder {
94 /// <p>The name of the resource group.</p>
95 pub fn resource_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.resource_group_name = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The name of the resource group.</p>
100 pub fn set_resource_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.resource_group_name = input;
102 self
103 }
104 /// <p>The name of the resource group.</p>
105 pub fn get_resource_group_name(&self) -> &::std::option::Option<::std::string::String> {
106 &self.resource_group_name
107 }
108 /// <p>When set to <code>true</code>, creates opsItems for any problems detected on an application.</p>
109 pub fn ops_center_enabled(mut self, input: bool) -> Self {
110 self.ops_center_enabled = ::std::option::Option::Some(input);
111 self
112 }
113 /// <p>When set to <code>true</code>, creates opsItems for any problems detected on an application.</p>
114 pub fn set_ops_center_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
115 self.ops_center_enabled = input;
116 self
117 }
118 /// <p>When set to <code>true</code>, creates opsItems for any problems detected on an application.</p>
119 pub fn get_ops_center_enabled(&self) -> &::std::option::Option<bool> {
120 &self.ops_center_enabled
121 }
122 /// <p>Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others.</p>
123 pub fn cwe_monitor_enabled(mut self, input: bool) -> Self {
124 self.cwe_monitor_enabled = ::std::option::Option::Some(input);
125 self
126 }
127 /// <p>Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others.</p>
128 pub fn set_cwe_monitor_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
129 self.cwe_monitor_enabled = input;
130 self
131 }
132 /// <p>Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others.</p>
133 pub fn get_cwe_monitor_enabled(&self) -> &::std::option::Option<bool> {
134 &self.cwe_monitor_enabled
135 }
136 /// <p>The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.</p>
137 pub fn ops_item_sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.ops_item_sns_topic_arn = ::std::option::Option::Some(input.into());
139 self
140 }
141 /// <p>The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.</p>
142 pub fn set_ops_item_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.ops_item_sns_topic_arn = input;
144 self
145 }
146 /// <p>The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.</p>
147 pub fn get_ops_item_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
148 &self.ops_item_sns_topic_arn
149 }
150 /// <p>The SNS notification topic ARN.</p>
151 pub fn sns_notification_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.sns_notification_arn = ::std::option::Option::Some(input.into());
153 self
154 }
155 /// <p>The SNS notification topic ARN.</p>
156 pub fn set_sns_notification_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.sns_notification_arn = input;
158 self
159 }
160 /// <p>The SNS notification topic ARN.</p>
161 pub fn get_sns_notification_arn(&self) -> &::std::option::Option<::std::string::String> {
162 &self.sns_notification_arn
163 }
164 /// Appends an item to `tags`.
165 ///
166 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
167 ///
168 /// <p>List of tags to add to the application. tag key (<code>Key</code>) and an associated tag value (<code>Value</code>). The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
169 pub fn tags(mut self, input: crate::types::Tag) -> Self {
170 let mut v = self.tags.unwrap_or_default();
171 v.push(input);
172 self.tags = ::std::option::Option::Some(v);
173 self
174 }
175 /// <p>List of tags to add to the application. tag key (<code>Key</code>) and an associated tag value (<code>Value</code>). The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
176 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
177 self.tags = input;
178 self
179 }
180 /// <p>List of tags to add to the application. tag key (<code>Key</code>) and an associated tag value (<code>Value</code>). The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
181 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
182 &self.tags
183 }
184 /// <p>Indicates whether Application Insights automatically configures unmonitored resources in the resource group.</p>
185 pub fn auto_config_enabled(mut self, input: bool) -> Self {
186 self.auto_config_enabled = ::std::option::Option::Some(input);
187 self
188 }
189 /// <p>Indicates whether Application Insights automatically configures unmonitored resources in the resource group.</p>
190 pub fn set_auto_config_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
191 self.auto_config_enabled = input;
192 self
193 }
194 /// <p>Indicates whether Application Insights automatically configures unmonitored resources in the resource group.</p>
195 pub fn get_auto_config_enabled(&self) -> &::std::option::Option<bool> {
196 &self.auto_config_enabled
197 }
198 /// <p>Configures all of the resources in the resource group by applying the recommended configurations.</p>
199 pub fn auto_create(mut self, input: bool) -> Self {
200 self.auto_create = ::std::option::Option::Some(input);
201 self
202 }
203 /// <p>Configures all of the resources in the resource group by applying the recommended configurations.</p>
204 pub fn set_auto_create(mut self, input: ::std::option::Option<bool>) -> Self {
205 self.auto_create = input;
206 self
207 }
208 /// <p>Configures all of the resources in the resource group by applying the recommended configurations.</p>
209 pub fn get_auto_create(&self) -> &::std::option::Option<bool> {
210 &self.auto_create
211 }
212 /// <p>Application Insights can create applications based on a resource group or on an account. To create an account-based application using all of the resources in the account, set this parameter to <code>ACCOUNT_BASED</code>.</p>
213 pub fn grouping_type(mut self, input: crate::types::GroupingType) -> Self {
214 self.grouping_type = ::std::option::Option::Some(input);
215 self
216 }
217 /// <p>Application Insights can create applications based on a resource group or on an account. To create an account-based application using all of the resources in the account, set this parameter to <code>ACCOUNT_BASED</code>.</p>
218 pub fn set_grouping_type(mut self, input: ::std::option::Option<crate::types::GroupingType>) -> Self {
219 self.grouping_type = input;
220 self
221 }
222 /// <p>Application Insights can create applications based on a resource group or on an account. To create an account-based application using all of the resources in the account, set this parameter to <code>ACCOUNT_BASED</code>.</p>
223 pub fn get_grouping_type(&self) -> &::std::option::Option<crate::types::GroupingType> {
224 &self.grouping_type
225 }
226 /// <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>
227 pub fn attach_missing_permission(mut self, input: bool) -> Self {
228 self.attach_missing_permission = ::std::option::Option::Some(input);
229 self
230 }
231 /// <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>
232 pub fn set_attach_missing_permission(mut self, input: ::std::option::Option<bool>) -> Self {
233 self.attach_missing_permission = input;
234 self
235 }
236 /// <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>
237 pub fn get_attach_missing_permission(&self) -> &::std::option::Option<bool> {
238 &self.attach_missing_permission
239 }
240 /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
241 pub fn build(
242 self,
243 ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
244 ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
245 resource_group_name: self.resource_group_name,
246 ops_center_enabled: self.ops_center_enabled,
247 cwe_monitor_enabled: self.cwe_monitor_enabled,
248 ops_item_sns_topic_arn: self.ops_item_sns_topic_arn,
249 sns_notification_arn: self.sns_notification_arn,
250 tags: self.tags,
251 auto_config_enabled: self.auto_config_enabled,
252 auto_create: self.auto_create,
253 grouping_type: self.grouping_type,
254 attach_missing_permission: self.attach_missing_permission,
255 })
256 }
257}