Skip to main content

aws_sdk_backupexternal/operation/get_node/
_get_node_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, ::std::fmt::Debug)]
5pub struct GetNodeOutput {
6    /// The Amazon Resource Name (ARN) of the appliance.
7    pub appliance_arn: ::std::string::String,
8    /// The Amazon Resource Name (ARN) of the appliance node.
9    pub node_arn: ::std::string::String,
10    /// The IP address of the appliance node.
11    pub ip_address: ::std::string::String,
12    /// The environment in which the appliance runs.
13    pub environment_type: crate::types::ApplianceEnvironmentType,
14    /// The management status of the appliance node.
15    pub node_management_status: crate::types::NodeManagementStatus,
16    /// The health status of the appliance node.
17    pub health_status: ::std::option::Option<crate::types::NodeHealthStatus>,
18    /// The notifications for the appliance node.
19    pub notifications: ::std::option::Option<::std::vec::Vec<crate::types::Notification>>,
20    /// The date and time that the appliance node was created.
21    pub created_at: ::aws_smithy_types::DateTime,
22    /// The date and time that the appliance node was deleted.
23    pub deleted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24    /// The software version of the appliance node.
25    pub software_version: ::std::option::Option<::std::string::String>,
26    /// The tags associated with the resource.
27    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28    _request_id: Option<String>,
29}
30impl GetNodeOutput {
31    /// The Amazon Resource Name (ARN) of the appliance.
32    pub fn appliance_arn(&self) -> &str {
33        use std::ops::Deref;
34        self.appliance_arn.deref()
35    }
36    /// The Amazon Resource Name (ARN) of the appliance node.
37    pub fn node_arn(&self) -> &str {
38        use std::ops::Deref;
39        self.node_arn.deref()
40    }
41    /// The IP address of the appliance node.
42    pub fn ip_address(&self) -> &str {
43        use std::ops::Deref;
44        self.ip_address.deref()
45    }
46    /// The environment in which the appliance runs.
47    pub fn environment_type(&self) -> &crate::types::ApplianceEnvironmentType {
48        &self.environment_type
49    }
50    /// The management status of the appliance node.
51    pub fn node_management_status(&self) -> &crate::types::NodeManagementStatus {
52        &self.node_management_status
53    }
54    /// The health status of the appliance node.
55    pub fn health_status(&self) -> ::std::option::Option<&crate::types::NodeHealthStatus> {
56        self.health_status.as_ref()
57    }
58    /// The notifications for the appliance node.
59    ///
60    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.notifications.is_none()`.
61    pub fn notifications(&self) -> &[crate::types::Notification] {
62        self.notifications.as_deref().unwrap_or_default()
63    }
64    /// The date and time that the appliance node was created.
65    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
66        &self.created_at
67    }
68    /// The date and time that the appliance node was deleted.
69    pub fn deleted_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
70        self.deleted_at.as_ref()
71    }
72    /// The software version of the appliance node.
73    pub fn software_version(&self) -> ::std::option::Option<&str> {
74        self.software_version.as_deref()
75    }
76    /// The tags associated with the resource.
77    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
78        self.tags.as_ref()
79    }
80}
81impl ::aws_types::request_id::RequestId for GetNodeOutput {
82    fn request_id(&self) -> Option<&str> {
83        self._request_id.as_deref()
84    }
85}
86impl GetNodeOutput {
87    /// Creates a new builder-style object to manufacture [`GetNodeOutput`](crate::operation::get_node::GetNodeOutput).
88    pub fn builder() -> crate::operation::get_node::builders::GetNodeOutputBuilder {
89        crate::operation::get_node::builders::GetNodeOutputBuilder::default()
90    }
91}
92
93/// A builder for [`GetNodeOutput`](crate::operation::get_node::GetNodeOutput).
94#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
95#[non_exhaustive]
96pub struct GetNodeOutputBuilder {
97    pub(crate) appliance_arn: ::std::option::Option<::std::string::String>,
98    pub(crate) node_arn: ::std::option::Option<::std::string::String>,
99    pub(crate) ip_address: ::std::option::Option<::std::string::String>,
100    pub(crate) environment_type: ::std::option::Option<crate::types::ApplianceEnvironmentType>,
101    pub(crate) node_management_status: ::std::option::Option<crate::types::NodeManagementStatus>,
102    pub(crate) health_status: ::std::option::Option<crate::types::NodeHealthStatus>,
103    pub(crate) notifications: ::std::option::Option<::std::vec::Vec<crate::types::Notification>>,
104    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
105    pub(crate) deleted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
106    pub(crate) software_version: ::std::option::Option<::std::string::String>,
107    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
108    _request_id: Option<String>,
109}
110impl GetNodeOutputBuilder {
111    /// The Amazon Resource Name (ARN) of the appliance.
112    /// This field is required.
113    pub fn appliance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.appliance_arn = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// The Amazon Resource Name (ARN) of the appliance.
118    pub fn set_appliance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.appliance_arn = input;
120        self
121    }
122    /// The Amazon Resource Name (ARN) of the appliance.
123    pub fn get_appliance_arn(&self) -> &::std::option::Option<::std::string::String> {
124        &self.appliance_arn
125    }
126    /// The Amazon Resource Name (ARN) of the appliance node.
127    /// This field is required.
128    pub fn node_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.node_arn = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// The Amazon Resource Name (ARN) of the appliance node.
133    pub fn set_node_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.node_arn = input;
135        self
136    }
137    /// The Amazon Resource Name (ARN) of the appliance node.
138    pub fn get_node_arn(&self) -> &::std::option::Option<::std::string::String> {
139        &self.node_arn
140    }
141    /// The IP address of the appliance node.
142    /// This field is required.
143    pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.ip_address = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// The IP address of the appliance node.
148    pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.ip_address = input;
150        self
151    }
152    /// The IP address of the appliance node.
153    pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
154        &self.ip_address
155    }
156    /// The environment in which the appliance runs.
157    /// This field is required.
158    pub fn environment_type(mut self, input: crate::types::ApplianceEnvironmentType) -> Self {
159        self.environment_type = ::std::option::Option::Some(input);
160        self
161    }
162    /// The environment in which the appliance runs.
163    pub fn set_environment_type(mut self, input: ::std::option::Option<crate::types::ApplianceEnvironmentType>) -> Self {
164        self.environment_type = input;
165        self
166    }
167    /// The environment in which the appliance runs.
168    pub fn get_environment_type(&self) -> &::std::option::Option<crate::types::ApplianceEnvironmentType> {
169        &self.environment_type
170    }
171    /// The management status of the appliance node.
172    /// This field is required.
173    pub fn node_management_status(mut self, input: crate::types::NodeManagementStatus) -> Self {
174        self.node_management_status = ::std::option::Option::Some(input);
175        self
176    }
177    /// The management status of the appliance node.
178    pub fn set_node_management_status(mut self, input: ::std::option::Option<crate::types::NodeManagementStatus>) -> Self {
179        self.node_management_status = input;
180        self
181    }
182    /// The management status of the appliance node.
183    pub fn get_node_management_status(&self) -> &::std::option::Option<crate::types::NodeManagementStatus> {
184        &self.node_management_status
185    }
186    /// The health status of the appliance node.
187    pub fn health_status(mut self, input: crate::types::NodeHealthStatus) -> Self {
188        self.health_status = ::std::option::Option::Some(input);
189        self
190    }
191    /// The health status of the appliance node.
192    pub fn set_health_status(mut self, input: ::std::option::Option<crate::types::NodeHealthStatus>) -> Self {
193        self.health_status = input;
194        self
195    }
196    /// The health status of the appliance node.
197    pub fn get_health_status(&self) -> &::std::option::Option<crate::types::NodeHealthStatus> {
198        &self.health_status
199    }
200    /// Appends an item to `notifications`.
201    ///
202    /// To override the contents of this collection use [`set_notifications`](Self::set_notifications).
203    ///
204    /// The notifications for the appliance node.
205    pub fn notifications(mut self, input: crate::types::Notification) -> Self {
206        let mut v = self.notifications.unwrap_or_default();
207        v.push(input);
208        self.notifications = ::std::option::Option::Some(v);
209        self
210    }
211    /// The notifications for the appliance node.
212    pub fn set_notifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Notification>>) -> Self {
213        self.notifications = input;
214        self
215    }
216    /// The notifications for the appliance node.
217    pub fn get_notifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Notification>> {
218        &self.notifications
219    }
220    /// The date and time that the appliance node was created.
221    /// This field is required.
222    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
223        self.created_at = ::std::option::Option::Some(input);
224        self
225    }
226    /// The date and time that the appliance node was created.
227    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
228        self.created_at = input;
229        self
230    }
231    /// The date and time that the appliance node was created.
232    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
233        &self.created_at
234    }
235    /// The date and time that the appliance node was deleted.
236    pub fn deleted_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
237        self.deleted_at = ::std::option::Option::Some(input);
238        self
239    }
240    /// The date and time that the appliance node was deleted.
241    pub fn set_deleted_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
242        self.deleted_at = input;
243        self
244    }
245    /// The date and time that the appliance node was deleted.
246    pub fn get_deleted_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
247        &self.deleted_at
248    }
249    /// The software version of the appliance node.
250    pub fn software_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251        self.software_version = ::std::option::Option::Some(input.into());
252        self
253    }
254    /// The software version of the appliance node.
255    pub fn set_software_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256        self.software_version = input;
257        self
258    }
259    /// The software version of the appliance node.
260    pub fn get_software_version(&self) -> &::std::option::Option<::std::string::String> {
261        &self.software_version
262    }
263    /// Adds a key-value pair to `tags`.
264    ///
265    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
266    ///
267    /// The tags associated with the resource.
268    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
269        let mut hash_map = self.tags.unwrap_or_default();
270        hash_map.insert(k.into(), v.into());
271        self.tags = ::std::option::Option::Some(hash_map);
272        self
273    }
274    /// The tags associated with the resource.
275    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
276        self.tags = input;
277        self
278    }
279    /// The tags associated with the resource.
280    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
281        &self.tags
282    }
283    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
284        self._request_id = Some(request_id.into());
285        self
286    }
287
288    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
289        self._request_id = request_id;
290        self
291    }
292    /// Consumes the builder and constructs a [`GetNodeOutput`](crate::operation::get_node::GetNodeOutput).
293    /// This method will fail if any of the following fields are not set:
294    /// - [`appliance_arn`](crate::operation::get_node::builders::GetNodeOutputBuilder::appliance_arn)
295    /// - [`node_arn`](crate::operation::get_node::builders::GetNodeOutputBuilder::node_arn)
296    /// - [`ip_address`](crate::operation::get_node::builders::GetNodeOutputBuilder::ip_address)
297    /// - [`environment_type`](crate::operation::get_node::builders::GetNodeOutputBuilder::environment_type)
298    /// - [`node_management_status`](crate::operation::get_node::builders::GetNodeOutputBuilder::node_management_status)
299    /// - [`created_at`](crate::operation::get_node::builders::GetNodeOutputBuilder::created_at)
300    pub fn build(self) -> ::std::result::Result<crate::operation::get_node::GetNodeOutput, ::aws_smithy_types::error::operation::BuildError> {
301        ::std::result::Result::Ok(crate::operation::get_node::GetNodeOutput {
302            appliance_arn: self.appliance_arn.ok_or_else(|| {
303                ::aws_smithy_types::error::operation::BuildError::missing_field(
304                    "appliance_arn",
305                    "appliance_arn was not specified but it is required when building GetNodeOutput",
306                )
307            })?,
308            node_arn: self.node_arn.ok_or_else(|| {
309                ::aws_smithy_types::error::operation::BuildError::missing_field(
310                    "node_arn",
311                    "node_arn was not specified but it is required when building GetNodeOutput",
312                )
313            })?,
314            ip_address: self.ip_address.ok_or_else(|| {
315                ::aws_smithy_types::error::operation::BuildError::missing_field(
316                    "ip_address",
317                    "ip_address was not specified but it is required when building GetNodeOutput",
318                )
319            })?,
320            environment_type: self.environment_type.ok_or_else(|| {
321                ::aws_smithy_types::error::operation::BuildError::missing_field(
322                    "environment_type",
323                    "environment_type was not specified but it is required when building GetNodeOutput",
324                )
325            })?,
326            node_management_status: self.node_management_status.ok_or_else(|| {
327                ::aws_smithy_types::error::operation::BuildError::missing_field(
328                    "node_management_status",
329                    "node_management_status was not specified but it is required when building GetNodeOutput",
330                )
331            })?,
332            health_status: self.health_status,
333            notifications: self.notifications,
334            created_at: self.created_at.ok_or_else(|| {
335                ::aws_smithy_types::error::operation::BuildError::missing_field(
336                    "created_at",
337                    "created_at was not specified but it is required when building GetNodeOutput",
338                )
339            })?,
340            deleted_at: self.deleted_at,
341            software_version: self.software_version,
342            tags: self.tags,
343            _request_id: self._request_id,
344        })
345    }
346}