aws_sdk_s3/operation/put_bucket_logging/
_put_bucket_logging_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 PutBucketLoggingInput {
6    /// <p>The name of the bucket for which to set the logging parameters.</p>
7    pub bucket: ::std::option::Option<::std::string::String>,
8    /// <p>Container for logging status information.</p>
9    pub bucket_logging_status: ::std::option::Option<crate::types::BucketLoggingStatus>,
10    /// <p>The MD5 hash of the <code>PutBucketLogging</code> request body.</p>
11    /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
12    pub content_md5: ::std::option::Option<::std::string::String>,
13    /// <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>
14    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
15    pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
16    /// <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>
17    pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
18}
19impl PutBucketLoggingInput {
20    /// <p>The name of the bucket for which to set the logging parameters.</p>
21    pub fn bucket(&self) -> ::std::option::Option<&str> {
22        self.bucket.as_deref()
23    }
24    /// <p>Container for logging status information.</p>
25    pub fn bucket_logging_status(&self) -> ::std::option::Option<&crate::types::BucketLoggingStatus> {
26        self.bucket_logging_status.as_ref()
27    }
28    /// <p>The MD5 hash of the <code>PutBucketLogging</code> request body.</p>
29    /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
30    pub fn content_md5(&self) -> ::std::option::Option<&str> {
31        self.content_md5.as_deref()
32    }
33    /// <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>
34    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
35    pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
36        self.checksum_algorithm.as_ref()
37    }
38    /// <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>
39    pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
40        self.expected_bucket_owner.as_deref()
41    }
42}
43impl PutBucketLoggingInput {
44    /// Creates a new builder-style object to manufacture [`PutBucketLoggingInput`](crate::operation::put_bucket_logging::PutBucketLoggingInput).
45    pub fn builder() -> crate::operation::put_bucket_logging::builders::PutBucketLoggingInputBuilder {
46        crate::operation::put_bucket_logging::builders::PutBucketLoggingInputBuilder::default()
47    }
48}
49
50/// A builder for [`PutBucketLoggingInput`](crate::operation::put_bucket_logging::PutBucketLoggingInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct PutBucketLoggingInputBuilder {
54    pub(crate) bucket: ::std::option::Option<::std::string::String>,
55    pub(crate) bucket_logging_status: ::std::option::Option<crate::types::BucketLoggingStatus>,
56    pub(crate) content_md5: ::std::option::Option<::std::string::String>,
57    pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
58    pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
59}
60impl PutBucketLoggingInputBuilder {
61    /// <p>The name of the bucket for which to set the logging parameters.</p>
62    /// This field is required.
63    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.bucket = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The name of the bucket for which to set the logging parameters.</p>
68    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.bucket = input;
70        self
71    }
72    /// <p>The name of the bucket for which to set the logging parameters.</p>
73    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
74        &self.bucket
75    }
76    /// <p>Container for logging status information.</p>
77    /// This field is required.
78    pub fn bucket_logging_status(mut self, input: crate::types::BucketLoggingStatus) -> Self {
79        self.bucket_logging_status = ::std::option::Option::Some(input);
80        self
81    }
82    /// <p>Container for logging status information.</p>
83    pub fn set_bucket_logging_status(mut self, input: ::std::option::Option<crate::types::BucketLoggingStatus>) -> Self {
84        self.bucket_logging_status = input;
85        self
86    }
87    /// <p>Container for logging status information.</p>
88    pub fn get_bucket_logging_status(&self) -> &::std::option::Option<crate::types::BucketLoggingStatus> {
89        &self.bucket_logging_status
90    }
91    /// <p>The MD5 hash of the <code>PutBucketLogging</code> request body.</p>
92    /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
93    pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.content_md5 = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The MD5 hash of the <code>PutBucketLogging</code> request body.</p>
98    /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
99    pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.content_md5 = input;
101        self
102    }
103    /// <p>The MD5 hash of the <code>PutBucketLogging</code> request body.</p>
104    /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
105    pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
106        &self.content_md5
107    }
108    /// <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>
109    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
110    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
111        self.checksum_algorithm = ::std::option::Option::Some(input);
112        self
113    }
114    /// <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>
115    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
116    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
117        self.checksum_algorithm = input;
118        self
119    }
120    /// <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>
121    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
122    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
123        &self.checksum_algorithm
124    }
125    /// <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>
126    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.expected_bucket_owner = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <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>
131    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.expected_bucket_owner = input;
133        self
134    }
135    /// <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>
136    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
137        &self.expected_bucket_owner
138    }
139    /// Consumes the builder and constructs a [`PutBucketLoggingInput`](crate::operation::put_bucket_logging::PutBucketLoggingInput).
140    pub fn build(
141        self,
142    ) -> ::std::result::Result<crate::operation::put_bucket_logging::PutBucketLoggingInput, ::aws_smithy_types::error::operation::BuildError> {
143        ::std::result::Result::Ok(crate::operation::put_bucket_logging::PutBucketLoggingInput {
144            bucket: self.bucket,
145            bucket_logging_status: self.bucket_logging_status,
146            content_md5: self.content_md5,
147            checksum_algorithm: self.checksum_algorithm,
148            expected_bucket_owner: self.expected_bucket_owner,
149        })
150    }
151}