aws_sdk_s3/operation/put_bucket_website/_put_bucket_website_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 PutBucketWebsiteInput {
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>Container for the request.</p>
15 pub website_configuration: ::std::option::Option<crate::types::WebsiteConfiguration>,
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 PutBucketWebsiteInput {
20 /// <p>The bucket name.</p>
21 pub fn bucket(&self) -> ::std::option::Option<&str> {
22 self.bucket.as_deref()
23 }
24 /// <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>
25 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
26 pub fn content_md5(&self) -> ::std::option::Option<&str> {
27 self.content_md5.as_deref()
28 }
29 /// <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>
30 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
31 pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
32 self.checksum_algorithm.as_ref()
33 }
34 /// <p>Container for the request.</p>
35 pub fn website_configuration(&self) -> ::std::option::Option<&crate::types::WebsiteConfiguration> {
36 self.website_configuration.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 PutBucketWebsiteInput {
44 /// Creates a new builder-style object to manufacture [`PutBucketWebsiteInput`](crate::operation::put_bucket_website::PutBucketWebsiteInput).
45 pub fn builder() -> crate::operation::put_bucket_website::builders::PutBucketWebsiteInputBuilder {
46 crate::operation::put_bucket_website::builders::PutBucketWebsiteInputBuilder::default()
47 }
48}
49
50/// A builder for [`PutBucketWebsiteInput`](crate::operation::put_bucket_website::PutBucketWebsiteInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct PutBucketWebsiteInputBuilder {
54 pub(crate) bucket: ::std::option::Option<::std::string::String>,
55 pub(crate) content_md5: ::std::option::Option<::std::string::String>,
56 pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
57 pub(crate) website_configuration: ::std::option::Option<crate::types::WebsiteConfiguration>,
58 pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
59}
60impl PutBucketWebsiteInputBuilder {
61 /// <p>The bucket name.</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 bucket name.</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 bucket name.</p>
73 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
74 &self.bucket
75 }
76 /// <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>
77 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
78 pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.content_md5 = ::std::option::Option::Some(input.into());
80 self
81 }
82 /// <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>
83 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
84 pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85 self.content_md5 = input;
86 self
87 }
88 /// <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>
89 /// <p>For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.</p>
90 pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
91 &self.content_md5
92 }
93 /// <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>
94 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
95 pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
96 self.checksum_algorithm = ::std::option::Option::Some(input);
97 self
98 }
99 /// <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>
100 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
101 pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
102 self.checksum_algorithm = input;
103 self
104 }
105 /// <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>
106 /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
107 pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
108 &self.checksum_algorithm
109 }
110 /// <p>Container for the request.</p>
111 /// This field is required.
112 pub fn website_configuration(mut self, input: crate::types::WebsiteConfiguration) -> Self {
113 self.website_configuration = ::std::option::Option::Some(input);
114 self
115 }
116 /// <p>Container for the request.</p>
117 pub fn set_website_configuration(mut self, input: ::std::option::Option<crate::types::WebsiteConfiguration>) -> Self {
118 self.website_configuration = input;
119 self
120 }
121 /// <p>Container for the request.</p>
122 pub fn get_website_configuration(&self) -> &::std::option::Option<crate::types::WebsiteConfiguration> {
123 &self.website_configuration
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 [`PutBucketWebsiteInput`](crate::operation::put_bucket_website::PutBucketWebsiteInput).
140 pub fn build(
141 self,
142 ) -> ::std::result::Result<crate::operation::put_bucket_website::PutBucketWebsiteInput, ::aws_smithy_types::error::operation::BuildError> {
143 ::std::result::Result::Ok(crate::operation::put_bucket_website::PutBucketWebsiteInput {
144 bucket: self.bucket,
145 content_md5: self.content_md5,
146 checksum_algorithm: self.checksum_algorithm,
147 website_configuration: self.website_configuration,
148 expected_bucket_owner: self.expected_bucket_owner,
149 })
150 }
151}