aws_sdk_internetmonitor/operation/update_monitor/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_monitor::_update_monitor_output::UpdateMonitorOutputBuilder;
3
4pub use crate::operation::update_monitor::_update_monitor_input::UpdateMonitorInputBuilder;
5
6impl crate::operation::update_monitor::builders::UpdateMonitorInputBuilder {
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::update_monitor::UpdateMonitorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_monitor::UpdateMonitorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_monitor();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateMonitor`.
24///
25/// <p>Updates a monitor. You can update a monitor to change the percentage of traffic to monitor or the maximum number of city-networks (locations and ASNs), to add or remove resources, or to change the status of the monitor. Note that you can't change the name of a monitor.</p>
26/// <p>The city-network maximum that you choose is the limit, but you only pay for the number of city-networks that are actually monitored. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html">Choosing a city-network maximum value</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateMonitorFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_monitor::builders::UpdateMonitorInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::update_monitor::UpdateMonitorOutput,
36        crate::operation::update_monitor::UpdateMonitorError,
37    > for UpdateMonitorFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::update_monitor::UpdateMonitorOutput,
45            crate::operation::update_monitor::UpdateMonitorError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl UpdateMonitorFluentBuilder {
52    /// Creates a new `UpdateMonitorFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the UpdateMonitor as a reference.
61    pub fn as_input(&self) -> &crate::operation::update_monitor::builders::UpdateMonitorInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::update_monitor::UpdateMonitorOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::update_monitor::UpdateMonitorError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::update_monitor::UpdateMonitor::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::update_monitor::UpdateMonitor::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::update_monitor::UpdateMonitorOutput,
98        crate::operation::update_monitor::UpdateMonitorError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The name of the monitor.</p>
113    pub fn monitor_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.monitor_name(input.into());
115        self
116    }
117    /// <p>The name of the monitor.</p>
118    pub fn set_monitor_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_monitor_name(input);
120        self
121    }
122    /// <p>The name of the monitor.</p>
123    pub fn get_monitor_name(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_monitor_name()
125    }
126    ///
127    /// Appends an item to `ResourcesToAdd`.
128    ///
129    /// To override the contents of this collection use [`set_resources_to_add`](Self::set_resources_to_add).
130    ///
131    /// <p>The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, or Amazon WorkSpaces directories.</p>
132    /// <p>You can add a combination of VPCs and CloudFront distributions, or you can add WorkSpaces directories, or you can add NLBs. You can't add NLBs or WorkSpaces directories together with any other resources.</p><note>
133    /// <p>If you add only Amazon Virtual Private Clouds resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.</p>
134    /// </note>
135    pub fn resources_to_add(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.resources_to_add(input.into());
137        self
138    }
139    /// <p>The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, or Amazon WorkSpaces directories.</p>
140    /// <p>You can add a combination of VPCs and CloudFront distributions, or you can add WorkSpaces directories, or you can add NLBs. You can't add NLBs or WorkSpaces directories together with any other resources.</p><note>
141    /// <p>If you add only Amazon Virtual Private Clouds resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.</p>
142    /// </note>
143    pub fn set_resources_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
144        self.inner = self.inner.set_resources_to_add(input);
145        self
146    }
147    /// <p>The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, or Amazon WorkSpaces directories.</p>
148    /// <p>You can add a combination of VPCs and CloudFront distributions, or you can add WorkSpaces directories, or you can add NLBs. You can't add NLBs or WorkSpaces directories together with any other resources.</p><note>
149    /// <p>If you add only Amazon Virtual Private Clouds resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.</p>
150    /// </note>
151    pub fn get_resources_to_add(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
152        self.inner.get_resources_to_add()
153    }
154    ///
155    /// Appends an item to `ResourcesToRemove`.
156    ///
157    /// To override the contents of this collection use [`set_resources_to_remove`](Self::set_resources_to_remove).
158    ///
159    /// <p>The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).</p>
160    pub fn resources_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.resources_to_remove(input.into());
162        self
163    }
164    /// <p>The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).</p>
165    pub fn set_resources_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
166        self.inner = self.inner.set_resources_to_remove(input);
167        self
168    }
169    /// <p>The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).</p>
170    pub fn get_resources_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
171        self.inner.get_resources_to_remove()
172    }
173    /// <p>The status for a monitor. The accepted values for <code>Status</code> with the <code>UpdateMonitor</code> API call are the following: <code>ACTIVE</code> and <code>INACTIVE</code>. The following values are <i>not</i> accepted: <code>PENDING</code>, and <code>ERROR</code>.</p>
174    pub fn status(mut self, input: crate::types::MonitorConfigState) -> Self {
175        self.inner = self.inner.status(input);
176        self
177    }
178    /// <p>The status for a monitor. The accepted values for <code>Status</code> with the <code>UpdateMonitor</code> API call are the following: <code>ACTIVE</code> and <code>INACTIVE</code>. The following values are <i>not</i> accepted: <code>PENDING</code>, and <code>ERROR</code>.</p>
179    pub fn set_status(mut self, input: ::std::option::Option<crate::types::MonitorConfigState>) -> Self {
180        self.inner = self.inner.set_status(input);
181        self
182    }
183    /// <p>The status for a monitor. The accepted values for <code>Status</code> with the <code>UpdateMonitor</code> API call are the following: <code>ACTIVE</code> and <code>INACTIVE</code>. The following values are <i>not</i> accepted: <code>PENDING</code>, and <code>ERROR</code>.</p>
184    pub fn get_status(&self) -> &::std::option::Option<crate::types::MonitorConfigState> {
185        self.inner.get_status()
186    }
187    /// <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client token for other API requests.</p>
188    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.inner = self.inner.client_token(input.into());
190        self
191    }
192    /// <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client token for other API requests.</p>
193    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.inner = self.inner.set_client_token(input);
195        self
196    }
197    /// <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client token for other API requests.</p>
198    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
199        self.inner.get_client_token()
200    }
201    /// <p>The maximum number of city-networks to monitor for your application. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. Setting this limit can help control billing costs.</p>
202    pub fn max_city_networks_to_monitor(mut self, input: i32) -> Self {
203        self.inner = self.inner.max_city_networks_to_monitor(input);
204        self
205    }
206    /// <p>The maximum number of city-networks to monitor for your application. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. Setting this limit can help control billing costs.</p>
207    pub fn set_max_city_networks_to_monitor(mut self, input: ::std::option::Option<i32>) -> Self {
208        self.inner = self.inner.set_max_city_networks_to_monitor(input);
209        self
210    }
211    /// <p>The maximum number of city-networks to monitor for your application. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. Setting this limit can help control billing costs.</p>
212    pub fn get_max_city_networks_to_monitor(&self) -> &::std::option::Option<i32> {
213        self.inner.get_max_city_networks_to_monitor()
214    }
215    /// <p>Publish internet measurements for Internet Monitor to another location, such as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch Logs.</p>
216    pub fn internet_measurements_log_delivery(mut self, input: crate::types::InternetMeasurementsLogDelivery) -> Self {
217        self.inner = self.inner.internet_measurements_log_delivery(input);
218        self
219    }
220    /// <p>Publish internet measurements for Internet Monitor to another location, such as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch Logs.</p>
221    pub fn set_internet_measurements_log_delivery(mut self, input: ::std::option::Option<crate::types::InternetMeasurementsLogDelivery>) -> Self {
222        self.inner = self.inner.set_internet_measurements_log_delivery(input);
223        self
224    }
225    /// <p>Publish internet measurements for Internet Monitor to another location, such as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch Logs.</p>
226    pub fn get_internet_measurements_log_delivery(&self) -> &::std::option::Option<crate::types::InternetMeasurementsLogDelivery> {
227        self.inner.get_internet_measurements_log_delivery()
228    }
229    /// <p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.</p>
230    /// <p>To learn more, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html">Choosing an application traffic percentage to monitor </a> in the Amazon CloudWatch Internet Monitor section of the <i>CloudWatch User Guide</i>.</p>
231    pub fn traffic_percentage_to_monitor(mut self, input: i32) -> Self {
232        self.inner = self.inner.traffic_percentage_to_monitor(input);
233        self
234    }
235    /// <p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.</p>
236    /// <p>To learn more, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html">Choosing an application traffic percentage to monitor </a> in the Amazon CloudWatch Internet Monitor section of the <i>CloudWatch User Guide</i>.</p>
237    pub fn set_traffic_percentage_to_monitor(mut self, input: ::std::option::Option<i32>) -> Self {
238        self.inner = self.inner.set_traffic_percentage_to_monitor(input);
239        self
240    }
241    /// <p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.</p>
242    /// <p>To learn more, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html">Choosing an application traffic percentage to monitor </a> in the Amazon CloudWatch Internet Monitor section of the <i>CloudWatch User Guide</i>.</p>
243    pub fn get_traffic_percentage_to_monitor(&self) -> &::std::option::Option<i32> {
244        self.inner.get_traffic_percentage_to_monitor()
245    }
246    /// <p>The list of health score thresholds. A threshold percentage for health scores, along with other configuration information, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users.</p>
247    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview"> Change health event thresholds</a> in the Internet Monitor section of the <i>CloudWatch User Guide</i>.</p>
248    pub fn health_events_config(mut self, input: crate::types::HealthEventsConfig) -> Self {
249        self.inner = self.inner.health_events_config(input);
250        self
251    }
252    /// <p>The list of health score thresholds. A threshold percentage for health scores, along with other configuration information, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users.</p>
253    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview"> Change health event thresholds</a> in the Internet Monitor section of the <i>CloudWatch User Guide</i>.</p>
254    pub fn set_health_events_config(mut self, input: ::std::option::Option<crate::types::HealthEventsConfig>) -> Self {
255        self.inner = self.inner.set_health_events_config(input);
256        self
257    }
258    /// <p>The list of health score thresholds. A threshold percentage for health scores, along with other configuration information, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users.</p>
259    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview"> Change health event thresholds</a> in the Internet Monitor section of the <i>CloudWatch User Guide</i>.</p>
260    pub fn get_health_events_config(&self) -> &::std::option::Option<crate::types::HealthEventsConfig> {
261        self.inner.get_health_events_config()
262    }
263}