aws_sdk_directconnect/operation/create_interconnect/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_interconnect::_create_interconnect_output::CreateInterconnectOutputBuilder;
3
4pub use crate::operation::create_interconnect::_create_interconnect_input::CreateInterconnectInputBuilder;
5
6impl crate::operation::create_interconnect::builders::CreateInterconnectInputBuilder {
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_interconnect::CreateInterconnectOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_interconnect::CreateInterconnectError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_interconnect();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateInterconnect`.
24///
25/// <p>Creates an interconnect between an Direct Connect Partner's network and a specific Direct Connect location.</p>
26/// <p>An interconnect is a connection that is capable of hosting other connections. The Direct Connect Partner can use an interconnect to provide Direct Connect hosted connections to customers through their own network services. Like a standard connection, an interconnect links the partner's network to an Direct Connect location over a standard Ethernet fiber-optic cable. One end is connected to the partner's router, the other to an Direct Connect router.</p>
27/// <p>You can automatically add the new interconnect to a link aggregation group (LAG) by specifying a LAG ID in the request. This ensures that the new interconnect is allocated on the same Direct Connect endpoint that hosts the specified LAG. If there are no available ports on the endpoint, the request fails and no interconnect is created.</p>
28/// <p>For each end customer, the Direct Connect Partner provisions a connection on their interconnect by calling <code>AllocateHostedConnection</code>. The end customer can then connect to Amazon Web Services resources by creating a virtual interface on their connection, using the VLAN assigned to them by the Direct Connect Partner.</p><note>
29/// <p>Intended for use by Direct Connect Partners only.</p>
30/// </note>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateInterconnectFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::create_interconnect::builders::CreateInterconnectInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::create_interconnect::CreateInterconnectOutput,
40        crate::operation::create_interconnect::CreateInterconnectError,
41    > for CreateInterconnectFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::create_interconnect::CreateInterconnectOutput,
49            crate::operation::create_interconnect::CreateInterconnectError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl CreateInterconnectFluentBuilder {
56    /// Creates a new `CreateInterconnectFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the CreateInterconnect as a reference.
65    pub fn as_input(&self) -> &crate::operation::create_interconnect::builders::CreateInterconnectInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::create_interconnect::CreateInterconnectOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::create_interconnect::CreateInterconnectError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::create_interconnect::CreateInterconnect::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::create_interconnect::CreateInterconnect::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::create_interconnect::CreateInterconnectOutput,
102        crate::operation::create_interconnect::CreateInterconnectError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The name of the interconnect.</p>
117    pub fn interconnect_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.interconnect_name(input.into());
119        self
120    }
121    /// <p>The name of the interconnect.</p>
122    pub fn set_interconnect_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_interconnect_name(input);
124        self
125    }
126    /// <p>The name of the interconnect.</p>
127    pub fn get_interconnect_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_interconnect_name()
129    }
130    /// <p>The port bandwidth, in Gbps. The possible values are 1, 10, and 100.</p>
131    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.bandwidth(input.into());
133        self
134    }
135    /// <p>The port bandwidth, in Gbps. The possible values are 1, 10, and 100.</p>
136    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_bandwidth(input);
138        self
139    }
140    /// <p>The port bandwidth, in Gbps. The possible values are 1, 10, and 100.</p>
141    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_bandwidth()
143    }
144    /// <p>The location of the interconnect.</p>
145    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.location(input.into());
147        self
148    }
149    /// <p>The location of the interconnect.</p>
150    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_location(input);
152        self
153    }
154    /// <p>The location of the interconnect.</p>
155    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_location()
157    }
158    /// <p>The ID of the LAG.</p>
159    pub fn lag_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.lag_id(input.into());
161        self
162    }
163    /// <p>The ID of the LAG.</p>
164    pub fn set_lag_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_lag_id(input);
166        self
167    }
168    /// <p>The ID of the LAG.</p>
169    pub fn get_lag_id(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_lag_id()
171    }
172    ///
173    /// Appends an item to `tags`.
174    ///
175    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
176    ///
177    /// <p>The tags to associate with the interconnect.</p>
178    pub fn tags(mut self, input: crate::types::Tag) -> Self {
179        self.inner = self.inner.tags(input);
180        self
181    }
182    /// <p>The tags to associate with the interconnect.</p>
183    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
184        self.inner = self.inner.set_tags(input);
185        self
186    }
187    /// <p>The tags to associate with the interconnect.</p>
188    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
189        self.inner.get_tags()
190    }
191    /// <p>The name of the service provider associated with the interconnect.</p>
192    pub fn provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.provider_name(input.into());
194        self
195    }
196    /// <p>The name of the service provider associated with the interconnect.</p>
197    pub fn set_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.inner = self.inner.set_provider_name(input);
199        self
200    }
201    /// <p>The name of the service provider associated with the interconnect.</p>
202    pub fn get_provider_name(&self) -> &::std::option::Option<::std::string::String> {
203        self.inner.get_provider_name()
204    }
205}