Skip to main content

aws_sdk_datazone/operation/create_connection/
_create_connection_output.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)]
5pub struct CreateConnectionOutput {
6    /// <p>The ID of the connection.</p>
7    pub connection_id: ::std::string::String,
8    /// <p>The configurations of the connection.</p>
9    pub configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
10    /// <p>The connection description.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the domain where the connection is created.</p>
13    pub domain_id: ::std::string::String,
14    /// <p>The ID of the domain unit where the connection is created.</p>
15    pub domain_unit_id: ::std::string::String,
16    /// <p>The ID of the environment where the connection is created.</p>
17    pub environment_id: ::std::option::Option<::std::string::String>,
18    /// <p>The connection name.</p>
19    pub name: ::std::string::String,
20    /// <p>The physical endpoints of the connection.</p>
21    pub physical_endpoints: ::std::vec::Vec<crate::types::PhysicalEndpoint>,
22    /// <p>The ID of the project where the connection is created.</p>
23    pub project_id: ::std::option::Option<::std::string::String>,
24    /// <p>The connection props.</p>
25    pub props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
26    /// <p>The connection type.</p>
27    pub r#type: crate::types::ConnectionType,
28    /// <p>The scope of the connection.</p>
29    pub scope: ::std::option::Option<crate::types::ConnectionScope>,
30    _request_id: Option<String>,
31}
32impl CreateConnectionOutput {
33    /// <p>The ID of the connection.</p>
34    pub fn connection_id(&self) -> &str {
35        use std::ops::Deref;
36        self.connection_id.deref()
37    }
38    /// <p>The configurations of the connection.</p>
39    ///
40    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.configurations.is_none()`.
41    pub fn configurations(&self) -> &[crate::types::Configuration] {
42        self.configurations.as_deref().unwrap_or_default()
43    }
44    /// <p>The connection description.</p>
45    pub fn description(&self) -> ::std::option::Option<&str> {
46        self.description.as_deref()
47    }
48    /// <p>The ID of the domain where the connection is created.</p>
49    pub fn domain_id(&self) -> &str {
50        use std::ops::Deref;
51        self.domain_id.deref()
52    }
53    /// <p>The ID of the domain unit where the connection is created.</p>
54    pub fn domain_unit_id(&self) -> &str {
55        use std::ops::Deref;
56        self.domain_unit_id.deref()
57    }
58    /// <p>The ID of the environment where the connection is created.</p>
59    pub fn environment_id(&self) -> ::std::option::Option<&str> {
60        self.environment_id.as_deref()
61    }
62    /// <p>The connection name.</p>
63    pub fn name(&self) -> &str {
64        use std::ops::Deref;
65        self.name.deref()
66    }
67    /// <p>The physical endpoints of the connection.</p>
68    pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
69        use std::ops::Deref;
70        self.physical_endpoints.deref()
71    }
72    /// <p>The ID of the project where the connection is created.</p>
73    pub fn project_id(&self) -> ::std::option::Option<&str> {
74        self.project_id.as_deref()
75    }
76    /// <p>The connection props.</p>
77    pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
78        self.props.as_ref()
79    }
80    /// <p>The connection type.</p>
81    pub fn r#type(&self) -> &crate::types::ConnectionType {
82        &self.r#type
83    }
84    /// <p>The scope of the connection.</p>
85    pub fn scope(&self) -> ::std::option::Option<&crate::types::ConnectionScope> {
86        self.scope.as_ref()
87    }
88}
89impl ::std::fmt::Debug for CreateConnectionOutput {
90    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
91        let mut formatter = f.debug_struct("CreateConnectionOutput");
92        formatter.field("connection_id", &self.connection_id);
93        formatter.field("configurations", &self.configurations);
94        formatter.field("description", &"*** Sensitive Data Redacted ***");
95        formatter.field("domain_id", &self.domain_id);
96        formatter.field("domain_unit_id", &self.domain_unit_id);
97        formatter.field("environment_id", &self.environment_id);
98        formatter.field("name", &self.name);
99        formatter.field("physical_endpoints", &self.physical_endpoints);
100        formatter.field("project_id", &self.project_id);
101        formatter.field("props", &self.props);
102        formatter.field("r#type", &self.r#type);
103        formatter.field("scope", &self.scope);
104        formatter.field("_request_id", &self._request_id);
105        formatter.finish()
106    }
107}
108impl ::aws_types::request_id::RequestId for CreateConnectionOutput {
109    fn request_id(&self) -> Option<&str> {
110        self._request_id.as_deref()
111    }
112}
113impl CreateConnectionOutput {
114    /// Creates a new builder-style object to manufacture [`CreateConnectionOutput`](crate::operation::create_connection::CreateConnectionOutput).
115    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionOutputBuilder {
116        crate::operation::create_connection::builders::CreateConnectionOutputBuilder::default()
117    }
118}
119
120/// A builder for [`CreateConnectionOutput`](crate::operation::create_connection::CreateConnectionOutput).
121#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
122#[non_exhaustive]
123pub struct CreateConnectionOutputBuilder {
124    pub(crate) connection_id: ::std::option::Option<::std::string::String>,
125    pub(crate) configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
126    pub(crate) description: ::std::option::Option<::std::string::String>,
127    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
128    pub(crate) domain_unit_id: ::std::option::Option<::std::string::String>,
129    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
130    pub(crate) name: ::std::option::Option<::std::string::String>,
131    pub(crate) physical_endpoints: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>,
132    pub(crate) project_id: ::std::option::Option<::std::string::String>,
133    pub(crate) props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
134    pub(crate) r#type: ::std::option::Option<crate::types::ConnectionType>,
135    pub(crate) scope: ::std::option::Option<crate::types::ConnectionScope>,
136    _request_id: Option<String>,
137}
138impl CreateConnectionOutputBuilder {
139    /// <p>The ID of the connection.</p>
140    /// This field is required.
141    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.connection_id = ::std::option::Option::Some(input.into());
143        self
144    }
145    /// <p>The ID of the connection.</p>
146    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.connection_id = input;
148        self
149    }
150    /// <p>The ID of the connection.</p>
151    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
152        &self.connection_id
153    }
154    /// Appends an item to `configurations`.
155    ///
156    /// To override the contents of this collection use [`set_configurations`](Self::set_configurations).
157    ///
158    /// <p>The configurations of the connection.</p>
159    pub fn configurations(mut self, input: crate::types::Configuration) -> Self {
160        let mut v = self.configurations.unwrap_or_default();
161        v.push(input);
162        self.configurations = ::std::option::Option::Some(v);
163        self
164    }
165    /// <p>The configurations of the connection.</p>
166    pub fn set_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>) -> Self {
167        self.configurations = input;
168        self
169    }
170    /// <p>The configurations of the connection.</p>
171    pub fn get_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Configuration>> {
172        &self.configurations
173    }
174    /// <p>The connection description.</p>
175    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.description = ::std::option::Option::Some(input.into());
177        self
178    }
179    /// <p>The connection description.</p>
180    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.description = input;
182        self
183    }
184    /// <p>The connection description.</p>
185    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
186        &self.description
187    }
188    /// <p>The ID of the domain where the connection is created.</p>
189    /// This field is required.
190    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.domain_id = ::std::option::Option::Some(input.into());
192        self
193    }
194    /// <p>The ID of the domain where the connection is created.</p>
195    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.domain_id = input;
197        self
198    }
199    /// <p>The ID of the domain where the connection is created.</p>
200    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
201        &self.domain_id
202    }
203    /// <p>The ID of the domain unit where the connection is created.</p>
204    /// This field is required.
205    pub fn domain_unit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.domain_unit_id = ::std::option::Option::Some(input.into());
207        self
208    }
209    /// <p>The ID of the domain unit where the connection is created.</p>
210    pub fn set_domain_unit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.domain_unit_id = input;
212        self
213    }
214    /// <p>The ID of the domain unit where the connection is created.</p>
215    pub fn get_domain_unit_id(&self) -> &::std::option::Option<::std::string::String> {
216        &self.domain_unit_id
217    }
218    /// <p>The ID of the environment where the connection is created.</p>
219    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.environment_id = ::std::option::Option::Some(input.into());
221        self
222    }
223    /// <p>The ID of the environment where the connection is created.</p>
224    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225        self.environment_id = input;
226        self
227    }
228    /// <p>The ID of the environment where the connection is created.</p>
229    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
230        &self.environment_id
231    }
232    /// <p>The connection name.</p>
233    /// This field is required.
234    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.name = ::std::option::Option::Some(input.into());
236        self
237    }
238    /// <p>The connection name.</p>
239    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.name = input;
241        self
242    }
243    /// <p>The connection name.</p>
244    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
245        &self.name
246    }
247    /// Appends an item to `physical_endpoints`.
248    ///
249    /// To override the contents of this collection use [`set_physical_endpoints`](Self::set_physical_endpoints).
250    ///
251    /// <p>The physical endpoints of the connection.</p>
252    pub fn physical_endpoints(mut self, input: crate::types::PhysicalEndpoint) -> Self {
253        let mut v = self.physical_endpoints.unwrap_or_default();
254        v.push(input);
255        self.physical_endpoints = ::std::option::Option::Some(v);
256        self
257    }
258    /// <p>The physical endpoints of the connection.</p>
259    pub fn set_physical_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>) -> Self {
260        self.physical_endpoints = input;
261        self
262    }
263    /// <p>The physical endpoints of the connection.</p>
264    pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
265        &self.physical_endpoints
266    }
267    /// <p>The ID of the project where the connection is created.</p>
268    pub fn project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269        self.project_id = ::std::option::Option::Some(input.into());
270        self
271    }
272    /// <p>The ID of the project where the connection is created.</p>
273    pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.project_id = input;
275        self
276    }
277    /// <p>The ID of the project where the connection is created.</p>
278    pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
279        &self.project_id
280    }
281    /// <p>The connection props.</p>
282    pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
283        self.props = ::std::option::Option::Some(input);
284        self
285    }
286    /// <p>The connection props.</p>
287    pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
288        self.props = input;
289        self
290    }
291    /// <p>The connection props.</p>
292    pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
293        &self.props
294    }
295    /// <p>The connection type.</p>
296    /// This field is required.
297    pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
298        self.r#type = ::std::option::Option::Some(input);
299        self
300    }
301    /// <p>The connection type.</p>
302    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
303        self.r#type = input;
304        self
305    }
306    /// <p>The connection type.</p>
307    pub fn get_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
308        &self.r#type
309    }
310    /// <p>The scope of the connection.</p>
311    pub fn scope(mut self, input: crate::types::ConnectionScope) -> Self {
312        self.scope = ::std::option::Option::Some(input);
313        self
314    }
315    /// <p>The scope of the connection.</p>
316    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::ConnectionScope>) -> Self {
317        self.scope = input;
318        self
319    }
320    /// <p>The scope of the connection.</p>
321    pub fn get_scope(&self) -> &::std::option::Option<crate::types::ConnectionScope> {
322        &self.scope
323    }
324    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
325        self._request_id = Some(request_id.into());
326        self
327    }
328
329    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
330        self._request_id = request_id;
331        self
332    }
333    /// Consumes the builder and constructs a [`CreateConnectionOutput`](crate::operation::create_connection::CreateConnectionOutput).
334    /// This method will fail if any of the following fields are not set:
335    /// - [`connection_id`](crate::operation::create_connection::builders::CreateConnectionOutputBuilder::connection_id)
336    /// - [`domain_id`](crate::operation::create_connection::builders::CreateConnectionOutputBuilder::domain_id)
337    /// - [`domain_unit_id`](crate::operation::create_connection::builders::CreateConnectionOutputBuilder::domain_unit_id)
338    /// - [`name`](crate::operation::create_connection::builders::CreateConnectionOutputBuilder::name)
339    /// - [`physical_endpoints`](crate::operation::create_connection::builders::CreateConnectionOutputBuilder::physical_endpoints)
340    /// - [`r#type`](crate::operation::create_connection::builders::CreateConnectionOutputBuilder::type)
341    pub fn build(
342        self,
343    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionOutput, ::aws_smithy_types::error::operation::BuildError> {
344        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionOutput {
345            connection_id: self.connection_id.ok_or_else(|| {
346                ::aws_smithy_types::error::operation::BuildError::missing_field(
347                    "connection_id",
348                    "connection_id was not specified but it is required when building CreateConnectionOutput",
349                )
350            })?,
351            configurations: self.configurations,
352            description: self.description,
353            domain_id: self.domain_id.ok_or_else(|| {
354                ::aws_smithy_types::error::operation::BuildError::missing_field(
355                    "domain_id",
356                    "domain_id was not specified but it is required when building CreateConnectionOutput",
357                )
358            })?,
359            domain_unit_id: self.domain_unit_id.ok_or_else(|| {
360                ::aws_smithy_types::error::operation::BuildError::missing_field(
361                    "domain_unit_id",
362                    "domain_unit_id was not specified but it is required when building CreateConnectionOutput",
363                )
364            })?,
365            environment_id: self.environment_id,
366            name: self.name.ok_or_else(|| {
367                ::aws_smithy_types::error::operation::BuildError::missing_field(
368                    "name",
369                    "name was not specified but it is required when building CreateConnectionOutput",
370                )
371            })?,
372            physical_endpoints: self.physical_endpoints.ok_or_else(|| {
373                ::aws_smithy_types::error::operation::BuildError::missing_field(
374                    "physical_endpoints",
375                    "physical_endpoints was not specified but it is required when building CreateConnectionOutput",
376                )
377            })?,
378            project_id: self.project_id,
379            props: self.props,
380            r#type: self.r#type.ok_or_else(|| {
381                ::aws_smithy_types::error::operation::BuildError::missing_field(
382                    "r#type",
383                    "r#type was not specified but it is required when building CreateConnectionOutput",
384                )
385            })?,
386            scope: self.scope,
387            _request_id: self._request_id,
388        })
389    }
390}
391impl ::std::fmt::Debug for CreateConnectionOutputBuilder {
392    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
393        let mut formatter = f.debug_struct("CreateConnectionOutputBuilder");
394        formatter.field("connection_id", &self.connection_id);
395        formatter.field("configurations", &self.configurations);
396        formatter.field("description", &"*** Sensitive Data Redacted ***");
397        formatter.field("domain_id", &self.domain_id);
398        formatter.field("domain_unit_id", &self.domain_unit_id);
399        formatter.field("environment_id", &self.environment_id);
400        formatter.field("name", &self.name);
401        formatter.field("physical_endpoints", &self.physical_endpoints);
402        formatter.field("project_id", &self.project_id);
403        formatter.field("props", &self.props);
404        formatter.field("r#type", &self.r#type);
405        formatter.field("scope", &self.scope);
406        formatter.field("_request_id", &self._request_id);
407        formatter.finish()
408    }
409}