Skip to main content

aws_sdk_interconnect/operation/create_connection/
_create_connection_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateConnectionInput {
6    /// <p>A description to distinguish this <code>Connection</code>.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
9    pub bandwidth: ::std::option::Option<::std::string::String>,
10    /// <p>The Attach Point to which the connection should be associated."</p>
11    pub attach_point: ::std::option::Option<crate::types::AttachPoint>,
12    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
13    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
14    pub environment_id: ::std::option::Option<::std::string::String>,
15    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
16    pub remote_account: ::std::option::Option<crate::types::RemoteAccountIdentifier>,
17    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
18    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
19    /// <p>Idempotency token used for the request.</p>
20    pub client_token: ::std::option::Option<::std::string::String>,
21}
22impl CreateConnectionInput {
23    /// <p>A description to distinguish this <code>Connection</code>.</p>
24    pub fn description(&self) -> ::std::option::Option<&str> {
25        self.description.as_deref()
26    }
27    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
28    pub fn bandwidth(&self) -> ::std::option::Option<&str> {
29        self.bandwidth.as_deref()
30    }
31    /// <p>The Attach Point to which the connection should be associated."</p>
32    pub fn attach_point(&self) -> ::std::option::Option<&crate::types::AttachPoint> {
33        self.attach_point.as_ref()
34    }
35    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
36    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
37    pub fn environment_id(&self) -> ::std::option::Option<&str> {
38        self.environment_id.as_deref()
39    }
40    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
41    pub fn remote_account(&self) -> ::std::option::Option<&crate::types::RemoteAccountIdentifier> {
42        self.remote_account.as_ref()
43    }
44    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
45    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
46        self.tags.as_ref()
47    }
48    /// <p>Idempotency token used for the request.</p>
49    pub fn client_token(&self) -> ::std::option::Option<&str> {
50        self.client_token.as_deref()
51    }
52}
53impl CreateConnectionInput {
54    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
55    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
56        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateConnectionInputBuilder {
64    pub(crate) description: ::std::option::Option<::std::string::String>,
65    pub(crate) bandwidth: ::std::option::Option<::std::string::String>,
66    pub(crate) attach_point: ::std::option::Option<crate::types::AttachPoint>,
67    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
68    pub(crate) remote_account: ::std::option::Option<crate::types::RemoteAccountIdentifier>,
69    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
70    pub(crate) client_token: ::std::option::Option<::std::string::String>,
71}
72impl CreateConnectionInputBuilder {
73    /// <p>A description to distinguish this <code>Connection</code>.</p>
74    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.description = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A description to distinguish this <code>Connection</code>.</p>
79    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.description = input;
81        self
82    }
83    /// <p>A description to distinguish this <code>Connection</code>.</p>
84    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
85        &self.description
86    }
87    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
88    /// This field is required.
89    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.bandwidth = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
94    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.bandwidth = input;
96        self
97    }
98    /// <p>The desired bandwidth of the requested <code>Connection</code></p>
99    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
100        &self.bandwidth
101    }
102    /// <p>The Attach Point to which the connection should be associated."</p>
103    /// This field is required.
104    pub fn attach_point(mut self, input: crate::types::AttachPoint) -> Self {
105        self.attach_point = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The Attach Point to which the connection should be associated."</p>
109    pub fn set_attach_point(mut self, input: ::std::option::Option<crate::types::AttachPoint>) -> Self {
110        self.attach_point = input;
111        self
112    }
113    /// <p>The Attach Point to which the connection should be associated."</p>
114    pub fn get_attach_point(&self) -> &::std::option::Option<crate::types::AttachPoint> {
115        &self.attach_point
116    }
117    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
118    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
119    /// This field is required.
120    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.environment_id = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
125    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
126    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.environment_id = input;
128        self
129    }
130    /// <p>The identifier of the <code>Environment</code> across which this <code>Connection</code> should be created.</p>
131    /// <p>The available <code>Environment</code> objects can be determined using <code>ListEnvironments</code>.</p>
132    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.environment_id
134    }
135    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
136    pub fn remote_account(mut self, input: crate::types::RemoteAccountIdentifier) -> Self {
137        self.remote_account = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
141    pub fn set_remote_account(mut self, input: ::std::option::Option<crate::types::RemoteAccountIdentifier>) -> Self {
142        self.remote_account = input;
143        self
144    }
145    /// <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
146    pub fn get_remote_account(&self) -> &::std::option::Option<crate::types::RemoteAccountIdentifier> {
147        &self.remote_account
148    }
149    /// Adds a key-value pair to `tags`.
150    ///
151    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
152    ///
153    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
154    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
155        let mut hash_map = self.tags.unwrap_or_default();
156        hash_map.insert(k.into(), v.into());
157        self.tags = ::std::option::Option::Some(hash_map);
158        self
159    }
160    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
161    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
162        self.tags = input;
163        self
164    }
165    /// <p>The tag to associate with the resulting <code>Connection</code>.</p>
166    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
167        &self.tags
168    }
169    /// <p>Idempotency token used for the request.</p>
170    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.client_token = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>Idempotency token used for the request.</p>
175    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.client_token = input;
177        self
178    }
179    /// <p>Idempotency token used for the request.</p>
180    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
181        &self.client_token
182    }
183    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
184    pub fn build(
185        self,
186    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
187        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
188            description: self.description,
189            bandwidth: self.bandwidth,
190            attach_point: self.attach_point,
191            environment_id: self.environment_id,
192            remote_account: self.remote_account,
193            tags: self.tags,
194            client_token: self.client_token,
195        })
196    }
197}