aws_sdk_backup/types/_protected_resource.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A structure that contains information about a backed-up resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ProtectedResource {
7 /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
8 pub resource_arn: ::std::option::Option<::std::string::String>,
9 /// <p>The type of Amazon Web Services resource; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.</p>
10 pub resource_type: ::std::option::Option<::std::string::String>,
11 /// <p>The date and time a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of <code>LastBackupTime</code> is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.</p>
12 pub last_backup_time: ::std::option::Option<::aws_smithy_types::DateTime>,
13 /// <p>The non-unique name of the resource that belongs to the specified backup.</p>
14 pub resource_name: ::std::option::Option<::std::string::String>,
15 /// <p>The ARN (Amazon Resource Name) of the backup vault that contains the most recent backup recovery point.</p>
16 pub last_backup_vault_arn: ::std::option::Option<::std::string::String>,
17 /// <p>The ARN (Amazon Resource Name) of the most recent recovery point.</p>
18 pub last_recovery_point_arn: ::std::option::Option<::std::string::String>,
19}
20impl ProtectedResource {
21 /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
22 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
23 self.resource_arn.as_deref()
24 }
25 /// <p>The type of Amazon Web Services resource; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.</p>
26 pub fn resource_type(&self) -> ::std::option::Option<&str> {
27 self.resource_type.as_deref()
28 }
29 /// <p>The date and time a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of <code>LastBackupTime</code> is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.</p>
30 pub fn last_backup_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
31 self.last_backup_time.as_ref()
32 }
33 /// <p>The non-unique name of the resource that belongs to the specified backup.</p>
34 pub fn resource_name(&self) -> ::std::option::Option<&str> {
35 self.resource_name.as_deref()
36 }
37 /// <p>The ARN (Amazon Resource Name) of the backup vault that contains the most recent backup recovery point.</p>
38 pub fn last_backup_vault_arn(&self) -> ::std::option::Option<&str> {
39 self.last_backup_vault_arn.as_deref()
40 }
41 /// <p>The ARN (Amazon Resource Name) of the most recent recovery point.</p>
42 pub fn last_recovery_point_arn(&self) -> ::std::option::Option<&str> {
43 self.last_recovery_point_arn.as_deref()
44 }
45}
46impl ProtectedResource {
47 /// Creates a new builder-style object to manufacture [`ProtectedResource`](crate::types::ProtectedResource).
48 pub fn builder() -> crate::types::builders::ProtectedResourceBuilder {
49 crate::types::builders::ProtectedResourceBuilder::default()
50 }
51}
52
53/// A builder for [`ProtectedResource`](crate::types::ProtectedResource).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct ProtectedResourceBuilder {
57 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
58 pub(crate) resource_type: ::std::option::Option<::std::string::String>,
59 pub(crate) last_backup_time: ::std::option::Option<::aws_smithy_types::DateTime>,
60 pub(crate) resource_name: ::std::option::Option<::std::string::String>,
61 pub(crate) last_backup_vault_arn: ::std::option::Option<::std::string::String>,
62 pub(crate) last_recovery_point_arn: ::std::option::Option<::std::string::String>,
63}
64impl ProtectedResourceBuilder {
65 /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
66 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.resource_arn = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
71 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.resource_arn = input;
73 self
74 }
75 /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
76 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
77 &self.resource_arn
78 }
79 /// <p>The type of Amazon Web Services resource; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.</p>
80 pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.resource_type = ::std::option::Option::Some(input.into());
82 self
83 }
84 /// <p>The type of Amazon Web Services resource; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.</p>
85 pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.resource_type = input;
87 self
88 }
89 /// <p>The type of Amazon Web Services resource; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.</p>
90 pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
91 &self.resource_type
92 }
93 /// <p>The date and time a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of <code>LastBackupTime</code> is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.</p>
94 pub fn last_backup_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
95 self.last_backup_time = ::std::option::Option::Some(input);
96 self
97 }
98 /// <p>The date and time a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of <code>LastBackupTime</code> is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.</p>
99 pub fn set_last_backup_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
100 self.last_backup_time = input;
101 self
102 }
103 /// <p>The date and time a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of <code>LastBackupTime</code> is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.</p>
104 pub fn get_last_backup_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
105 &self.last_backup_time
106 }
107 /// <p>The non-unique name of the resource that belongs to the specified backup.</p>
108 pub fn resource_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109 self.resource_name = ::std::option::Option::Some(input.into());
110 self
111 }
112 /// <p>The non-unique name of the resource that belongs to the specified backup.</p>
113 pub fn set_resource_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.resource_name = input;
115 self
116 }
117 /// <p>The non-unique name of the resource that belongs to the specified backup.</p>
118 pub fn get_resource_name(&self) -> &::std::option::Option<::std::string::String> {
119 &self.resource_name
120 }
121 /// <p>The ARN (Amazon Resource Name) of the backup vault that contains the most recent backup recovery point.</p>
122 pub fn last_backup_vault_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.last_backup_vault_arn = ::std::option::Option::Some(input.into());
124 self
125 }
126 /// <p>The ARN (Amazon Resource Name) of the backup vault that contains the most recent backup recovery point.</p>
127 pub fn set_last_backup_vault_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.last_backup_vault_arn = input;
129 self
130 }
131 /// <p>The ARN (Amazon Resource Name) of the backup vault that contains the most recent backup recovery point.</p>
132 pub fn get_last_backup_vault_arn(&self) -> &::std::option::Option<::std::string::String> {
133 &self.last_backup_vault_arn
134 }
135 /// <p>The ARN (Amazon Resource Name) of the most recent recovery point.</p>
136 pub fn last_recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.last_recovery_point_arn = ::std::option::Option::Some(input.into());
138 self
139 }
140 /// <p>The ARN (Amazon Resource Name) of the most recent recovery point.</p>
141 pub fn set_last_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.last_recovery_point_arn = input;
143 self
144 }
145 /// <p>The ARN (Amazon Resource Name) of the most recent recovery point.</p>
146 pub fn get_last_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> {
147 &self.last_recovery_point_arn
148 }
149 /// Consumes the builder and constructs a [`ProtectedResource`](crate::types::ProtectedResource).
150 pub fn build(self) -> crate::types::ProtectedResource {
151 crate::types::ProtectedResource {
152 resource_arn: self.resource_arn,
153 resource_type: self.resource_type,
154 last_backup_time: self.last_backup_time,
155 resource_name: self.resource_name,
156 last_backup_vault_arn: self.last_backup_vault_arn,
157 last_recovery_point_arn: self.last_recovery_point_arn,
158 }
159 }
160}