aws_sdk_networkmonitor/operation/update_probe/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_probe::_update_probe_output::UpdateProbeOutputBuilder;
3
4pub use crate::operation::update_probe::_update_probe_input::UpdateProbeInputBuilder;
5
6impl crate::operation::update_probe::builders::UpdateProbeInputBuilder {
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_probe::UpdateProbeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_probe::UpdateProbeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_probe();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateProbe`.
24///
25/// <p>Updates a monitor probe. This action requires both the <code>monitorName</code> and <code>probeId</code> parameters. Run <code>ListMonitors</code> to get a list of monitor names. Run <code>GetMonitor</code> to get a list of probes and probe IDs.</p>
26/// <p>You can update the following para create a monitor with probes using this command. For each probe, you define the following:</p>
27/// <ul>
28/// <li>
29/// <p><code>state</code>—The state of the probe.</p></li>
30/// <li>
31/// <p><code>destination</code>— The target destination IP address for the probe.</p></li>
32/// <li>
33/// <p><code>destinationPort</code>—Required only if the protocol is <code>TCP</code>.</p></li>
34/// <li>
35/// <p><code>protocol</code>—The communication protocol between the source and destination. This will be either <code>TCP</code> or <code>ICMP</code>.</p></li>
36/// <li>
37/// <p><code>packetSize</code>—The size of the packets. This must be a number between <code>56</code> and <code>8500</code>.</p></li>
38/// <li>
39/// <p>(Optional) <code>tags</code> —Key-value pairs created and assigned to the probe.</p></li>
40/// </ul>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct UpdateProbeFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::update_probe::builders::UpdateProbeInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::update_probe::UpdateProbeOutput,
50        crate::operation::update_probe::UpdateProbeError,
51    > for UpdateProbeFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::update_probe::UpdateProbeOutput,
59            crate::operation::update_probe::UpdateProbeError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl UpdateProbeFluentBuilder {
66    /// Creates a new `UpdateProbeFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the UpdateProbe as a reference.
75    pub fn as_input(&self) -> &crate::operation::update_probe::builders::UpdateProbeInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::update_probe::UpdateProbeOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::update_probe::UpdateProbeError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::update_probe::UpdateProbe::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::update_probe::UpdateProbe::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::update_probe::UpdateProbeOutput,
112        crate::operation::update_probe::UpdateProbeError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The name of the monitor that the probe was updated for.</p>
127    pub fn monitor_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.monitor_name(input.into());
129        self
130    }
131    /// <p>The name of the monitor that the probe was updated for.</p>
132    pub fn set_monitor_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_monitor_name(input);
134        self
135    }
136    /// <p>The name of the monitor that the probe was updated for.</p>
137    pub fn get_monitor_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_monitor_name()
139    }
140    /// <p>The ID of the probe to update.</p>
141    pub fn probe_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.probe_id(input.into());
143        self
144    }
145    /// <p>The ID of the probe to update.</p>
146    pub fn set_probe_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_probe_id(input);
148        self
149    }
150    /// <p>The ID of the probe to update.</p>
151    pub fn get_probe_id(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_probe_id()
153    }
154    /// <p>The state of the probe update.</p>
155    pub fn state(mut self, input: crate::types::ProbeState) -> Self {
156        self.inner = self.inner.state(input);
157        self
158    }
159    /// <p>The state of the probe update.</p>
160    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ProbeState>) -> Self {
161        self.inner = self.inner.set_state(input);
162        self
163    }
164    /// <p>The state of the probe update.</p>
165    pub fn get_state(&self) -> &::std::option::Option<crate::types::ProbeState> {
166        self.inner.get_state()
167    }
168    /// <p>The updated IP address for the probe destination. This must be either an IPv4 or IPv6 address.</p>
169    pub fn destination(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.destination(input.into());
171        self
172    }
173    /// <p>The updated IP address for the probe destination. This must be either an IPv4 or IPv6 address.</p>
174    pub fn set_destination(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_destination(input);
176        self
177    }
178    /// <p>The updated IP address for the probe destination. This must be either an IPv4 or IPv6 address.</p>
179    pub fn get_destination(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_destination()
181    }
182    /// <p>The updated port for the probe destination. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
183    pub fn destination_port(mut self, input: i32) -> Self {
184        self.inner = self.inner.destination_port(input);
185        self
186    }
187    /// <p>The updated port for the probe destination. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
188    pub fn set_destination_port(mut self, input: ::std::option::Option<i32>) -> Self {
189        self.inner = self.inner.set_destination_port(input);
190        self
191    }
192    /// <p>The updated port for the probe destination. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
193    pub fn get_destination_port(&self) -> &::std::option::Option<i32> {
194        self.inner.get_destination_port()
195    }
196    /// <p>The updated network protocol for the destination. This can be either <code>TCP</code> or <code>ICMP</code>. If the protocol is <code>TCP</code>, then <code>port</code> is also required.</p>
197    pub fn protocol(mut self, input: crate::types::Protocol) -> Self {
198        self.inner = self.inner.protocol(input);
199        self
200    }
201    /// <p>The updated network protocol for the destination. This can be either <code>TCP</code> or <code>ICMP</code>. If the protocol is <code>TCP</code>, then <code>port</code> is also required.</p>
202    pub fn set_protocol(mut self, input: ::std::option::Option<crate::types::Protocol>) -> Self {
203        self.inner = self.inner.set_protocol(input);
204        self
205    }
206    /// <p>The updated network protocol for the destination. This can be either <code>TCP</code> or <code>ICMP</code>. If the protocol is <code>TCP</code>, then <code>port</code> is also required.</p>
207    pub fn get_protocol(&self) -> &::std::option::Option<crate::types::Protocol> {
208        self.inner.get_protocol()
209    }
210    /// <p>he updated packets size for network traffic between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
211    pub fn packet_size(mut self, input: i32) -> Self {
212        self.inner = self.inner.packet_size(input);
213        self
214    }
215    /// <p>he updated packets size for network traffic between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
216    pub fn set_packet_size(mut self, input: ::std::option::Option<i32>) -> Self {
217        self.inner = self.inner.set_packet_size(input);
218        self
219    }
220    /// <p>he updated packets size for network traffic between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
221    pub fn get_packet_size(&self) -> &::std::option::Option<i32> {
222        self.inner.get_packet_size()
223    }
224}