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