aws_sdk_rum/operation/create_app_monitor/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_app_monitor::_create_app_monitor_output::CreateAppMonitorOutputBuilder;
3
4pub use crate::operation::create_app_monitor::_create_app_monitor_input::CreateAppMonitorInputBuilder;
5
6impl crate::operation::create_app_monitor::builders::CreateAppMonitorInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_app_monitor::CreateAppMonitorOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_app_monitor::CreateAppMonitorError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_app_monitor();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAppMonitor`.
24///
25/// <p>Creates a Amazon CloudWatch RUM app monitor, which collects telemetry data from your application and sends that data to RUM. The data includes performance and reliability information such as page load time, client-side errors, and user behavior.</p>
26/// <p>You use this operation only to create a new app monitor. To update an existing app monitor, use <a href="https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_UpdateAppMonitor.html">UpdateAppMonitor</a> instead.</p>
27/// <p>After you create an app monitor, sign in to the CloudWatch RUM console to get the JavaScript code snippet to add to your web application. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-find-code-snippet.html">How do I find a code snippet that I've already generated?</a></p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateAppMonitorFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_app_monitor::builders::CreateAppMonitorInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_app_monitor::CreateAppMonitorOutput,
37 crate::operation::create_app_monitor::CreateAppMonitorError,
38 > for CreateAppMonitorFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::create_app_monitor::CreateAppMonitorOutput,
46 crate::operation::create_app_monitor::CreateAppMonitorError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreateAppMonitorFluentBuilder {
53 /// Creates a new `CreateAppMonitorFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the CreateAppMonitor as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_app_monitor::builders::CreateAppMonitorInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::create_app_monitor::CreateAppMonitorOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_app_monitor::CreateAppMonitorError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::create_app_monitor::CreateAppMonitor::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_app_monitor::CreateAppMonitor::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::create_app_monitor::CreateAppMonitorOutput,
99 crate::operation::create_app_monitor::CreateAppMonitorError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>A name for the app monitor.</p>
114 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.name(input.into());
116 self
117 }
118 /// <p>A name for the app monitor.</p>
119 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_name(input);
121 self
122 }
123 /// <p>A name for the app monitor.</p>
124 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_name()
126 }
127 /// <p>The top-level internet domain name for which your application has administrative authority.</p>
128 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.domain(input.into());
130 self
131 }
132 /// <p>The top-level internet domain name for which your application has administrative authority.</p>
133 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_domain(input);
135 self
136 }
137 /// <p>The top-level internet domain name for which your application has administrative authority.</p>
138 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
139 self.inner.get_domain()
140 }
141 ///
142 /// Appends an item to `DomainList`.
143 ///
144 /// To override the contents of this collection use [`set_domain_list`](Self::set_domain_list).
145 ///
146 /// <p>List the domain names for which your application has administrative authority. The <code>CreateAppMonitor</code> requires either the domain or the domain list.</p>
147 pub fn domain_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.inner = self.inner.domain_list(input.into());
149 self
150 }
151 /// <p>List the domain names for which your application has administrative authority. The <code>CreateAppMonitor</code> requires either the domain or the domain list.</p>
152 pub fn set_domain_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153 self.inner = self.inner.set_domain_list(input);
154 self
155 }
156 /// <p>List the domain names for which your application has administrative authority. The <code>CreateAppMonitor</code> requires either the domain or the domain list.</p>
157 pub fn get_domain_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
158 self.inner.get_domain_list()
159 }
160 ///
161 /// Adds a key-value pair to `Tags`.
162 ///
163 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
164 ///
165 /// <p>Assigns one or more tags (key-value pairs) to the app monitor.</p>
166 /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
167 /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
168 /// <p>You can associate as many as 50 tags with an app monitor.</p>
169 /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
170 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.inner = self.inner.tags(k.into(), v.into());
172 self
173 }
174 /// <p>Assigns one or more tags (key-value pairs) to the app monitor.</p>
175 /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
176 /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
177 /// <p>You can associate as many as 50 tags with an app monitor.</p>
178 /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
179 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
180 self.inner = self.inner.set_tags(input);
181 self
182 }
183 /// <p>Assigns one or more tags (key-value pairs) to the app monitor.</p>
184 /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
185 /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
186 /// <p>You can associate as many as 50 tags with an app monitor.</p>
187 /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
188 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
189 self.inner.get_tags()
190 }
191 /// <p>A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include <code>AppMonitorConfiguration</code>, you must set up your own authorization method. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html">Authorize your application to send data to Amazon Web Services</a>.</p>
192 /// <p>If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.</p>
193 pub fn app_monitor_configuration(mut self, input: crate::types::AppMonitorConfiguration) -> Self {
194 self.inner = self.inner.app_monitor_configuration(input);
195 self
196 }
197 /// <p>A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include <code>AppMonitorConfiguration</code>, you must set up your own authorization method. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html">Authorize your application to send data to Amazon Web Services</a>.</p>
198 /// <p>If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.</p>
199 pub fn set_app_monitor_configuration(mut self, input: ::std::option::Option<crate::types::AppMonitorConfiguration>) -> Self {
200 self.inner = self.inner.set_app_monitor_configuration(input);
201 self
202 }
203 /// <p>A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include <code>AppMonitorConfiguration</code>, you must set up your own authorization method. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html">Authorize your application to send data to Amazon Web Services</a>.</p>
204 /// <p>If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.</p>
205 pub fn get_app_monitor_configuration(&self) -> &::std::option::Option<crate::types::AppMonitorConfiguration> {
206 self.inner.get_app_monitor_configuration()
207 }
208 /// <p>Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.</p>
209 /// <p>If you omit this parameter, the default is <code>false</code>.</p>
210 pub fn cw_log_enabled(mut self, input: bool) -> Self {
211 self.inner = self.inner.cw_log_enabled(input);
212 self
213 }
214 /// <p>Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.</p>
215 /// <p>If you omit this parameter, the default is <code>false</code>.</p>
216 pub fn set_cw_log_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
217 self.inner = self.inner.set_cw_log_enabled(input);
218 self
219 }
220 /// <p>Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.</p>
221 /// <p>If you omit this parameter, the default is <code>false</code>.</p>
222 pub fn get_cw_log_enabled(&self) -> &::std::option::Option<bool> {
223 self.inner.get_cw_log_enabled()
224 }
225 /// <p>Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are <code>DISABLED</code>.</p>
226 /// <p>For more information about custom events, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
227 pub fn custom_events(mut self, input: crate::types::CustomEvents) -> Self {
228 self.inner = self.inner.custom_events(input);
229 self
230 }
231 /// <p>Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are <code>DISABLED</code>.</p>
232 /// <p>For more information about custom events, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
233 pub fn set_custom_events(mut self, input: ::std::option::Option<crate::types::CustomEvents>) -> Self {
234 self.inner = self.inner.set_custom_events(input);
235 self
236 }
237 /// <p>Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are <code>DISABLED</code>.</p>
238 /// <p>For more information about custom events, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
239 pub fn get_custom_events(&self) -> &::std::option::Option<crate::types::CustomEvents> {
240 self.inner.get_custom_events()
241 }
242 /// <p>A structure that contains the configuration for how an app monitor can deobfuscate stack traces.</p>
243 pub fn deobfuscation_configuration(mut self, input: crate::types::DeobfuscationConfiguration) -> Self {
244 self.inner = self.inner.deobfuscation_configuration(input);
245 self
246 }
247 /// <p>A structure that contains the configuration for how an app monitor can deobfuscate stack traces.</p>
248 pub fn set_deobfuscation_configuration(mut self, input: ::std::option::Option<crate::types::DeobfuscationConfiguration>) -> Self {
249 self.inner = self.inner.set_deobfuscation_configuration(input);
250 self
251 }
252 /// <p>A structure that contains the configuration for how an app monitor can deobfuscate stack traces.</p>
253 pub fn get_deobfuscation_configuration(&self) -> &::std::option::Option<crate::types::DeobfuscationConfiguration> {
254 self.inner.get_deobfuscation_configuration()
255 }
256}