aws_sdk_datazone/operation/get_connection/
_get_connection_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetConnectionOutput {
6 pub connection_credentials: ::std::option::Option<crate::types::ConnectionCredentials>,
8 pub configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
10 pub connection_id: ::std::string::String,
12 pub description: ::std::option::Option<::std::string::String>,
14 pub domain_id: ::std::string::String,
16 pub domain_unit_id: ::std::string::String,
18 pub environment_id: ::std::option::Option<::std::string::String>,
20 pub environment_user_role: ::std::option::Option<::std::string::String>,
22 pub name: ::std::string::String,
24 pub physical_endpoints: ::std::vec::Vec<crate::types::PhysicalEndpoint>,
26 pub project_id: ::std::option::Option<::std::string::String>,
28 pub props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
30 pub r#type: crate::types::ConnectionType,
32 pub scope: ::std::option::Option<crate::types::ConnectionScope>,
34 _request_id: Option<String>,
35}
36impl GetConnectionOutput {
37 pub fn connection_credentials(&self) -> ::std::option::Option<&crate::types::ConnectionCredentials> {
39 self.connection_credentials.as_ref()
40 }
41 pub fn configurations(&self) -> &[crate::types::Configuration] {
45 self.configurations.as_deref().unwrap_or_default()
46 }
47 pub fn connection_id(&self) -> &str {
49 use std::ops::Deref;
50 self.connection_id.deref()
51 }
52 pub fn description(&self) -> ::std::option::Option<&str> {
54 self.description.as_deref()
55 }
56 pub fn domain_id(&self) -> &str {
58 use std::ops::Deref;
59 self.domain_id.deref()
60 }
61 pub fn domain_unit_id(&self) -> &str {
63 use std::ops::Deref;
64 self.domain_unit_id.deref()
65 }
66 pub fn environment_id(&self) -> ::std::option::Option<&str> {
68 self.environment_id.as_deref()
69 }
70 pub fn environment_user_role(&self) -> ::std::option::Option<&str> {
72 self.environment_user_role.as_deref()
73 }
74 pub fn name(&self) -> &str {
76 use std::ops::Deref;
77 self.name.deref()
78 }
79 pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
81 use std::ops::Deref;
82 self.physical_endpoints.deref()
83 }
84 pub fn project_id(&self) -> ::std::option::Option<&str> {
86 self.project_id.as_deref()
87 }
88 pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
90 self.props.as_ref()
91 }
92 pub fn r#type(&self) -> &crate::types::ConnectionType {
94 &self.r#type
95 }
96 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 pub fn builder() -> crate::operation::get_connection::builders::GetConnectionOutputBuilder {
130 crate::operation::get_connection::builders::GetConnectionOutputBuilder::default()
131 }
132}
133
134#[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 pub fn connection_credentials(mut self, input: crate::types::ConnectionCredentials) -> Self {
157 self.connection_credentials = ::std::option::Option::Some(input);
158 self
159 }
160 pub fn set_connection_credentials(mut self, input: ::std::option::Option<crate::types::ConnectionCredentials>) -> Self {
162 self.connection_credentials = input;
163 self
164 }
165 pub fn get_connection_credentials(&self) -> &::std::option::Option<crate::types::ConnectionCredentials> {
167 &self.connection_credentials
168 }
169 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 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 pub fn get_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Configuration>> {
187 &self.configurations
188 }
189 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 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.connection_id = input;
198 self
199 }
200 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
202 &self.connection_id
203 }
204 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211 self.description = input;
212 self
213 }
214 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
216 &self.description
217 }
218 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226 self.domain_id = input;
227 self
228 }
229 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
231 &self.domain_id
232 }
233 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 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 pub fn get_domain_unit_id(&self) -> &::std::option::Option<::std::string::String> {
246 &self.domain_unit_id
247 }
248 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 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255 self.environment_id = input;
256 self
257 }
258 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
260 &self.environment_id
261 }
262 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 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 pub fn get_environment_user_role(&self) -> &::std::option::Option<::std::string::String> {
274 &self.environment_user_role
275 }
276 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
284 self.name = input;
285 self
286 }
287 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
289 &self.name
290 }
291 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 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 pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
309 &self.physical_endpoints
310 }
311 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 pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
318 self.project_id = input;
319 self
320 }
321 pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
323 &self.project_id
324 }
325 pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
327 self.props = ::std::option::Option::Some(input);
328 self
329 }
330 pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
332 self.props = input;
333 self
334 }
335 pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
337 &self.props
338 }
339 pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
342 self.r#type = ::std::option::Option::Some(input);
343 self
344 }
345 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
347 self.r#type = input;
348 self
349 }
350 pub fn get_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
352 &self.r#type
353 }
354 pub fn scope(mut self, input: crate::types::ConnectionScope) -> Self {
356 self.scope = ::std::option::Option::Some(input);
357 self
358 }
359 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::ConnectionScope>) -> Self {
361 self.scope = input;
362 self
363 }
364 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 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}