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 connection_id: ::std::string::String,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub domain_id: ::std::string::String,
14 pub domain_unit_id: ::std::string::String,
16 pub environment_id: ::std::option::Option<::std::string::String>,
18 pub environment_user_role: ::std::option::Option<::std::string::String>,
20 pub name: ::std::string::String,
22 pub physical_endpoints: ::std::vec::Vec<crate::types::PhysicalEndpoint>,
24 pub project_id: ::std::option::Option<::std::string::String>,
26 pub props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
28 pub r#type: crate::types::ConnectionType,
30 _request_id: Option<String>,
31}
32impl GetConnectionOutput {
33 pub fn connection_credentials(&self) -> ::std::option::Option<&crate::types::ConnectionCredentials> {
35 self.connection_credentials.as_ref()
36 }
37 pub fn connection_id(&self) -> &str {
39 use std::ops::Deref;
40 self.connection_id.deref()
41 }
42 pub fn description(&self) -> ::std::option::Option<&str> {
44 self.description.as_deref()
45 }
46 pub fn domain_id(&self) -> &str {
48 use std::ops::Deref;
49 self.domain_id.deref()
50 }
51 pub fn domain_unit_id(&self) -> &str {
53 use std::ops::Deref;
54 self.domain_unit_id.deref()
55 }
56 pub fn environment_id(&self) -> ::std::option::Option<&str> {
58 self.environment_id.as_deref()
59 }
60 pub fn environment_user_role(&self) -> ::std::option::Option<&str> {
62 self.environment_user_role.as_deref()
63 }
64 pub fn name(&self) -> &str {
66 use std::ops::Deref;
67 self.name.deref()
68 }
69 pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
71 use std::ops::Deref;
72 self.physical_endpoints.deref()
73 }
74 pub fn project_id(&self) -> ::std::option::Option<&str> {
76 self.project_id.as_deref()
77 }
78 pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
80 self.props.as_ref()
81 }
82 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 pub fn builder() -> crate::operation::get_connection::builders::GetConnectionOutputBuilder {
114 crate::operation::get_connection::builders::GetConnectionOutputBuilder::default()
115 }
116}
117
118#[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 pub fn connection_credentials(mut self, input: crate::types::ConnectionCredentials) -> Self {
139 self.connection_credentials = ::std::option::Option::Some(input);
140 self
141 }
142 pub fn set_connection_credentials(mut self, input: ::std::option::Option<crate::types::ConnectionCredentials>) -> Self {
144 self.connection_credentials = input;
145 self
146 }
147 pub fn get_connection_credentials(&self) -> &::std::option::Option<crate::types::ConnectionCredentials> {
149 &self.connection_credentials
150 }
151 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 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.connection_id = input;
160 self
161 }
162 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
164 &self.connection_id
165 }
166 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.description = input;
174 self
175 }
176 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
178 &self.description
179 }
180 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.domain_id = input;
189 self
190 }
191 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
193 &self.domain_id
194 }
195 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 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 pub fn get_domain_unit_id(&self) -> &::std::option::Option<::std::string::String> {
208 &self.domain_unit_id
209 }
210 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 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.environment_id = input;
218 self
219 }
220 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
222 &self.environment_id
223 }
224 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 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 pub fn get_environment_user_role(&self) -> &::std::option::Option<::std::string::String> {
236 &self.environment_user_role
237 }
238 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246 self.name = input;
247 self
248 }
249 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
251 &self.name
252 }
253 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 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 pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
271 &self.physical_endpoints
272 }
273 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 pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280 self.project_id = input;
281 self
282 }
283 pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
285 &self.project_id
286 }
287 pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
289 self.props = ::std::option::Option::Some(input);
290 self
291 }
292 pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
294 self.props = input;
295 self
296 }
297 pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
299 &self.props
300 }
301 pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
304 self.r#type = ::std::option::Option::Some(input);
305 self
306 }
307 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
309 self.r#type = input;
310 self
311 }
312 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 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}