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 pub scope: ::std::option::Option<crate::types::ConnectionScope>,
32 _request_id: Option<String>,
33}
34impl GetConnectionOutput {
35 pub fn connection_credentials(&self) -> ::std::option::Option<&crate::types::ConnectionCredentials> {
37 self.connection_credentials.as_ref()
38 }
39 pub fn connection_id(&self) -> &str {
41 use std::ops::Deref;
42 self.connection_id.deref()
43 }
44 pub fn description(&self) -> ::std::option::Option<&str> {
46 self.description.as_deref()
47 }
48 pub fn domain_id(&self) -> &str {
50 use std::ops::Deref;
51 self.domain_id.deref()
52 }
53 pub fn domain_unit_id(&self) -> &str {
55 use std::ops::Deref;
56 self.domain_unit_id.deref()
57 }
58 pub fn environment_id(&self) -> ::std::option::Option<&str> {
60 self.environment_id.as_deref()
61 }
62 pub fn environment_user_role(&self) -> ::std::option::Option<&str> {
64 self.environment_user_role.as_deref()
65 }
66 pub fn name(&self) -> &str {
68 use std::ops::Deref;
69 self.name.deref()
70 }
71 pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
73 use std::ops::Deref;
74 self.physical_endpoints.deref()
75 }
76 pub fn project_id(&self) -> ::std::option::Option<&str> {
78 self.project_id.as_deref()
79 }
80 pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
82 self.props.as_ref()
83 }
84 pub fn r#type(&self) -> &crate::types::ConnectionType {
86 &self.r#type
87 }
88 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 pub fn builder() -> crate::operation::get_connection::builders::GetConnectionOutputBuilder {
121 crate::operation::get_connection::builders::GetConnectionOutputBuilder::default()
122 }
123}
124
125#[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 pub fn connection_credentials(mut self, input: crate::types::ConnectionCredentials) -> Self {
147 self.connection_credentials = ::std::option::Option::Some(input);
148 self
149 }
150 pub fn set_connection_credentials(mut self, input: ::std::option::Option<crate::types::ConnectionCredentials>) -> Self {
152 self.connection_credentials = input;
153 self
154 }
155 pub fn get_connection_credentials(&self) -> &::std::option::Option<crate::types::ConnectionCredentials> {
157 &self.connection_credentials
158 }
159 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 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.connection_id = input;
168 self
169 }
170 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
172 &self.connection_id
173 }
174 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181 self.description = input;
182 self
183 }
184 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
186 &self.description
187 }
188 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.domain_id = input;
197 self
198 }
199 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
201 &self.domain_id
202 }
203 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 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 pub fn get_domain_unit_id(&self) -> &::std::option::Option<::std::string::String> {
216 &self.domain_unit_id
217 }
218 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 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.environment_id = input;
226 self
227 }
228 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
230 &self.environment_id
231 }
232 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 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 pub fn get_environment_user_role(&self) -> &::std::option::Option<::std::string::String> {
244 &self.environment_user_role
245 }
246 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254 self.name = input;
255 self
256 }
257 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
259 &self.name
260 }
261 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 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 pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
279 &self.physical_endpoints
280 }
281 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 pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288 self.project_id = input;
289 self
290 }
291 pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
293 &self.project_id
294 }
295 pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
297 self.props = ::std::option::Option::Some(input);
298 self
299 }
300 pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
302 self.props = input;
303 self
304 }
305 pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
307 &self.props
308 }
309 pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
312 self.r#type = ::std::option::Option::Some(input);
313 self
314 }
315 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
317 self.r#type = input;
318 self
319 }
320 pub fn get_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
322 &self.r#type
323 }
324 pub fn scope(mut self, input: crate::types::ConnectionScope) -> Self {
326 self.scope = ::std::option::Option::Some(input);
327 self
328 }
329 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::ConnectionScope>) -> Self {
331 self.scope = input;
332 self
333 }
334 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 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}