Skip to main content

aws_sdk_directconnect/operation/allocate_connection_on_interconnect/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::allocate_connection_on_interconnect::_allocate_connection_on_interconnect_input::AllocateConnectionOnInterconnectInputBuilder;
3
4pub use crate::operation::allocate_connection_on_interconnect::_allocate_connection_on_interconnect_output::AllocateConnectionOnInterconnectOutputBuilder;
5
6impl crate::operation::allocate_connection_on_interconnect::builders::AllocateConnectionOnInterconnectInputBuilder {
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::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.allocate_connection_on_interconnect();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AllocateConnectionOnInterconnect`.
24///
25/// <note>
26/// <p>Deprecated. Use <code>AllocateHostedConnection</code> instead.</p>
27/// </note>
28/// <p>Creates a hosted connection on an interconnect.</p>
29/// <p>Allocates a VLAN number and a specified amount of bandwidth for use by a hosted connection on the specified interconnect.</p><note>
30/// <p>Intended for use by Direct Connect Partners only.</p>
31/// </note>
32#[deprecated]
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct AllocateConnectionOnInterconnectFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::allocate_connection_on_interconnect::builders::AllocateConnectionOnInterconnectInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectOutput,
42        crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectError,
43    > for AllocateConnectionOnInterconnectFluentBuilder
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::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectOutput,
51            crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl AllocateConnectionOnInterconnectFluentBuilder {
58    /// Creates a new `AllocateConnectionOnInterconnectFluentBuilder`.
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 AllocateConnectionOnInterconnect as a reference.
67    pub fn as_input(&self) -> &crate::operation::allocate_connection_on_interconnect::builders::AllocateConnectionOnInterconnectInputBuilder {
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::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectError,
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::allocate_connection_on_interconnect::AllocateConnectionOnInterconnect::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnect::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::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectOutput,
104        crate::operation::allocate_connection_on_interconnect::AllocateConnectionOnInterconnectError,
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    /// <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, and 10Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps or 10Gbps hosted connection.</p>
119    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.bandwidth(input.into());
121        self
122    }
123    /// <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, and 10Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps or 10Gbps hosted connection.</p>
124    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_bandwidth(input);
126        self
127    }
128    /// <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, and 10Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps or 10Gbps hosted connection.</p>
129    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_bandwidth()
131    }
132    /// <p>The name of the provisioned connection.</p>
133    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.connection_name(input.into());
135        self
136    }
137    /// <p>The name of the provisioned connection.</p>
138    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_connection_name(input);
140        self
141    }
142    /// <p>The name of the provisioned connection.</p>
143    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_connection_name()
145    }
146    /// <p>The ID of the Amazon Web Services account of the customer for whom the connection will be provisioned.</p>
147    pub fn owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.owner_account(input.into());
149        self
150    }
151    /// <p>The ID of the Amazon Web Services account of the customer for whom the connection will be provisioned.</p>
152    pub fn set_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_owner_account(input);
154        self
155    }
156    /// <p>The ID of the Amazon Web Services account of the customer for whom the connection will be provisioned.</p>
157    pub fn get_owner_account(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_owner_account()
159    }
160    /// <p>The ID of the interconnect on which the connection will be provisioned.</p>
161    pub fn interconnect_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.interconnect_id(input.into());
163        self
164    }
165    /// <p>The ID of the interconnect on which the connection will be provisioned.</p>
166    pub fn set_interconnect_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_interconnect_id(input);
168        self
169    }
170    /// <p>The ID of the interconnect on which the connection will be provisioned.</p>
171    pub fn get_interconnect_id(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_interconnect_id()
173    }
174    /// <p>The dedicated VLAN provisioned to the connection.</p>
175    pub fn vlan(mut self, input: i32) -> Self {
176        self.inner = self.inner.vlan(input);
177        self
178    }
179    /// <p>The dedicated VLAN provisioned to the connection.</p>
180    pub fn set_vlan(mut self, input: ::std::option::Option<i32>) -> Self {
181        self.inner = self.inner.set_vlan(input);
182        self
183    }
184    /// <p>The dedicated VLAN provisioned to the connection.</p>
185    pub fn get_vlan(&self) -> &::std::option::Option<i32> {
186        self.inner.get_vlan()
187    }
188}