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>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC-32 checksum of the 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>
16 pub checksum_crc32: ::std::option::Option<::std::string::String>,
17 /// <p>The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> 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, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
20 pub checksum_sha1: ::std::option::Option<::std::string::String>,
21 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the 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>
22 pub checksum_sha256: ::std::option::Option<::std::string::String>,
23}
24impl Part {
25 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
26 pub fn part_number(&self) -> ::std::option::Option<i32> {
27 self.part_number
28 }
29 /// <p>Date and time at which the part was uploaded.</p>
30 pub fn last_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
31 self.last_modified.as_ref()
32 }
33 /// <p>Entity tag returned when the part was uploaded.</p>
34 pub fn e_tag(&self) -> ::std::option::Option<&str> {
35 self.e_tag.as_deref()
36 }
37 /// <p>Size in bytes of the uploaded part data.</p>
38 pub fn size(&self) -> ::std::option::Option<i64> {
39 self.size
40 }
41 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC-32 checksum of the 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>
42 pub fn checksum_crc32(&self) -> ::std::option::Option<&str> {
43 self.checksum_crc32.as_deref()
44 }
45 /// <p>The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
46 pub fn checksum_crc32_c(&self) -> ::std::option::Option<&str> {
47 self.checksum_crc32_c.as_deref()
48 }
49 /// <p>The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
50 pub fn checksum_sha1(&self) -> ::std::option::Option<&str> {
51 self.checksum_sha1.as_deref()
52 }
53 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the 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>
54 pub fn checksum_sha256(&self) -> ::std::option::Option<&str> {
55 self.checksum_sha256.as_deref()
56 }
57}
58impl Part {
59 /// Creates a new builder-style object to manufacture [`Part`](crate::types::Part).
60 pub fn builder() -> crate::types::builders::PartBuilder {
61 crate::types::builders::PartBuilder::default()
62 }
63}
64
65/// A builder for [`Part`](crate::types::Part).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct PartBuilder {
69 pub(crate) part_number: ::std::option::Option<i32>,
70 pub(crate) last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
71 pub(crate) e_tag: ::std::option::Option<::std::string::String>,
72 pub(crate) size: ::std::option::Option<i64>,
73 pub(crate) checksum_crc32: ::std::option::Option<::std::string::String>,
74 pub(crate) checksum_crc32_c: ::std::option::Option<::std::string::String>,
75 pub(crate) checksum_sha1: ::std::option::Option<::std::string::String>,
76 pub(crate) checksum_sha256: ::std::option::Option<::std::string::String>,
77}
78impl PartBuilder {
79 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
80 pub fn part_number(mut self, input: i32) -> Self {
81 self.part_number = ::std::option::Option::Some(input);
82 self
83 }
84 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
85 pub fn set_part_number(mut self, input: ::std::option::Option<i32>) -> Self {
86 self.part_number = input;
87 self
88 }
89 /// <p>Part number identifying the part. This is a positive integer between 1 and 10,000.</p>
90 pub fn get_part_number(&self) -> &::std::option::Option<i32> {
91 &self.part_number
92 }
93 /// <p>Date and time at which the part was uploaded.</p>
94 pub fn last_modified(mut self, input: ::aws_smithy_types::DateTime) -> Self {
95 self.last_modified = ::std::option::Option::Some(input);
96 self
97 }
98 /// <p>Date and time at which the part was uploaded.</p>
99 pub fn set_last_modified(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
100 self.last_modified = input;
101 self
102 }
103 /// <p>Date and time at which the part was uploaded.</p>
104 pub fn get_last_modified(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
105 &self.last_modified
106 }
107 /// <p>Entity tag returned when the part was uploaded.</p>
108 pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109 self.e_tag = ::std::option::Option::Some(input.into());
110 self
111 }
112 /// <p>Entity tag returned when the part was uploaded.</p>
113 pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.e_tag = input;
115 self
116 }
117 /// <p>Entity tag returned when the part was uploaded.</p>
118 pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
119 &self.e_tag
120 }
121 /// <p>Size in bytes of the uploaded part data.</p>
122 pub fn size(mut self, input: i64) -> Self {
123 self.size = ::std::option::Option::Some(input);
124 self
125 }
126 /// <p>Size in bytes of the uploaded part data.</p>
127 pub fn set_size(mut self, input: ::std::option::Option<i64>) -> Self {
128 self.size = input;
129 self
130 }
131 /// <p>Size in bytes of the uploaded part data.</p>
132 pub fn get_size(&self) -> &::std::option::Option<i64> {
133 &self.size
134 }
135 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC-32 checksum of the 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>
136 pub fn checksum_crc32(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.checksum_crc32 = ::std::option::Option::Some(input.into());
138 self
139 }
140 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC-32 checksum of the 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>
141 pub fn set_checksum_crc32(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.checksum_crc32 = input;
143 self
144 }
145 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC-32 checksum of the 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>
146 pub fn get_checksum_crc32(&self) -> &::std::option::Option<::std::string::String> {
147 &self.checksum_crc32
148 }
149 /// <p>The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
150 pub fn checksum_crc32_c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.checksum_crc32_c = ::std::option::Option::Some(input.into());
152 self
153 }
154 /// <p>The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
155 pub fn set_checksum_crc32_c(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.checksum_crc32_c = input;
157 self
158 }
159 /// <p>The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
160 pub fn get_checksum_crc32_c(&self) -> &::std::option::Option<::std::string::String> {
161 &self.checksum_crc32_c
162 }
163 /// <p>The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
164 pub fn checksum_sha1(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165 self.checksum_sha1 = ::std::option::Option::Some(input.into());
166 self
167 }
168 /// <p>The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
169 pub fn set_checksum_sha1(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170 self.checksum_sha1 = input;
171 self
172 }
173 /// <p>The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
174 pub fn get_checksum_sha1(&self) -> &::std::option::Option<::std::string::String> {
175 &self.checksum_sha1
176 }
177 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the 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>
178 pub fn checksum_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.checksum_sha256 = ::std::option::Option::Some(input.into());
180 self
181 }
182 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the 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>
183 pub fn set_checksum_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184 self.checksum_sha256 = input;
185 self
186 }
187 /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the 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>
188 pub fn get_checksum_sha256(&self) -> &::std::option::Option<::std::string::String> {
189 &self.checksum_sha256
190 }
191 /// Consumes the builder and constructs a [`Part`](crate::types::Part).
192 pub fn build(self) -> crate::types::Part {
193 crate::types::Part {
194 part_number: self.part_number,
195 last_modified: self.last_modified,
196 e_tag: self.e_tag,
197 size: self.size,
198 checksum_crc32: self.checksum_crc32,
199 checksum_crc32_c: self.checksum_crc32_c,
200 checksum_sha1: self.checksum_sha1,
201 checksum_sha256: self.checksum_sha256,
202 }
203 }
204}