aws_sdk_globalaccelerator/operation/create_endpoint_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_endpoint_group::_create_endpoint_group_output::CreateEndpointGroupOutputBuilder;
3
4pub use crate::operation::create_endpoint_group::_create_endpoint_group_input::CreateEndpointGroupInputBuilder;
5
6impl crate::operation::create_endpoint_group::builders::CreateEndpointGroupInputBuilder {
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_endpoint_group::CreateEndpointGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_endpoint_group::CreateEndpointGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_endpoint_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateEndpointGroup`.
24///
25/// <p>Create an endpoint group for the specified listener. An endpoint group is a collection of endpoints in one Amazon Web Services Region. A resource must be valid and active when you add it as an endpoint.</p>
26/// <p>For more information about endpoint types and requirements for endpoints that you can add to Global Accelerator, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoints.html"> Endpoints for standard accelerators</a> in the <i>Global Accelerator Developer Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateEndpointGroupFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_endpoint_group::builders::CreateEndpointGroupInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::create_endpoint_group::CreateEndpointGroupOutput,
36 crate::operation::create_endpoint_group::CreateEndpointGroupError,
37 > for CreateEndpointGroupFluentBuilder
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::create_endpoint_group::CreateEndpointGroupOutput,
45 crate::operation::create_endpoint_group::CreateEndpointGroupError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl CreateEndpointGroupFluentBuilder {
52 /// Creates a new `CreateEndpointGroupFluentBuilder`.
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 CreateEndpointGroup as a reference.
61 pub fn as_input(&self) -> &crate::operation::create_endpoint_group::builders::CreateEndpointGroupInputBuilder {
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::create_endpoint_group::CreateEndpointGroupOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::create_endpoint_group::CreateEndpointGroupError,
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::create_endpoint_group::CreateEndpointGroup::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::create_endpoint_group::CreateEndpointGroup::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::create_endpoint_group::CreateEndpointGroupOutput,
98 crate::operation::create_endpoint_group::CreateEndpointGroupError,
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 Amazon Resource Name (ARN) of the listener.</p>
113 pub fn listener_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.listener_arn(input.into());
115 self
116 }
117 /// <p>The Amazon Resource Name (ARN) of the listener.</p>
118 pub fn set_listener_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_listener_arn(input);
120 self
121 }
122 /// <p>The Amazon Resource Name (ARN) of the listener.</p>
123 pub fn get_listener_arn(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_listener_arn()
125 }
126 /// <p>The Amazon Web Services Region where the endpoint group is located. A listener can have only one endpoint group in a specific Region.</p>
127 pub fn endpoint_group_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.endpoint_group_region(input.into());
129 self
130 }
131 /// <p>The Amazon Web Services Region where the endpoint group is located. A listener can have only one endpoint group in a specific Region.</p>
132 pub fn set_endpoint_group_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_endpoint_group_region(input);
134 self
135 }
136 /// <p>The Amazon Web Services Region where the endpoint group is located. A listener can have only one endpoint group in a specific Region.</p>
137 pub fn get_endpoint_group_region(&self) -> &::std::option::Option<::std::string::String> {
138 self.inner.get_endpoint_group_region()
139 }
140 ///
141 /// Appends an item to `EndpointConfigurations`.
142 ///
143 /// To override the contents of this collection use [`set_endpoint_configurations`](Self::set_endpoint_configurations).
144 ///
145 /// <p>The list of endpoint objects.</p>
146 pub fn endpoint_configurations(mut self, input: crate::types::EndpointConfiguration) -> Self {
147 self.inner = self.inner.endpoint_configurations(input);
148 self
149 }
150 /// <p>The list of endpoint objects.</p>
151 pub fn set_endpoint_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>>) -> Self {
152 self.inner = self.inner.set_endpoint_configurations(input);
153 self
154 }
155 /// <p>The list of endpoint objects.</p>
156 pub fn get_endpoint_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>> {
157 self.inner.get_endpoint_configurations()
158 }
159 /// <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>
160 /// <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>
161 /// <p>The default value is 100.</p>
162 pub fn traffic_dial_percentage(mut self, input: f32) -> Self {
163 self.inner = self.inner.traffic_dial_percentage(input);
164 self
165 }
166 /// <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>
167 /// <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>
168 /// <p>The default value is 100.</p>
169 pub fn set_traffic_dial_percentage(mut self, input: ::std::option::Option<f32>) -> Self {
170 self.inner = self.inner.set_traffic_dial_percentage(input);
171 self
172 }
173 /// <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>
174 /// <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>
175 /// <p>The default value is 100.</p>
176 pub fn get_traffic_dial_percentage(&self) -> &::std::option::Option<f32> {
177 self.inner.get_traffic_dial_percentage()
178 }
179 /// <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 listener port is a list of ports, Global Accelerator uses the first port in the list.</p>
180 pub fn health_check_port(mut self, input: i32) -> Self {
181 self.inner = self.inner.health_check_port(input);
182 self
183 }
184 /// <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 listener port is a list of ports, Global Accelerator uses the first port in the list.</p>
185 pub fn set_health_check_port(mut self, input: ::std::option::Option<i32>) -> Self {
186 self.inner = self.inner.set_health_check_port(input);
187 self
188 }
189 /// <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 listener port is a list of ports, Global Accelerator uses the first port in the list.</p>
190 pub fn get_health_check_port(&self) -> &::std::option::Option<i32> {
191 self.inner.get_health_check_port()
192 }
193 /// <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>
194 pub fn health_check_protocol(mut self, input: crate::types::HealthCheckProtocol) -> Self {
195 self.inner = self.inner.health_check_protocol(input);
196 self
197 }
198 /// <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>
199 pub fn set_health_check_protocol(mut self, input: ::std::option::Option<crate::types::HealthCheckProtocol>) -> Self {
200 self.inner = self.inner.set_health_check_protocol(input);
201 self
202 }
203 /// <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>
204 pub fn get_health_check_protocol(&self) -> &::std::option::Option<crate::types::HealthCheckProtocol> {
205 self.inner.get_health_check_protocol()
206 }
207 /// <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>
208 pub fn health_check_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209 self.inner = self.inner.health_check_path(input.into());
210 self
211 }
212 /// <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>
213 pub fn set_health_check_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214 self.inner = self.inner.set_health_check_path(input);
215 self
216 }
217 /// <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>
218 pub fn get_health_check_path(&self) -> &::std::option::Option<::std::string::String> {
219 self.inner.get_health_check_path()
220 }
221 /// <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
222 pub fn health_check_interval_seconds(mut self, input: i32) -> Self {
223 self.inner = self.inner.health_check_interval_seconds(input);
224 self
225 }
226 /// <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
227 pub fn set_health_check_interval_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
228 self.inner = self.inner.set_health_check_interval_seconds(input);
229 self
230 }
231 /// <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
232 pub fn get_health_check_interval_seconds(&self) -> &::std::option::Option<i32> {
233 self.inner.get_health_check_interval_seconds()
234 }
235 /// <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>
236 pub fn threshold_count(mut self, input: i32) -> Self {
237 self.inner = self.inner.threshold_count(input);
238 self
239 }
240 /// <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>
241 pub fn set_threshold_count(mut self, input: ::std::option::Option<i32>) -> Self {
242 self.inner = self.inner.set_threshold_count(input);
243 self
244 }
245 /// <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>
246 pub fn get_threshold_count(&self) -> &::std::option::Option<i32> {
247 self.inner.get_threshold_count()
248 }
249 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
250 pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251 self.inner = self.inner.idempotency_token(input.into());
252 self
253 }
254 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
255 pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256 self.inner = self.inner.set_idempotency_token(input);
257 self
258 }
259 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
260 pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
261 self.inner.get_idempotency_token()
262 }
263 ///
264 /// Appends an item to `PortOverrides`.
265 ///
266 /// To override the contents of this collection use [`set_port_overrides`](Self::set_port_overrides).
267 ///
268 /// <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>
269 /// <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>
270 pub fn port_overrides(mut self, input: crate::types::PortOverride) -> Self {
271 self.inner = self.inner.port_overrides(input);
272 self
273 }
274 /// <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>
275 /// <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>
276 pub fn set_port_overrides(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PortOverride>>) -> Self {
277 self.inner = self.inner.set_port_overrides(input);
278 self
279 }
280 /// <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>
281 /// <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>
282 pub fn get_port_overrides(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PortOverride>> {
283 self.inner.get_port_overrides()
284 }
285}