aws_sdk_backupgateway/types/
_virtual_machine_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Your <code>VirtualMachine</code> objects, ordered by their Amazon Resource Names (ARNs).</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VirtualMachineDetails {
7    /// <p>The host name of the virtual machine.</p>
8    pub host_name: ::std::option::Option<::std::string::String>,
9    /// <p>The ID of the virtual machine's hypervisor.</p>
10    pub hypervisor_id: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the virtual machine.</p>
12    pub name: ::std::option::Option<::std::string::String>,
13    /// <p>The path of the virtual machine.</p>
14    pub path: ::std::option::Option<::std::string::String>,
15    /// <p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>
16    pub resource_arn: ::std::option::Option<::std::string::String>,
17    /// <p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>
18    pub last_backup_date: ::std::option::Option<::aws_smithy_types::DateTime>,
19    /// <p>These are the details of the VMware tags associated with the specified virtual machine.</p>
20    pub vmware_tags: ::std::option::Option<::std::vec::Vec<crate::types::VmwareTag>>,
21}
22impl VirtualMachineDetails {
23    /// <p>The host name of the virtual machine.</p>
24    pub fn host_name(&self) -> ::std::option::Option<&str> {
25        self.host_name.as_deref()
26    }
27    /// <p>The ID of the virtual machine's hypervisor.</p>
28    pub fn hypervisor_id(&self) -> ::std::option::Option<&str> {
29        self.hypervisor_id.as_deref()
30    }
31    /// <p>The name of the virtual machine.</p>
32    pub fn name(&self) -> ::std::option::Option<&str> {
33        self.name.as_deref()
34    }
35    /// <p>The path of the virtual machine.</p>
36    pub fn path(&self) -> ::std::option::Option<&str> {
37        self.path.as_deref()
38    }
39    /// <p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>
40    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
41        self.resource_arn.as_deref()
42    }
43    /// <p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>
44    pub fn last_backup_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
45        self.last_backup_date.as_ref()
46    }
47    /// <p>These are the details of the VMware tags associated with the specified virtual machine.</p>
48    ///
49    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.vmware_tags.is_none()`.
50    pub fn vmware_tags(&self) -> &[crate::types::VmwareTag] {
51        self.vmware_tags.as_deref().unwrap_or_default()
52    }
53}
54impl VirtualMachineDetails {
55    /// Creates a new builder-style object to manufacture [`VirtualMachineDetails`](crate::types::VirtualMachineDetails).
56    pub fn builder() -> crate::types::builders::VirtualMachineDetailsBuilder {
57        crate::types::builders::VirtualMachineDetailsBuilder::default()
58    }
59}
60
61/// A builder for [`VirtualMachineDetails`](crate::types::VirtualMachineDetails).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct VirtualMachineDetailsBuilder {
65    pub(crate) host_name: ::std::option::Option<::std::string::String>,
66    pub(crate) hypervisor_id: ::std::option::Option<::std::string::String>,
67    pub(crate) name: ::std::option::Option<::std::string::String>,
68    pub(crate) path: ::std::option::Option<::std::string::String>,
69    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
70    pub(crate) last_backup_date: ::std::option::Option<::aws_smithy_types::DateTime>,
71    pub(crate) vmware_tags: ::std::option::Option<::std::vec::Vec<crate::types::VmwareTag>>,
72}
73impl VirtualMachineDetailsBuilder {
74    /// <p>The host name of the virtual machine.</p>
75    pub fn host_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.host_name = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The host name of the virtual machine.</p>
80    pub fn set_host_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.host_name = input;
82        self
83    }
84    /// <p>The host name of the virtual machine.</p>
85    pub fn get_host_name(&self) -> &::std::option::Option<::std::string::String> {
86        &self.host_name
87    }
88    /// <p>The ID of the virtual machine's hypervisor.</p>
89    pub fn hypervisor_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.hypervisor_id = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The ID of the virtual machine's hypervisor.</p>
94    pub fn set_hypervisor_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.hypervisor_id = input;
96        self
97    }
98    /// <p>The ID of the virtual machine's hypervisor.</p>
99    pub fn get_hypervisor_id(&self) -> &::std::option::Option<::std::string::String> {
100        &self.hypervisor_id
101    }
102    /// <p>The name of the virtual machine.</p>
103    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.name = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The name of the virtual machine.</p>
108    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.name = input;
110        self
111    }
112    /// <p>The name of the virtual machine.</p>
113    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
114        &self.name
115    }
116    /// <p>The path of the virtual machine.</p>
117    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.path = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The path of the virtual machine.</p>
122    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.path = input;
124        self
125    }
126    /// <p>The path of the virtual machine.</p>
127    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
128        &self.path
129    }
130    /// <p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>
131    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.resource_arn = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>
136    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.resource_arn = input;
138        self
139    }
140    /// <p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>
141    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
142        &self.resource_arn
143    }
144    /// <p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>
145    pub fn last_backup_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
146        self.last_backup_date = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>
150    pub fn set_last_backup_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
151        self.last_backup_date = input;
152        self
153    }
154    /// <p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>
155    pub fn get_last_backup_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
156        &self.last_backup_date
157    }
158    /// Appends an item to `vmware_tags`.
159    ///
160    /// To override the contents of this collection use [`set_vmware_tags`](Self::set_vmware_tags).
161    ///
162    /// <p>These are the details of the VMware tags associated with the specified virtual machine.</p>
163    pub fn vmware_tags(mut self, input: crate::types::VmwareTag) -> Self {
164        let mut v = self.vmware_tags.unwrap_or_default();
165        v.push(input);
166        self.vmware_tags = ::std::option::Option::Some(v);
167        self
168    }
169    /// <p>These are the details of the VMware tags associated with the specified virtual machine.</p>
170    pub fn set_vmware_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VmwareTag>>) -> Self {
171        self.vmware_tags = input;
172        self
173    }
174    /// <p>These are the details of the VMware tags associated with the specified virtual machine.</p>
175    pub fn get_vmware_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VmwareTag>> {
176        &self.vmware_tags
177    }
178    /// Consumes the builder and constructs a [`VirtualMachineDetails`](crate::types::VirtualMachineDetails).
179    pub fn build(self) -> crate::types::VirtualMachineDetails {
180        crate::types::VirtualMachineDetails {
181            host_name: self.host_name,
182            hypervisor_id: self.hypervisor_id,
183            name: self.name,
184            path: self.path,
185            resource_arn: self.resource_arn,
186            last_backup_date: self.last_backup_date,
187            vmware_tags: self.vmware_tags,
188        }
189    }
190}