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