aws_sdk_s3/operation/put_bucket_versioning/_put_bucket_versioning_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 PutBucketVersioningInput {
6 /// <p>The bucket name.</p>
7 pub bucket: ::std::option::Option<::std::string::String>,
8 /// <p>>The Base64 encoded 128-bit <code>MD5</code> digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p>
9 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
10 pub content_md5: ::std::option::Option<::std::string::String>,
11 /// <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>
12 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
13 pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
14 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.</p>
15 pub mfa: ::std::option::Option<::std::string::String>,
16 /// <p>Container for setting the versioning state.</p>
17 pub versioning_configuration: ::std::option::Option<crate::types::VersioningConfiguration>,
18 /// <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>
19 pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
20}
21impl PutBucketVersioningInput {
22 /// <p>The bucket name.</p>
23 pub fn bucket(&self) -> ::std::option::Option<&str> {
24 self.bucket.as_deref()
25 }
26 /// <p>>The Base64 encoded 128-bit <code>MD5</code> digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p>
27 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
28 pub fn content_md5(&self) -> ::std::option::Option<&str> {
29 self.content_md5.as_deref()
30 }
31 /// <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>
32 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
33 pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
34 self.checksum_algorithm.as_ref()
35 }
36 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.</p>
37 pub fn mfa(&self) -> ::std::option::Option<&str> {
38 self.mfa.as_deref()
39 }
40 /// <p>Container for setting the versioning state.</p>
41 pub fn versioning_configuration(&self) -> ::std::option::Option<&crate::types::VersioningConfiguration> {
42 self.versioning_configuration.as_ref()
43 }
44 /// <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>
45 pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
46 self.expected_bucket_owner.as_deref()
47 }
48}
49impl PutBucketVersioningInput {
50 /// Creates a new builder-style object to manufacture [`PutBucketVersioningInput`](crate::operation::put_bucket_versioning::PutBucketVersioningInput).
51 pub fn builder() -> crate::operation::put_bucket_versioning::builders::PutBucketVersioningInputBuilder {
52 crate::operation::put_bucket_versioning::builders::PutBucketVersioningInputBuilder::default()
53 }
54}
55
56/// A builder for [`PutBucketVersioningInput`](crate::operation::put_bucket_versioning::PutBucketVersioningInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct PutBucketVersioningInputBuilder {
60 pub(crate) bucket: ::std::option::Option<::std::string::String>,
61 pub(crate) content_md5: ::std::option::Option<::std::string::String>,
62 pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
63 pub(crate) mfa: ::std::option::Option<::std::string::String>,
64 pub(crate) versioning_configuration: ::std::option::Option<crate::types::VersioningConfiguration>,
65 pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
66}
67impl PutBucketVersioningInputBuilder {
68 /// <p>The bucket name.</p>
69 /// This field is required.
70 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 self.bucket = ::std::option::Option::Some(input.into());
72 self
73 }
74 /// <p>The bucket name.</p>
75 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.bucket = input;
77 self
78 }
79 /// <p>The bucket name.</p>
80 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
81 &self.bucket
82 }
83 /// <p>>The Base64 encoded 128-bit <code>MD5</code> digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p>
84 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
85 pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.content_md5 = ::std::option::Option::Some(input.into());
87 self
88 }
89 /// <p>>The Base64 encoded 128-bit <code>MD5</code> digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p>
90 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
91 pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.content_md5 = input;
93 self
94 }
95 /// <p>>The Base64 encoded 128-bit <code>MD5</code> digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see <a href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p>
96 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
97 pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
98 &self.content_md5
99 }
100 /// <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>
101 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
102 pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
103 self.checksum_algorithm = ::std::option::Option::Some(input);
104 self
105 }
106 /// <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>
107 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
108 pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
109 self.checksum_algorithm = input;
110 self
111 }
112 /// <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>
113 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
114 pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
115 &self.checksum_algorithm
116 }
117 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.</p>
118 pub fn mfa(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.mfa = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.</p>
123 pub fn set_mfa(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.mfa = input;
125 self
126 }
127 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.</p>
128 pub fn get_mfa(&self) -> &::std::option::Option<::std::string::String> {
129 &self.mfa
130 }
131 /// <p>Container for setting the versioning state.</p>
132 /// This field is required.
133 pub fn versioning_configuration(mut self, input: crate::types::VersioningConfiguration) -> Self {
134 self.versioning_configuration = ::std::option::Option::Some(input);
135 self
136 }
137 /// <p>Container for setting the versioning state.</p>
138 pub fn set_versioning_configuration(mut self, input: ::std::option::Option<crate::types::VersioningConfiguration>) -> Self {
139 self.versioning_configuration = input;
140 self
141 }
142 /// <p>Container for setting the versioning state.</p>
143 pub fn get_versioning_configuration(&self) -> &::std::option::Option<crate::types::VersioningConfiguration> {
144 &self.versioning_configuration
145 }
146 /// <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>
147 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.expected_bucket_owner = ::std::option::Option::Some(input.into());
149 self
150 }
151 /// <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>
152 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.expected_bucket_owner = input;
154 self
155 }
156 /// <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>
157 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
158 &self.expected_bucket_owner
159 }
160 /// Consumes the builder and constructs a [`PutBucketVersioningInput`](crate::operation::put_bucket_versioning::PutBucketVersioningInput).
161 pub fn build(
162 self,
163 ) -> ::std::result::Result<crate::operation::put_bucket_versioning::PutBucketVersioningInput, ::aws_smithy_types::error::operation::BuildError>
164 {
165 ::std::result::Result::Ok(crate::operation::put_bucket_versioning::PutBucketVersioningInput {
166 bucket: self.bucket,
167 content_md5: self.content_md5,
168 checksum_algorithm: self.checksum_algorithm,
169 mfa: self.mfa,
170 versioning_configuration: self.versioning_configuration,
171 expected_bucket_owner: self.expected_bucket_owner,
172 })
173 }
174}