aws_sdk_s3/types/_part.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for elements related to a part.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Part {
7 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
8 pub part_number: ::std::option::Option<i32>,
9 /// <p>Date and time at which the part was uploaded.</p>
10 pub last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
11 /// <p>Entity tag returned when the part was uploaded.</p>
12 pub e_tag: ::std::option::Option<::std::string::String>,
13 /// <p>Size in bytes of the uploaded part data.</p>
14 pub size: ::std::option::Option<i64>,
15 /// <p>The Base64 encoded, 32-bit <code>CRC32</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
16 pub checksum_crc32: ::std::option::Option<::std::string::String>,
17 /// <p>The Base64 encoded, 32-bit <code>CRC32C</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32C</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
18 pub checksum_crc32_c: ::std::option::Option<::std::string::String>,
19 /// <p>The Base64 encoded, 64-bit <code>CRC64NVME</code> checksum of the part. This checksum is present if the multipart upload request was created with the <code>CRC64NVME</code> checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, <code>CRC64NVME</code>, to the uploaded object). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
20 pub checksum_crc64_nvme: ::std::option::Option<::std::string::String>,
21 /// <p>The Base64 encoded, 160-bit <code>SHA1</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA1</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
22 pub checksum_sha1: ::std::option::Option<::std::string::String>,
23 /// <p>The Base64 encoded, 256-bit <code>SHA256</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA256</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
24 pub checksum_sha256: ::std::option::Option<::std::string::String>,
25}
26impl Part {
27 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
28 pub fn part_number(&self) -> ::std::option::Option<i32> {
29 self.part_number
30 }
31 /// <p>Date and time at which the part was uploaded.</p>
32 pub fn last_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
33 self.last_modified.as_ref()
34 }
35 /// <p>Entity tag returned when the part was uploaded.</p>
36 pub fn e_tag(&self) -> ::std::option::Option<&str> {
37 self.e_tag.as_deref()
38 }
39 /// <p>Size in bytes of the uploaded part data.</p>
40 pub fn size(&self) -> ::std::option::Option<i64> {
41 self.size
42 }
43 /// <p>The Base64 encoded, 32-bit <code>CRC32</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
44 pub fn checksum_crc32(&self) -> ::std::option::Option<&str> {
45 self.checksum_crc32.as_deref()
46 }
47 /// <p>The Base64 encoded, 32-bit <code>CRC32C</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32C</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
48 pub fn checksum_crc32_c(&self) -> ::std::option::Option<&str> {
49 self.checksum_crc32_c.as_deref()
50 }
51 /// <p>The Base64 encoded, 64-bit <code>CRC64NVME</code> checksum of the part. This checksum is present if the multipart upload request was created with the <code>CRC64NVME</code> checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, <code>CRC64NVME</code>, to the uploaded object). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
52 pub fn checksum_crc64_nvme(&self) -> ::std::option::Option<&str> {
53 self.checksum_crc64_nvme.as_deref()
54 }
55 /// <p>The Base64 encoded, 160-bit <code>SHA1</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA1</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
56 pub fn checksum_sha1(&self) -> ::std::option::Option<&str> {
57 self.checksum_sha1.as_deref()
58 }
59 /// <p>The Base64 encoded, 256-bit <code>SHA256</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA256</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
60 pub fn checksum_sha256(&self) -> ::std::option::Option<&str> {
61 self.checksum_sha256.as_deref()
62 }
63}
64impl Part {
65 /// Creates a new builder-style object to manufacture [`Part`](crate::types::Part).
66 pub fn builder() -> crate::types::builders::PartBuilder {
67 crate::types::builders::PartBuilder::default()
68 }
69}
70
71/// A builder for [`Part`](crate::types::Part).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
73#[non_exhaustive]
74pub struct PartBuilder {
75 pub(crate) part_number: ::std::option::Option<i32>,
76 pub(crate) last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
77 pub(crate) e_tag: ::std::option::Option<::std::string::String>,
78 pub(crate) size: ::std::option::Option<i64>,
79 pub(crate) checksum_crc32: ::std::option::Option<::std::string::String>,
80 pub(crate) checksum_crc32_c: ::std::option::Option<::std::string::String>,
81 pub(crate) checksum_crc64_nvme: ::std::option::Option<::std::string::String>,
82 pub(crate) checksum_sha1: ::std::option::Option<::std::string::String>,
83 pub(crate) checksum_sha256: ::std::option::Option<::std::string::String>,
84}
85impl PartBuilder {
86 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
87 pub fn part_number(mut self, input: i32) -> Self {
88 self.part_number = ::std::option::Option::Some(input);
89 self
90 }
91 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
92 pub fn set_part_number(mut self, input: ::std::option::Option<i32>) -> Self {
93 self.part_number = input;
94 self
95 }
96 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
97 pub fn get_part_number(&self) -> &::std::option::Option<i32> {
98 &self.part_number
99 }
100 /// <p>Date and time at which the part was uploaded.</p>
101 pub fn last_modified(mut self, input: ::aws_smithy_types::DateTime) -> Self {
102 self.last_modified = ::std::option::Option::Some(input);
103 self
104 }
105 /// <p>Date and time at which the part was uploaded.</p>
106 pub fn set_last_modified(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
107 self.last_modified = input;
108 self
109 }
110 /// <p>Date and time at which the part was uploaded.</p>
111 pub fn get_last_modified(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
112 &self.last_modified
113 }
114 /// <p>Entity tag returned when the part was uploaded.</p>
115 pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.e_tag = ::std::option::Option::Some(input.into());
117 self
118 }
119 /// <p>Entity tag returned when the part was uploaded.</p>
120 pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.e_tag = input;
122 self
123 }
124 /// <p>Entity tag returned when the part was uploaded.</p>
125 pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
126 &self.e_tag
127 }
128 /// <p>Size in bytes of the uploaded part data.</p>
129 pub fn size(mut self, input: i64) -> Self {
130 self.size = ::std::option::Option::Some(input);
131 self
132 }
133 /// <p>Size in bytes of the uploaded part data.</p>
134 pub fn set_size(mut self, input: ::std::option::Option<i64>) -> Self {
135 self.size = input;
136 self
137 }
138 /// <p>Size in bytes of the uploaded part data.</p>
139 pub fn get_size(&self) -> &::std::option::Option<i64> {
140 &self.size
141 }
142 /// <p>The Base64 encoded, 32-bit <code>CRC32</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
143 pub fn checksum_crc32(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.checksum_crc32 = ::std::option::Option::Some(input.into());
145 self
146 }
147 /// <p>The Base64 encoded, 32-bit <code>CRC32</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
148 pub fn set_checksum_crc32(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.checksum_crc32 = input;
150 self
151 }
152 /// <p>The Base64 encoded, 32-bit <code>CRC32</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
153 pub fn get_checksum_crc32(&self) -> &::std::option::Option<::std::string::String> {
154 &self.checksum_crc32
155 }
156 /// <p>The Base64 encoded, 32-bit <code>CRC32C</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32C</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
157 pub fn checksum_crc32_c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.checksum_crc32_c = ::std::option::Option::Some(input.into());
159 self
160 }
161 /// <p>The Base64 encoded, 32-bit <code>CRC32C</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32C</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
162 pub fn set_checksum_crc32_c(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.checksum_crc32_c = input;
164 self
165 }
166 /// <p>The Base64 encoded, 32-bit <code>CRC32C</code> checksum of the part. This checksum is present if the object was uploaded with the <code>CRC32C</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
167 pub fn get_checksum_crc32_c(&self) -> &::std::option::Option<::std::string::String> {
168 &self.checksum_crc32_c
169 }
170 /// <p>The Base64 encoded, 64-bit <code>CRC64NVME</code> checksum of the part. This checksum is present if the multipart upload request was created with the <code>CRC64NVME</code> checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, <code>CRC64NVME</code>, to the uploaded object). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
171 pub fn checksum_crc64_nvme(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.checksum_crc64_nvme = ::std::option::Option::Some(input.into());
173 self
174 }
175 /// <p>The Base64 encoded, 64-bit <code>CRC64NVME</code> checksum of the part. This checksum is present if the multipart upload request was created with the <code>CRC64NVME</code> checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, <code>CRC64NVME</code>, to the uploaded object). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
176 pub fn set_checksum_crc64_nvme(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.checksum_crc64_nvme = input;
178 self
179 }
180 /// <p>The Base64 encoded, 64-bit <code>CRC64NVME</code> checksum of the part. This checksum is present if the multipart upload request was created with the <code>CRC64NVME</code> checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, <code>CRC64NVME</code>, to the uploaded object). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
181 pub fn get_checksum_crc64_nvme(&self) -> &::std::option::Option<::std::string::String> {
182 &self.checksum_crc64_nvme
183 }
184 /// <p>The Base64 encoded, 160-bit <code>SHA1</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA1</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
185 pub fn checksum_sha1(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.checksum_sha1 = ::std::option::Option::Some(input.into());
187 self
188 }
189 /// <p>The Base64 encoded, 160-bit <code>SHA1</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA1</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
190 pub fn set_checksum_sha1(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.checksum_sha1 = input;
192 self
193 }
194 /// <p>The Base64 encoded, 160-bit <code>SHA1</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA1</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
195 pub fn get_checksum_sha1(&self) -> &::std::option::Option<::std::string::String> {
196 &self.checksum_sha1
197 }
198 /// <p>The Base64 encoded, 256-bit <code>SHA256</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA256</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
199 pub fn checksum_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.checksum_sha256 = ::std::option::Option::Some(input.into());
201 self
202 }
203 /// <p>The Base64 encoded, 256-bit <code>SHA256</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA256</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
204 pub fn set_checksum_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205 self.checksum_sha256 = input;
206 self
207 }
208 /// <p>The Base64 encoded, 256-bit <code>SHA256</code> checksum of the part. This checksum is present if the object was uploaded with the <code>SHA256</code> checksum algorithm. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
209 pub fn get_checksum_sha256(&self) -> &::std::option::Option<::std::string::String> {
210 &self.checksum_sha256
211 }
212 /// Consumes the builder and constructs a [`Part`](crate::types::Part).
213 pub fn build(self) -> crate::types::Part {
214 crate::types::Part {
215 part_number: self.part_number,
216 last_modified: self.last_modified,
217 e_tag: self.e_tag,
218 size: self.size,
219 checksum_crc32: self.checksum_crc32,
220 checksum_crc32_c: self.checksum_crc32_c,
221 checksum_crc64_nvme: self.checksum_crc64_nvme,
222 checksum_sha1: self.checksum_sha1,
223 checksum_sha256: self.checksum_sha256,
224 }
225 }
226}