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