Skip to main content

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