Skip to main content

aws_sdk_interconnect/operation/create_connection/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_connection::_create_connection_input::CreateConnectionInputBuilder;
3
4pub use crate::operation::create_connection::_create_connection_output::CreateConnectionOutputBuilder;
5
6impl crate::operation::create_connection::builders::CreateConnectionInputBuilder {
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_connection::CreateConnectionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_connection::CreateConnectionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_connection();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateConnection`.
24///
25/// <p>Initiates the process to create a Connection across the specified Environment.</p>
26/// <p>The Environment dictates the specified partner and location to which the other end of the connection should attach. You can see a list of the available Environments by calling <code>ListEnvironments</code></p>
27/// <p>The Attach Point specifies where within the AWS Network your connection will logically connect.</p>
28/// <p>After a successful call to this method, the resulting <code>Connection</code> will return an Activation Key which will need to be brought to the specific partner's portal to confirm the <code>Connection</code> on both sides. (See <code>Environment$activationPageUrl</code> for a direct link to the partner portal).</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateConnectionFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_connection::builders::CreateConnectionInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_connection::CreateConnectionOutput,
38        crate::operation::create_connection::CreateConnectionError,
39    > for CreateConnectionFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_connection::CreateConnectionOutput,
47            crate::operation::create_connection::CreateConnectionError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateConnectionFluentBuilder {
54    /// Creates a new `CreateConnectionFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreateConnection as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_connection::builders::CreateConnectionInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_connection::CreateConnectionOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_connection::CreateConnectionError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::create_connection::CreateConnection::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_connection::CreateConnection::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_connection::CreateConnectionOutput,
100        crate::operation::create_connection::CreateConnectionError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>A description to distinguish this <code>Connection</code>.</p>
115    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.description(input.into());
117        self
118    }
119    /// <p>A description to distinguish this <code>Connection</code>.</p>
120    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_description(input);
122        self
123    }
124    /// <p>A description to distinguish this <code>Connection</code>.</p>
125    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_description()
127    }
128    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
129    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.bandwidth(input.into());
131        self
132    }
133    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
134    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_bandwidth(input);
136        self
137    }
138    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
139    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_bandwidth()
141    }
142    /// <p>The Attach Point to which the connection should be associated."</p>
143    pub fn attach_point(mut self, input: crate::types::AttachPoint) -> Self {
144        self.inner = self.inner.attach_point(input);
145        self
146    }
147    /// <p>The Attach Point to which the connection should be associated."</p>
148    pub fn set_attach_point(mut self, input: ::std::option::Option<crate::types::AttachPoint>) -> Self {
149        self.inner = self.inner.set_attach_point(input);
150        self
151    }
152    /// <p>The Attach Point to which the connection should be associated."</p>
153    pub fn get_attach_point(&self) -> &::std::option::Option<crate::types::AttachPoint> {
154        self.inner.get_attach_point()
155    }
156    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
157    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
158    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.environment_id(input.into());
160        self
161    }
162    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
163    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
164    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_environment_id(input);
166        self
167    }
168    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
169    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
170    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_environment_id()
172    }
173    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
174    pub fn remote_account(mut self, input: crate::types::RemoteAccountIdentifier) -> Self {
175        self.inner = self.inner.remote_account(input);
176        self
177    }
178    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
179    pub fn set_remote_account(mut self, input: ::std::option::Option<crate::types::RemoteAccountIdentifier>) -> Self {
180        self.inner = self.inner.set_remote_account(input);
181        self
182    }
183    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
184    pub fn get_remote_account(&self) -> &::std::option::Option<crate::types::RemoteAccountIdentifier> {
185        self.inner.get_remote_account()
186    }
187    ///
188    /// Adds a key-value pair to `tags`.
189    ///
190    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
191    ///
192    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
193    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.tags(k.into(), v.into());
195        self
196    }
197    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
198    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
199        self.inner = self.inner.set_tags(input);
200        self
201    }
202    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
203    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
204        self.inner.get_tags()
205    }
206    /// <p>Idempotency token used for the request.</p>
207    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.client_token(input.into());
209        self
210    }
211    /// <p>Idempotency token used for the request.</p>
212    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_client_token(input);
214        self
215    }
216    /// <p>Idempotency token used for the request.</p>
217    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_client_token()
219    }
220}