aws_sdk_datazone/operation/create_connection/
_create_connection_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateConnectionOutput {
6 pub connection_id: ::std::string::String,
8 pub configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
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 name: ::std::string::String,
20 pub physical_endpoints: ::std::vec::Vec<crate::types::PhysicalEndpoint>,
22 pub project_id: ::std::option::Option<::std::string::String>,
24 pub props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
26 pub r#type: crate::types::ConnectionType,
28 pub scope: ::std::option::Option<crate::types::ConnectionScope>,
30 _request_id: Option<String>,
31}
32impl CreateConnectionOutput {
33 pub fn connection_id(&self) -> &str {
35 use std::ops::Deref;
36 self.connection_id.deref()
37 }
38 pub fn configurations(&self) -> &[crate::types::Configuration] {
42 self.configurations.as_deref().unwrap_or_default()
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 name(&self) -> &str {
64 use std::ops::Deref;
65 self.name.deref()
66 }
67 pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
69 use std::ops::Deref;
70 self.physical_endpoints.deref()
71 }
72 pub fn project_id(&self) -> ::std::option::Option<&str> {
74 self.project_id.as_deref()
75 }
76 pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
78 self.props.as_ref()
79 }
80 pub fn r#type(&self) -> &crate::types::ConnectionType {
82 &self.r#type
83 }
84 pub fn scope(&self) -> ::std::option::Option<&crate::types::ConnectionScope> {
86 self.scope.as_ref()
87 }
88}
89impl ::std::fmt::Debug for CreateConnectionOutput {
90 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
91 let mut formatter = f.debug_struct("CreateConnectionOutput");
92 formatter.field("connection_id", &self.connection_id);
93 formatter.field("configurations", &self.configurations);
94 formatter.field("description", &"*** Sensitive Data Redacted ***");
95 formatter.field("domain_id", &self.domain_id);
96 formatter.field("domain_unit_id", &self.domain_unit_id);
97 formatter.field("environment_id", &self.environment_id);
98 formatter.field("name", &self.name);
99 formatter.field("physical_endpoints", &self.physical_endpoints);
100 formatter.field("project_id", &self.project_id);
101 formatter.field("props", &self.props);
102 formatter.field("r#type", &self.r#type);
103 formatter.field("scope", &self.scope);
104 formatter.field("_request_id", &self._request_id);
105 formatter.finish()
106 }
107}
108impl ::aws_types::request_id::RequestId for CreateConnectionOutput {
109 fn request_id(&self) -> Option<&str> {
110 self._request_id.as_deref()
111 }
112}
113impl CreateConnectionOutput {
114 pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionOutputBuilder {
116 crate::operation::create_connection::builders::CreateConnectionOutputBuilder::default()
117 }
118}
119
120#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
122#[non_exhaustive]
123pub struct CreateConnectionOutputBuilder {
124 pub(crate) connection_id: ::std::option::Option<::std::string::String>,
125 pub(crate) configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
126 pub(crate) description: ::std::option::Option<::std::string::String>,
127 pub(crate) domain_id: ::std::option::Option<::std::string::String>,
128 pub(crate) domain_unit_id: ::std::option::Option<::std::string::String>,
129 pub(crate) environment_id: ::std::option::Option<::std::string::String>,
130 pub(crate) name: ::std::option::Option<::std::string::String>,
131 pub(crate) physical_endpoints: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>,
132 pub(crate) project_id: ::std::option::Option<::std::string::String>,
133 pub(crate) props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
134 pub(crate) r#type: ::std::option::Option<crate::types::ConnectionType>,
135 pub(crate) scope: ::std::option::Option<crate::types::ConnectionScope>,
136 _request_id: Option<String>,
137}
138impl CreateConnectionOutputBuilder {
139 pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.connection_id = ::std::option::Option::Some(input.into());
143 self
144 }
145 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.connection_id = input;
148 self
149 }
150 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
152 &self.connection_id
153 }
154 pub fn configurations(mut self, input: crate::types::Configuration) -> Self {
160 let mut v = self.configurations.unwrap_or_default();
161 v.push(input);
162 self.configurations = ::std::option::Option::Some(v);
163 self
164 }
165 pub fn set_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>) -> Self {
167 self.configurations = input;
168 self
169 }
170 pub fn get_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Configuration>> {
172 &self.configurations
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 name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235 self.name = ::std::option::Option::Some(input.into());
236 self
237 }
238 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240 self.name = input;
241 self
242 }
243 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
245 &self.name
246 }
247 pub fn physical_endpoints(mut self, input: crate::types::PhysicalEndpoint) -> Self {
253 let mut v = self.physical_endpoints.unwrap_or_default();
254 v.push(input);
255 self.physical_endpoints = ::std::option::Option::Some(v);
256 self
257 }
258 pub fn set_physical_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>) -> Self {
260 self.physical_endpoints = input;
261 self
262 }
263 pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
265 &self.physical_endpoints
266 }
267 pub fn project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269 self.project_id = ::std::option::Option::Some(input.into());
270 self
271 }
272 pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274 self.project_id = input;
275 self
276 }
277 pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
279 &self.project_id
280 }
281 pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
283 self.props = ::std::option::Option::Some(input);
284 self
285 }
286 pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
288 self.props = input;
289 self
290 }
291 pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
293 &self.props
294 }
295 pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
298 self.r#type = ::std::option::Option::Some(input);
299 self
300 }
301 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
303 self.r#type = input;
304 self
305 }
306 pub fn get_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
308 &self.r#type
309 }
310 pub fn scope(mut self, input: crate::types::ConnectionScope) -> Self {
312 self.scope = ::std::option::Option::Some(input);
313 self
314 }
315 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::ConnectionScope>) -> Self {
317 self.scope = input;
318 self
319 }
320 pub fn get_scope(&self) -> &::std::option::Option<crate::types::ConnectionScope> {
322 &self.scope
323 }
324 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
325 self._request_id = Some(request_id.into());
326 self
327 }
328
329 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
330 self._request_id = request_id;
331 self
332 }
333 pub fn build(
342 self,
343 ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionOutput, ::aws_smithy_types::error::operation::BuildError> {
344 ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionOutput {
345 connection_id: self.connection_id.ok_or_else(|| {
346 ::aws_smithy_types::error::operation::BuildError::missing_field(
347 "connection_id",
348 "connection_id was not specified but it is required when building CreateConnectionOutput",
349 )
350 })?,
351 configurations: self.configurations,
352 description: self.description,
353 domain_id: self.domain_id.ok_or_else(|| {
354 ::aws_smithy_types::error::operation::BuildError::missing_field(
355 "domain_id",
356 "domain_id was not specified but it is required when building CreateConnectionOutput",
357 )
358 })?,
359 domain_unit_id: self.domain_unit_id.ok_or_else(|| {
360 ::aws_smithy_types::error::operation::BuildError::missing_field(
361 "domain_unit_id",
362 "domain_unit_id was not specified but it is required when building CreateConnectionOutput",
363 )
364 })?,
365 environment_id: self.environment_id,
366 name: self.name.ok_or_else(|| {
367 ::aws_smithy_types::error::operation::BuildError::missing_field(
368 "name",
369 "name was not specified but it is required when building CreateConnectionOutput",
370 )
371 })?,
372 physical_endpoints: self.physical_endpoints.ok_or_else(|| {
373 ::aws_smithy_types::error::operation::BuildError::missing_field(
374 "physical_endpoints",
375 "physical_endpoints was not specified but it is required when building CreateConnectionOutput",
376 )
377 })?,
378 project_id: self.project_id,
379 props: self.props,
380 r#type: self.r#type.ok_or_else(|| {
381 ::aws_smithy_types::error::operation::BuildError::missing_field(
382 "r#type",
383 "r#type was not specified but it is required when building CreateConnectionOutput",
384 )
385 })?,
386 scope: self.scope,
387 _request_id: self._request_id,
388 })
389 }
390}
391impl ::std::fmt::Debug for CreateConnectionOutputBuilder {
392 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
393 let mut formatter = f.debug_struct("CreateConnectionOutputBuilder");
394 formatter.field("connection_id", &self.connection_id);
395 formatter.field("configurations", &self.configurations);
396 formatter.field("description", &"*** Sensitive Data Redacted ***");
397 formatter.field("domain_id", &self.domain_id);
398 formatter.field("domain_unit_id", &self.domain_unit_id);
399 formatter.field("environment_id", &self.environment_id);
400 formatter.field("name", &self.name);
401 formatter.field("physical_endpoints", &self.physical_endpoints);
402 formatter.field("project_id", &self.project_id);
403 formatter.field("props", &self.props);
404 formatter.field("r#type", &self.r#type);
405 formatter.field("scope", &self.scope);
406 formatter.field("_request_id", &self._request_id);
407 formatter.finish()
408 }
409}