aws_sdk_datazone/operation/update_connection/
_update_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 UpdateConnectionOutput {
6    /// <p>The ID of the connection.</p>
7    pub connection_id: ::std::string::String,
8    /// <p>The connection description.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The ID of the domain where a connection is to be updated.</p>
11    pub domain_id: ::std::string::String,
12    /// <p>The ID of the domain unit where a connection is to be updated.</p>
13    pub domain_unit_id: ::std::string::String,
14    /// <p>The ID of the environment where a connection is to be updated.</p>
15    pub environment_id: ::std::option::Option<::std::string::String>,
16    /// <p>The name of the connection.</p>
17    pub name: ::std::string::String,
18    /// <p>The physical endpoints of the connection.</p>
19    pub physical_endpoints: ::std::vec::Vec<crate::types::PhysicalEndpoint>,
20    /// <p>The project ID of the connection.</p>
21    pub project_id: ::std::option::Option<::std::string::String>,
22    /// <p>The connection props.</p>
23    pub props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
24    /// <p>The connection type.</p>
25    pub r#type: crate::types::ConnectionType,
26    _request_id: Option<String>,
27}
28impl UpdateConnectionOutput {
29    /// <p>The ID of the connection.</p>
30    pub fn connection_id(&self) -> &str {
31        use std::ops::Deref;
32        self.connection_id.deref()
33    }
34    /// <p>The connection description.</p>
35    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    /// <p>The ID of the domain where a connection is to be updated.</p>
39    pub fn domain_id(&self) -> &str {
40        use std::ops::Deref;
41        self.domain_id.deref()
42    }
43    /// <p>The ID of the domain unit where a connection is to be updated.</p>
44    pub fn domain_unit_id(&self) -> &str {
45        use std::ops::Deref;
46        self.domain_unit_id.deref()
47    }
48    /// <p>The ID of the environment where a connection is to be updated.</p>
49    pub fn environment_id(&self) -> ::std::option::Option<&str> {
50        self.environment_id.as_deref()
51    }
52    /// <p>The name of the connection.</p>
53    pub fn name(&self) -> &str {
54        use std::ops::Deref;
55        self.name.deref()
56    }
57    /// <p>The physical endpoints of the connection.</p>
58    pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
59        use std::ops::Deref;
60        self.physical_endpoints.deref()
61    }
62    /// <p>The project ID of the connection.</p>
63    pub fn project_id(&self) -> ::std::option::Option<&str> {
64        self.project_id.as_deref()
65    }
66    /// <p>The connection props.</p>
67    pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
68        self.props.as_ref()
69    }
70    /// <p>The connection type.</p>
71    pub fn r#type(&self) -> &crate::types::ConnectionType {
72        &self.r#type
73    }
74}
75impl ::std::fmt::Debug for UpdateConnectionOutput {
76    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
77        let mut formatter = f.debug_struct("UpdateConnectionOutput");
78        formatter.field("connection_id", &self.connection_id);
79        formatter.field("description", &"*** Sensitive Data Redacted ***");
80        formatter.field("domain_id", &self.domain_id);
81        formatter.field("domain_unit_id", &self.domain_unit_id);
82        formatter.field("environment_id", &self.environment_id);
83        formatter.field("name", &self.name);
84        formatter.field("physical_endpoints", &self.physical_endpoints);
85        formatter.field("project_id", &self.project_id);
86        formatter.field("props", &self.props);
87        formatter.field("r#type", &self.r#type);
88        formatter.field("_request_id", &self._request_id);
89        formatter.finish()
90    }
91}
92impl ::aws_types::request_id::RequestId for UpdateConnectionOutput {
93    fn request_id(&self) -> Option<&str> {
94        self._request_id.as_deref()
95    }
96}
97impl UpdateConnectionOutput {
98    /// Creates a new builder-style object to manufacture [`UpdateConnectionOutput`](crate::operation::update_connection::UpdateConnectionOutput).
99    pub fn builder() -> crate::operation::update_connection::builders::UpdateConnectionOutputBuilder {
100        crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::default()
101    }
102}
103
104/// A builder for [`UpdateConnectionOutput`](crate::operation::update_connection::UpdateConnectionOutput).
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
106#[non_exhaustive]
107pub struct UpdateConnectionOutputBuilder {
108    pub(crate) connection_id: ::std::option::Option<::std::string::String>,
109    pub(crate) description: ::std::option::Option<::std::string::String>,
110    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
111    pub(crate) domain_unit_id: ::std::option::Option<::std::string::String>,
112    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
113    pub(crate) name: ::std::option::Option<::std::string::String>,
114    pub(crate) physical_endpoints: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>,
115    pub(crate) project_id: ::std::option::Option<::std::string::String>,
116    pub(crate) props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
117    pub(crate) r#type: ::std::option::Option<crate::types::ConnectionType>,
118    _request_id: Option<String>,
119}
120impl UpdateConnectionOutputBuilder {
121    /// <p>The ID of the connection.</p>
122    /// This field is required.
123    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.connection_id = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The ID of the connection.</p>
128    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.connection_id = input;
130        self
131    }
132    /// <p>The ID of the connection.</p>
133    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.connection_id
135    }
136    /// <p>The connection description.</p>
137    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.description = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The connection description.</p>
142    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.description = input;
144        self
145    }
146    /// <p>The connection description.</p>
147    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
148        &self.description
149    }
150    /// <p>The ID of the domain where a connection is to be updated.</p>
151    /// This field is required.
152    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.domain_id = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The ID of the domain where a connection is to be updated.</p>
157    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.domain_id = input;
159        self
160    }
161    /// <p>The ID of the domain where a connection is to be updated.</p>
162    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
163        &self.domain_id
164    }
165    /// <p>The ID of the domain unit where a connection is to be updated.</p>
166    /// This field is required.
167    pub fn domain_unit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.domain_unit_id = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>The ID of the domain unit where a connection is to be updated.</p>
172    pub fn set_domain_unit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.domain_unit_id = input;
174        self
175    }
176    /// <p>The ID of the domain unit where a connection is to be updated.</p>
177    pub fn get_domain_unit_id(&self) -> &::std::option::Option<::std::string::String> {
178        &self.domain_unit_id
179    }
180    /// <p>The ID of the environment where a connection is to be updated.</p>
181    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.environment_id = ::std::option::Option::Some(input.into());
183        self
184    }
185    /// <p>The ID of the environment where a connection is to be updated.</p>
186    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.environment_id = input;
188        self
189    }
190    /// <p>The ID of the environment where a connection is to be updated.</p>
191    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
192        &self.environment_id
193    }
194    /// <p>The name of the connection.</p>
195    /// This field is required.
196    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.name = ::std::option::Option::Some(input.into());
198        self
199    }
200    /// <p>The name of the connection.</p>
201    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.name = input;
203        self
204    }
205    /// <p>The name of the connection.</p>
206    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
207        &self.name
208    }
209    /// Appends an item to `physical_endpoints`.
210    ///
211    /// To override the contents of this collection use [`set_physical_endpoints`](Self::set_physical_endpoints).
212    ///
213    /// <p>The physical endpoints of the connection.</p>
214    pub fn physical_endpoints(mut self, input: crate::types::PhysicalEndpoint) -> Self {
215        let mut v = self.physical_endpoints.unwrap_or_default();
216        v.push(input);
217        self.physical_endpoints = ::std::option::Option::Some(v);
218        self
219    }
220    /// <p>The physical endpoints of the connection.</p>
221    pub fn set_physical_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>) -> Self {
222        self.physical_endpoints = input;
223        self
224    }
225    /// <p>The physical endpoints of the connection.</p>
226    pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
227        &self.physical_endpoints
228    }
229    /// <p>The project ID of the connection.</p>
230    pub fn project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.project_id = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>The project ID of the connection.</p>
235    pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.project_id = input;
237        self
238    }
239    /// <p>The project ID of the connection.</p>
240    pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
241        &self.project_id
242    }
243    /// <p>The connection props.</p>
244    pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
245        self.props = ::std::option::Option::Some(input);
246        self
247    }
248    /// <p>The connection props.</p>
249    pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
250        self.props = input;
251        self
252    }
253    /// <p>The connection props.</p>
254    pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
255        &self.props
256    }
257    /// <p>The connection type.</p>
258    /// This field is required.
259    pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
260        self.r#type = ::std::option::Option::Some(input);
261        self
262    }
263    /// <p>The connection type.</p>
264    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
265        self.r#type = input;
266        self
267    }
268    /// <p>The connection type.</p>
269    pub fn get_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
270        &self.r#type
271    }
272    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
273        self._request_id = Some(request_id.into());
274        self
275    }
276
277    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
278        self._request_id = request_id;
279        self
280    }
281    /// Consumes the builder and constructs a [`UpdateConnectionOutput`](crate::operation::update_connection::UpdateConnectionOutput).
282    /// This method will fail if any of the following fields are not set:
283    /// - [`connection_id`](crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::connection_id)
284    /// - [`domain_id`](crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::domain_id)
285    /// - [`domain_unit_id`](crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::domain_unit_id)
286    /// - [`name`](crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::name)
287    /// - [`physical_endpoints`](crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::physical_endpoints)
288    /// - [`r#type`](crate::operation::update_connection::builders::UpdateConnectionOutputBuilder::type)
289    pub fn build(
290        self,
291    ) -> ::std::result::Result<crate::operation::update_connection::UpdateConnectionOutput, ::aws_smithy_types::error::operation::BuildError> {
292        ::std::result::Result::Ok(crate::operation::update_connection::UpdateConnectionOutput {
293            connection_id: self.connection_id.ok_or_else(|| {
294                ::aws_smithy_types::error::operation::BuildError::missing_field(
295                    "connection_id",
296                    "connection_id was not specified but it is required when building UpdateConnectionOutput",
297                )
298            })?,
299            description: self.description,
300            domain_id: self.domain_id.ok_or_else(|| {
301                ::aws_smithy_types::error::operation::BuildError::missing_field(
302                    "domain_id",
303                    "domain_id was not specified but it is required when building UpdateConnectionOutput",
304                )
305            })?,
306            domain_unit_id: self.domain_unit_id.ok_or_else(|| {
307                ::aws_smithy_types::error::operation::BuildError::missing_field(
308                    "domain_unit_id",
309                    "domain_unit_id was not specified but it is required when building UpdateConnectionOutput",
310                )
311            })?,
312            environment_id: self.environment_id,
313            name: self.name.ok_or_else(|| {
314                ::aws_smithy_types::error::operation::BuildError::missing_field(
315                    "name",
316                    "name was not specified but it is required when building UpdateConnectionOutput",
317                )
318            })?,
319            physical_endpoints: self.physical_endpoints.ok_or_else(|| {
320                ::aws_smithy_types::error::operation::BuildError::missing_field(
321                    "physical_endpoints",
322                    "physical_endpoints was not specified but it is required when building UpdateConnectionOutput",
323                )
324            })?,
325            project_id: self.project_id,
326            props: self.props,
327            r#type: self.r#type.ok_or_else(|| {
328                ::aws_smithy_types::error::operation::BuildError::missing_field(
329                    "r#type",
330                    "r#type was not specified but it is required when building UpdateConnectionOutput",
331                )
332            })?,
333            _request_id: self._request_id,
334        })
335    }
336}
337impl ::std::fmt::Debug for UpdateConnectionOutputBuilder {
338    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
339        let mut formatter = f.debug_struct("UpdateConnectionOutputBuilder");
340        formatter.field("connection_id", &self.connection_id);
341        formatter.field("description", &"*** Sensitive Data Redacted ***");
342        formatter.field("domain_id", &self.domain_id);
343        formatter.field("domain_unit_id", &self.domain_unit_id);
344        formatter.field("environment_id", &self.environment_id);
345        formatter.field("name", &self.name);
346        formatter.field("physical_endpoints", &self.physical_endpoints);
347        formatter.field("project_id", &self.project_id);
348        formatter.field("props", &self.props);
349        formatter.field("r#type", &self.r#type);
350        formatter.field("_request_id", &self._request_id);
351        formatter.finish()
352    }
353}