aws_sdk_s3/operation/put_bucket_acl/_put_bucket_acl_input.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 PutBucketAclInput {
6 /// <p>The canned ACL to apply to the bucket.</p>
7 pub acl: ::std::option::Option<crate::types::BucketCannedAcl>,
8 /// <p>Contains the elements that set the ACL permissions for an object per grantee.</p>
9 pub access_control_policy: ::std::option::Option<crate::types::AccessControlPolicy>,
10 /// <p>The bucket to which to apply the ACL.</p>
11 pub bucket: ::std::option::Option<::std::string::String>,
12 /// <p>The Base64 encoded 128-bit <code>MD5</code> digest of the data. This header must be used as a message integrity check to verify that the request body was not corrupted in transit. For more information, go to <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a></p>
13 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
14 pub content_md5: ::std::option::Option<::std::string::String>,
15 /// <p>Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. 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 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
17 pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
18 /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p>
19 pub grant_full_control: ::std::option::Option<::std::string::String>,
20 /// <p>Allows grantee to list the objects in the bucket.</p>
21 pub grant_read: ::std::option::Option<::std::string::String>,
22 /// <p>Allows grantee to read the bucket ACL.</p>
23 pub grant_read_acp: ::std::option::Option<::std::string::String>,
24 /// <p>Allows grantee to create new objects in the bucket.</p>
25 /// <p>For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects.</p>
26 pub grant_write: ::std::option::Option<::std::string::String>,
27 /// <p>Allows grantee to write the ACL for the applicable bucket.</p>
28 pub grant_write_acp: ::std::option::Option<::std::string::String>,
29 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
30 pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
31}
32impl PutBucketAclInput {
33 /// <p>The canned ACL to apply to the bucket.</p>
34 pub fn acl(&self) -> ::std::option::Option<&crate::types::BucketCannedAcl> {
35 self.acl.as_ref()
36 }
37 /// <p>Contains the elements that set the ACL permissions for an object per grantee.</p>
38 pub fn access_control_policy(&self) -> ::std::option::Option<&crate::types::AccessControlPolicy> {
39 self.access_control_policy.as_ref()
40 }
41 /// <p>The bucket to which to apply the ACL.</p>
42 pub fn bucket(&self) -> ::std::option::Option<&str> {
43 self.bucket.as_deref()
44 }
45 /// <p>The Base64 encoded 128-bit <code>MD5</code> digest of the data. This header must be used as a message integrity check to verify that the request body was not corrupted in transit. For more information, go to <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a></p>
46 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
47 pub fn content_md5(&self) -> ::std::option::Option<&str> {
48 self.content_md5.as_deref()
49 }
50 /// <p>Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. 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>
51 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
52 pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
53 self.checksum_algorithm.as_ref()
54 }
55 /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p>
56 pub fn grant_full_control(&self) -> ::std::option::Option<&str> {
57 self.grant_full_control.as_deref()
58 }
59 /// <p>Allows grantee to list the objects in the bucket.</p>
60 pub fn grant_read(&self) -> ::std::option::Option<&str> {
61 self.grant_read.as_deref()
62 }
63 /// <p>Allows grantee to read the bucket ACL.</p>
64 pub fn grant_read_acp(&self) -> ::std::option::Option<&str> {
65 self.grant_read_acp.as_deref()
66 }
67 /// <p>Allows grantee to create new objects in the bucket.</p>
68 /// <p>For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects.</p>
69 pub fn grant_write(&self) -> ::std::option::Option<&str> {
70 self.grant_write.as_deref()
71 }
72 /// <p>Allows grantee to write the ACL for the applicable bucket.</p>
73 pub fn grant_write_acp(&self) -> ::std::option::Option<&str> {
74 self.grant_write_acp.as_deref()
75 }
76 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
77 pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
78 self.expected_bucket_owner.as_deref()
79 }
80}
81impl PutBucketAclInput {
82 /// Creates a new builder-style object to manufacture [`PutBucketAclInput`](crate::operation::put_bucket_acl::PutBucketAclInput).
83 pub fn builder() -> crate::operation::put_bucket_acl::builders::PutBucketAclInputBuilder {
84 crate::operation::put_bucket_acl::builders::PutBucketAclInputBuilder::default()
85 }
86}
87
88/// A builder for [`PutBucketAclInput`](crate::operation::put_bucket_acl::PutBucketAclInput).
89#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
90#[non_exhaustive]
91pub struct PutBucketAclInputBuilder {
92 pub(crate) acl: ::std::option::Option<crate::types::BucketCannedAcl>,
93 pub(crate) access_control_policy: ::std::option::Option<crate::types::AccessControlPolicy>,
94 pub(crate) bucket: ::std::option::Option<::std::string::String>,
95 pub(crate) content_md5: ::std::option::Option<::std::string::String>,
96 pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
97 pub(crate) grant_full_control: ::std::option::Option<::std::string::String>,
98 pub(crate) grant_read: ::std::option::Option<::std::string::String>,
99 pub(crate) grant_read_acp: ::std::option::Option<::std::string::String>,
100 pub(crate) grant_write: ::std::option::Option<::std::string::String>,
101 pub(crate) grant_write_acp: ::std::option::Option<::std::string::String>,
102 pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
103}
104impl PutBucketAclInputBuilder {
105 /// <p>The canned ACL to apply to the bucket.</p>
106 pub fn acl(mut self, input: crate::types::BucketCannedAcl) -> Self {
107 self.acl = ::std::option::Option::Some(input);
108 self
109 }
110 /// <p>The canned ACL to apply to the bucket.</p>
111 pub fn set_acl(mut self, input: ::std::option::Option<crate::types::BucketCannedAcl>) -> Self {
112 self.acl = input;
113 self
114 }
115 /// <p>The canned ACL to apply to the bucket.</p>
116 pub fn get_acl(&self) -> &::std::option::Option<crate::types::BucketCannedAcl> {
117 &self.acl
118 }
119 /// <p>Contains the elements that set the ACL permissions for an object per grantee.</p>
120 pub fn access_control_policy(mut self, input: crate::types::AccessControlPolicy) -> Self {
121 self.access_control_policy = ::std::option::Option::Some(input);
122 self
123 }
124 /// <p>Contains the elements that set the ACL permissions for an object per grantee.</p>
125 pub fn set_access_control_policy(mut self, input: ::std::option::Option<crate::types::AccessControlPolicy>) -> Self {
126 self.access_control_policy = input;
127 self
128 }
129 /// <p>Contains the elements that set the ACL permissions for an object per grantee.</p>
130 pub fn get_access_control_policy(&self) -> &::std::option::Option<crate::types::AccessControlPolicy> {
131 &self.access_control_policy
132 }
133 /// <p>The bucket to which to apply the ACL.</p>
134 /// This field is required.
135 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.bucket = ::std::option::Option::Some(input.into());
137 self
138 }
139 /// <p>The bucket to which to apply the ACL.</p>
140 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.bucket = input;
142 self
143 }
144 /// <p>The bucket to which to apply the ACL.</p>
145 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
146 &self.bucket
147 }
148 /// <p>The Base64 encoded 128-bit <code>MD5</code> digest of the data. This header must be used as a message integrity check to verify that the request body was not corrupted in transit. For more information, go to <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a></p>
149 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
150 pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.content_md5 = ::std::option::Option::Some(input.into());
152 self
153 }
154 /// <p>The Base64 encoded 128-bit <code>MD5</code> digest of the data. This header must be used as a message integrity check to verify that the request body was not corrupted in transit. For more information, go to <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a></p>
155 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
156 pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.content_md5 = input;
158 self
159 }
160 /// <p>The Base64 encoded 128-bit <code>MD5</code> digest of the data. This header must be used as a message integrity check to verify that the request body was not corrupted in transit. For more information, go to <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a></p>
161 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
162 pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
163 &self.content_md5
164 }
165 /// <p>Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. 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>
166 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
167 pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
168 self.checksum_algorithm = ::std::option::Option::Some(input);
169 self
170 }
171 /// <p>Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. 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>
172 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
173 pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
174 self.checksum_algorithm = input;
175 self
176 }
177 /// <p>Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. 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 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
179 pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
180 &self.checksum_algorithm
181 }
182 /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p>
183 pub fn grant_full_control(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.grant_full_control = ::std::option::Option::Some(input.into());
185 self
186 }
187 /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p>
188 pub fn set_grant_full_control(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.grant_full_control = input;
190 self
191 }
192 /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p>
193 pub fn get_grant_full_control(&self) -> &::std::option::Option<::std::string::String> {
194 &self.grant_full_control
195 }
196 /// <p>Allows grantee to list the objects in the bucket.</p>
197 pub fn grant_read(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.grant_read = ::std::option::Option::Some(input.into());
199 self
200 }
201 /// <p>Allows grantee to list the objects in the bucket.</p>
202 pub fn set_grant_read(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.grant_read = input;
204 self
205 }
206 /// <p>Allows grantee to list the objects in the bucket.</p>
207 pub fn get_grant_read(&self) -> &::std::option::Option<::std::string::String> {
208 &self.grant_read
209 }
210 /// <p>Allows grantee to read the bucket ACL.</p>
211 pub fn grant_read_acp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.grant_read_acp = ::std::option::Option::Some(input.into());
213 self
214 }
215 /// <p>Allows grantee to read the bucket ACL.</p>
216 pub fn set_grant_read_acp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.grant_read_acp = input;
218 self
219 }
220 /// <p>Allows grantee to read the bucket ACL.</p>
221 pub fn get_grant_read_acp(&self) -> &::std::option::Option<::std::string::String> {
222 &self.grant_read_acp
223 }
224 /// <p>Allows grantee to create new objects in the bucket.</p>
225 /// <p>For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects.</p>
226 pub fn grant_write(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227 self.grant_write = ::std::option::Option::Some(input.into());
228 self
229 }
230 /// <p>Allows grantee to create new objects in the bucket.</p>
231 /// <p>For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects.</p>
232 pub fn set_grant_write(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233 self.grant_write = input;
234 self
235 }
236 /// <p>Allows grantee to create new objects in the bucket.</p>
237 /// <p>For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects.</p>
238 pub fn get_grant_write(&self) -> &::std::option::Option<::std::string::String> {
239 &self.grant_write
240 }
241 /// <p>Allows grantee to write the ACL for the applicable bucket.</p>
242 pub fn grant_write_acp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
243 self.grant_write_acp = ::std::option::Option::Some(input.into());
244 self
245 }
246 /// <p>Allows grantee to write the ACL for the applicable bucket.</p>
247 pub fn set_grant_write_acp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248 self.grant_write_acp = input;
249 self
250 }
251 /// <p>Allows grantee to write the ACL for the applicable bucket.</p>
252 pub fn get_grant_write_acp(&self) -> &::std::option::Option<::std::string::String> {
253 &self.grant_write_acp
254 }
255 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
256 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257 self.expected_bucket_owner = ::std::option::Option::Some(input.into());
258 self
259 }
260 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
261 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262 self.expected_bucket_owner = input;
263 self
264 }
265 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
266 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
267 &self.expected_bucket_owner
268 }
269 /// Consumes the builder and constructs a [`PutBucketAclInput`](crate::operation::put_bucket_acl::PutBucketAclInput).
270 pub fn build(
271 self,
272 ) -> ::std::result::Result<crate::operation::put_bucket_acl::PutBucketAclInput, ::aws_smithy_types::error::operation::BuildError> {
273 ::std::result::Result::Ok(crate::operation::put_bucket_acl::PutBucketAclInput {
274 acl: self.acl,
275 access_control_policy: self.access_control_policy,
276 bucket: self.bucket,
277 content_md5: self.content_md5,
278 checksum_algorithm: self.checksum_algorithm,
279 grant_full_control: self.grant_full_control,
280 grant_read: self.grant_read,
281 grant_read_acp: self.grant_read_acp,
282 grant_write: self.grant_write,
283 grant_write_acp: self.grant_write_acp,
284 expected_bucket_owner: self.expected_bucket_owner,
285 })
286 }
287}