aws_sdk_s3/operation/put_bucket_replication/_put_bucket_replication_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 PutBucketReplicationInput {
6 /// <p>The name of the bucket</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>A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.</p>
15 pub replication_configuration: ::std::option::Option<crate::types::ReplicationConfiguration>,
16 /// <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
17 pub token: ::std::option::Option<::std::string::String>,
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 PutBucketReplicationInput {
22 /// <p>The name of the bucket</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>A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.</p>
37 pub fn replication_configuration(&self) -> ::std::option::Option<&crate::types::ReplicationConfiguration> {
38 self.replication_configuration.as_ref()
39 }
40 /// <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
41 pub fn token(&self) -> ::std::option::Option<&str> {
42 self.token.as_deref()
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 PutBucketReplicationInput {
50 /// Creates a new builder-style object to manufacture [`PutBucketReplicationInput`](crate::operation::put_bucket_replication::PutBucketReplicationInput).
51 pub fn builder() -> crate::operation::put_bucket_replication::builders::PutBucketReplicationInputBuilder {
52 crate::operation::put_bucket_replication::builders::PutBucketReplicationInputBuilder::default()
53 }
54}
55
56/// A builder for [`PutBucketReplicationInput`](crate::operation::put_bucket_replication::PutBucketReplicationInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct PutBucketReplicationInputBuilder {
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) replication_configuration: ::std::option::Option<crate::types::ReplicationConfiguration>,
64 pub(crate) token: ::std::option::Option<::std::string::String>,
65 pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
66}
67impl PutBucketReplicationInputBuilder {
68 /// <p>The name of the bucket</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 name of the bucket</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 name of the bucket</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>A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.</p>
118 /// This field is required.
119 pub fn replication_configuration(mut self, input: crate::types::ReplicationConfiguration) -> Self {
120 self.replication_configuration = ::std::option::Option::Some(input);
121 self
122 }
123 /// <p>A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.</p>
124 pub fn set_replication_configuration(mut self, input: ::std::option::Option<crate::types::ReplicationConfiguration>) -> Self {
125 self.replication_configuration = input;
126 self
127 }
128 /// <p>A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.</p>
129 pub fn get_replication_configuration(&self) -> &::std::option::Option<crate::types::ReplicationConfiguration> {
130 &self.replication_configuration
131 }
132 /// <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
133 pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.token = ::std::option::Option::Some(input.into());
135 self
136 }
137 /// <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
138 pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.token = input;
140 self
141 }
142 /// <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
143 pub fn get_token(&self) -> &::std::option::Option<::std::string::String> {
144 &self.token
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 [`PutBucketReplicationInput`](crate::operation::put_bucket_replication::PutBucketReplicationInput).
161 pub fn build(
162 self,
163 ) -> ::std::result::Result<crate::operation::put_bucket_replication::PutBucketReplicationInput, ::aws_smithy_types::error::operation::BuildError>
164 {
165 ::std::result::Result::Ok(crate::operation::put_bucket_replication::PutBucketReplicationInput {
166 bucket: self.bucket,
167 content_md5: self.content_md5,
168 checksum_algorithm: self.checksum_algorithm,
169 replication_configuration: self.replication_configuration,
170 token: self.token,
171 expected_bucket_owner: self.expected_bucket_owner,
172 })
173 }
174}