aws_sdk_globalaccelerator/operation/remove_endpoints/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::remove_endpoints::_remove_endpoints_output::RemoveEndpointsOutputBuilder;
3
4pub use crate::operation::remove_endpoints::_remove_endpoints_input::RemoveEndpointsInputBuilder;
5
6impl crate::operation::remove_endpoints::builders::RemoveEndpointsInputBuilder {
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::remove_endpoints::RemoveEndpointsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::remove_endpoints::RemoveEndpointsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.remove_endpoints();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RemoveEndpoints`.
24///
25/// <p>Remove endpoints from an endpoint group.</p>
26/// <p>The <code>RemoveEndpoints</code> API operation is the recommended option for removing endpoints. The alternative is to remove endpoints by updating an endpoint group by using the <a href="https://docs.aws.amazon.com/global-accelerator/latest/api/API_UpdateEndpointGroup.html">UpdateEndpointGroup</a> API operation. There are two advantages to using <code>AddEndpoints</code> to remove endpoints instead:</p>
27/// <ul>
28/// <li>
29/// <p>It's more convenient, because you only need to specify the endpoints that you want to remove. With the <code>UpdateEndpointGroup</code> API operation, you must specify all of the endpoints in the endpoint group except the ones that you want to remove from the group.</p></li>
30/// <li>
31/// <p>It's faster, because Global Accelerator doesn't need to resolve any endpoints. With the <code>UpdateEndpointGroup</code> API operation, Global Accelerator must resolve all of the endpoints that remain in the group.</p></li>
32/// </ul>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct RemoveEndpointsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::remove_endpoints::builders::RemoveEndpointsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::remove_endpoints::RemoveEndpointsOutput,
42        crate::operation::remove_endpoints::RemoveEndpointsError,
43    > for RemoveEndpointsFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::remove_endpoints::RemoveEndpointsOutput,
51            crate::operation::remove_endpoints::RemoveEndpointsError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl RemoveEndpointsFluentBuilder {
58    /// Creates a new `RemoveEndpointsFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the RemoveEndpoints as a reference.
67    pub fn as_input(&self) -> &crate::operation::remove_endpoints::builders::RemoveEndpointsInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::remove_endpoints::RemoveEndpointsOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::remove_endpoints::RemoveEndpointsError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::remove_endpoints::RemoveEndpoints::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::remove_endpoints::RemoveEndpoints::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::remove_endpoints::RemoveEndpointsOutput,
104        crate::operation::remove_endpoints::RemoveEndpointsError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    ///
119    /// Appends an item to `EndpointIdentifiers`.
120    ///
121    /// To override the contents of this collection use [`set_endpoint_identifiers`](Self::set_endpoint_identifiers).
122    ///
123    /// <p>The identifiers of the endpoints that you want to remove.</p>
124    pub fn endpoint_identifiers(mut self, input: crate::types::EndpointIdentifier) -> Self {
125        self.inner = self.inner.endpoint_identifiers(input);
126        self
127    }
128    /// <p>The identifiers of the endpoints that you want to remove.</p>
129    pub fn set_endpoint_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointIdentifier>>) -> Self {
130        self.inner = self.inner.set_endpoint_identifiers(input);
131        self
132    }
133    /// <p>The identifiers of the endpoints that you want to remove.</p>
134    pub fn get_endpoint_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointIdentifier>> {
135        self.inner.get_endpoint_identifiers()
136    }
137    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
138    pub fn endpoint_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.endpoint_group_arn(input.into());
140        self
141    }
142    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
143    pub fn set_endpoint_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_endpoint_group_arn(input);
145        self
146    }
147    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
148    pub fn get_endpoint_group_arn(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_endpoint_group_arn()
150    }
151}