aws_sdk_globalaccelerator/operation/update_endpoint_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_endpoint_group::_update_endpoint_group_output::UpdateEndpointGroupOutputBuilder;
3
4pub use crate::operation::update_endpoint_group::_update_endpoint_group_input::UpdateEndpointGroupInputBuilder;
5
6impl crate::operation::update_endpoint_group::builders::UpdateEndpointGroupInputBuilder {
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_endpoint_group::UpdateEndpointGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_endpoint_group::UpdateEndpointGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_endpoint_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateEndpointGroup`.
24///
25/// <p>Update an endpoint group. A resource must be valid and active when you add it as an endpoint.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateEndpointGroupFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_endpoint_group::builders::UpdateEndpointGroupInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_endpoint_group::UpdateEndpointGroupOutput,
35 crate::operation::update_endpoint_group::UpdateEndpointGroupError,
36 > for UpdateEndpointGroupFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::update_endpoint_group::UpdateEndpointGroupOutput,
44 crate::operation::update_endpoint_group::UpdateEndpointGroupError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateEndpointGroupFluentBuilder {
51 /// Creates a new `UpdateEndpointGroupFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the UpdateEndpointGroup as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_endpoint_group::builders::UpdateEndpointGroupInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_endpoint_group::UpdateEndpointGroupOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_endpoint_group::UpdateEndpointGroupError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_endpoint_group::UpdateEndpointGroup::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_endpoint_group::UpdateEndpointGroup::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_endpoint_group::UpdateEndpointGroupOutput,
97 crate::operation::update_endpoint_group::UpdateEndpointGroupError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
112 pub fn endpoint_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.endpoint_group_arn(input.into());
114 self
115 }
116 /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
117 pub fn set_endpoint_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_endpoint_group_arn(input);
119 self
120 }
121 /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
122 pub fn get_endpoint_group_arn(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_endpoint_group_arn()
124 }
125 ///
126 /// Appends an item to `EndpointConfigurations`.
127 ///
128 /// To override the contents of this collection use [`set_endpoint_configurations`](Self::set_endpoint_configurations).
129 ///
130 /// <p>The list of endpoint objects. A resource must be valid and active when you add it as an endpoint.</p>
131 pub fn endpoint_configurations(mut self, input: crate::types::EndpointConfiguration) -> Self {
132 self.inner = self.inner.endpoint_configurations(input);
133 self
134 }
135 /// <p>The list of endpoint objects. A resource must be valid and active when you add it as an endpoint.</p>
136 pub fn set_endpoint_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>>) -> Self {
137 self.inner = self.inner.set_endpoint_configurations(input);
138 self
139 }
140 /// <p>The list of endpoint objects. A resource must be valid and active when you add it as an endpoint.</p>
141 pub fn get_endpoint_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>> {
142 self.inner.get_endpoint_configurations()
143 }
144 /// <p>The percentage of traffic to send to an Amazon Web Services Region. Additional traffic is distributed to other endpoint groups for this listener.</p>
145 /// <p>Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing.</p>
146 /// <p>The default value is 100.</p>
147 pub fn traffic_dial_percentage(mut self, input: f32) -> Self {
148 self.inner = self.inner.traffic_dial_percentage(input);
149 self
150 }
151 /// <p>The percentage of traffic to send to an Amazon Web Services Region. Additional traffic is distributed to other endpoint groups for this listener.</p>
152 /// <p>Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing.</p>
153 /// <p>The default value is 100.</p>
154 pub fn set_traffic_dial_percentage(mut self, input: ::std::option::Option<f32>) -> Self {
155 self.inner = self.inner.set_traffic_dial_percentage(input);
156 self
157 }
158 /// <p>The percentage of traffic to send to an Amazon Web Services Region. Additional traffic is distributed to other endpoint groups for this listener.</p>
159 /// <p>Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing.</p>
160 /// <p>The default value is 100.</p>
161 pub fn get_traffic_dial_percentage(&self) -> &::std::option::Option<f32> {
162 self.inner.get_traffic_dial_percentage()
163 }
164 /// <p>The port that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If the listener port is a list of ports, Global Accelerator uses the first port in the list.</p>
165 pub fn health_check_port(mut self, input: i32) -> Self {
166 self.inner = self.inner.health_check_port(input);
167 self
168 }
169 /// <p>The port that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If the listener port is a list of ports, Global Accelerator uses the first port in the list.</p>
170 pub fn set_health_check_port(mut self, input: ::std::option::Option<i32>) -> Self {
171 self.inner = self.inner.set_health_check_port(input);
172 self
173 }
174 /// <p>The port that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If the listener port is a list of ports, Global Accelerator uses the first port in the list.</p>
175 pub fn get_health_check_port(&self) -> &::std::option::Option<i32> {
176 self.inner.get_health_check_port()
177 }
178 /// <p>The protocol that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.</p>
179 pub fn health_check_protocol(mut self, input: crate::types::HealthCheckProtocol) -> Self {
180 self.inner = self.inner.health_check_protocol(input);
181 self
182 }
183 /// <p>The protocol that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.</p>
184 pub fn set_health_check_protocol(mut self, input: ::std::option::Option<crate::types::HealthCheckProtocol>) -> Self {
185 self.inner = self.inner.set_health_check_protocol(input);
186 self
187 }
188 /// <p>The protocol that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.</p>
189 pub fn get_health_check_protocol(&self) -> &::std::option::Option<crate::types::HealthCheckProtocol> {
190 self.inner.get_health_check_protocol()
191 }
192 /// <p>If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (/).</p>
193 pub fn health_check_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194 self.inner = self.inner.health_check_path(input.into());
195 self
196 }
197 /// <p>If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (/).</p>
198 pub fn set_health_check_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.inner = self.inner.set_health_check_path(input);
200 self
201 }
202 /// <p>If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (/).</p>
203 pub fn get_health_check_path(&self) -> &::std::option::Option<::std::string::String> {
204 self.inner.get_health_check_path()
205 }
206 /// <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
207 pub fn health_check_interval_seconds(mut self, input: i32) -> Self {
208 self.inner = self.inner.health_check_interval_seconds(input);
209 self
210 }
211 /// <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
212 pub fn set_health_check_interval_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
213 self.inner = self.inner.set_health_check_interval_seconds(input);
214 self
215 }
216 /// <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
217 pub fn get_health_check_interval_seconds(&self) -> &::std::option::Option<i32> {
218 self.inner.get_health_check_interval_seconds()
219 }
220 /// <p>The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default value is 3.</p>
221 pub fn threshold_count(mut self, input: i32) -> Self {
222 self.inner = self.inner.threshold_count(input);
223 self
224 }
225 /// <p>The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default value is 3.</p>
226 pub fn set_threshold_count(mut self, input: ::std::option::Option<i32>) -> Self {
227 self.inner = self.inner.set_threshold_count(input);
228 self
229 }
230 /// <p>The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default value is 3.</p>
231 pub fn get_threshold_count(&self) -> &::std::option::Option<i32> {
232 self.inner.get_threshold_count()
233 }
234 ///
235 /// Appends an item to `PortOverrides`.
236 ///
237 /// To override the contents of this collection use [`set_port_overrides`](Self::set_port_overrides).
238 ///
239 /// <p>Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints.</p>
240 /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups-port-override.html"> Overriding listener ports</a> in the <i>Global Accelerator Developer Guide</i>.</p>
241 pub fn port_overrides(mut self, input: crate::types::PortOverride) -> Self {
242 self.inner = self.inner.port_overrides(input);
243 self
244 }
245 /// <p>Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints.</p>
246 /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups-port-override.html"> Overriding listener ports</a> in the <i>Global Accelerator Developer Guide</i>.</p>
247 pub fn set_port_overrides(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PortOverride>>) -> Self {
248 self.inner = self.inner.set_port_overrides(input);
249 self
250 }
251 /// <p>Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints.</p>
252 /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups-port-override.html"> Overriding listener ports</a> in the <i>Global Accelerator Developer Guide</i>.</p>
253 pub fn get_port_overrides(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PortOverride>> {
254 self.inner.get_port_overrides()
255 }
256}