aws_sdk_s3/operation/get_bucket_policy/
_get_bucket_policy_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 GetBucketPolicyInput {
6    /// <p>The bucket name to get the bucket policy for.</p>
7    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
8    /// <p><b>Access points</b> - When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.</p>
9    /// <p><b>Object Lambda access points</b> - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code <code>InvalidAccessPointAliasError</code> is returned. For more information about <code>InvalidAccessPointAliasError</code>, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList">List of Error Codes</a>.</p><note>
10    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
11    /// </note>
12    pub bucket: ::std::option::Option<::std::string::String>,
13    /// <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><note>
14    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
15    /// </note>
16    pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
17}
18impl GetBucketPolicyInput {
19    /// <p>The bucket name to get the bucket policy for.</p>
20    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
21    /// <p><b>Access points</b> - When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.</p>
22    /// <p><b>Object Lambda access points</b> - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code <code>InvalidAccessPointAliasError</code> is returned. For more information about <code>InvalidAccessPointAliasError</code>, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList">List of Error Codes</a>.</p><note>
23    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
24    /// </note>
25    pub fn bucket(&self) -> ::std::option::Option<&str> {
26        self.bucket.as_deref()
27    }
28    /// <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><note>
29    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
30    /// </note>
31    pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
32        self.expected_bucket_owner.as_deref()
33    }
34}
35impl GetBucketPolicyInput {
36    /// Creates a new builder-style object to manufacture [`GetBucketPolicyInput`](crate::operation::get_bucket_policy::GetBucketPolicyInput).
37    pub fn builder() -> crate::operation::get_bucket_policy::builders::GetBucketPolicyInputBuilder {
38        crate::operation::get_bucket_policy::builders::GetBucketPolicyInputBuilder::default()
39    }
40}
41
42/// A builder for [`GetBucketPolicyInput`](crate::operation::get_bucket_policy::GetBucketPolicyInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetBucketPolicyInputBuilder {
46    pub(crate) bucket: ::std::option::Option<::std::string::String>,
47    pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
48}
49impl GetBucketPolicyInputBuilder {
50    /// <p>The bucket name to get the bucket policy for.</p>
51    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
52    /// <p><b>Access points</b> - When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.</p>
53    /// <p><b>Object Lambda access points</b> - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code <code>InvalidAccessPointAliasError</code> is returned. For more information about <code>InvalidAccessPointAliasError</code>, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList">List of Error Codes</a>.</p><note>
54    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
55    /// </note>
56    /// This field is required.
57    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.bucket = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>The bucket name to get the bucket policy for.</p>
62    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
63    /// <p><b>Access points</b> - When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.</p>
64    /// <p><b>Object Lambda access points</b> - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code <code>InvalidAccessPointAliasError</code> is returned. For more information about <code>InvalidAccessPointAliasError</code>, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList">List of Error Codes</a>.</p><note>
65    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
66    /// </note>
67    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.bucket = input;
69        self
70    }
71    /// <p>The bucket name to get the bucket policy for.</p>
72    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
73    /// <p><b>Access points</b> - When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.</p>
74    /// <p><b>Object Lambda access points</b> - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code <code>InvalidAccessPointAliasError</code> is returned. For more information about <code>InvalidAccessPointAliasError</code>, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList">List of Error Codes</a>.</p><note>
75    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
76    /// </note>
77    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
78        &self.bucket
79    }
80    /// <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><note>
81    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
82    /// </note>
83    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.expected_bucket_owner = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <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><note>
88    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
89    /// </note>
90    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.expected_bucket_owner = input;
92        self
93    }
94    /// <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><note>
95    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
96    /// </note>
97    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
98        &self.expected_bucket_owner
99    }
100    /// Consumes the builder and constructs a [`GetBucketPolicyInput`](crate::operation::get_bucket_policy::GetBucketPolicyInput).
101    pub fn build(
102        self,
103    ) -> ::std::result::Result<crate::operation::get_bucket_policy::GetBucketPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
104        ::std::result::Result::Ok(crate::operation::get_bucket_policy::GetBucketPolicyInput {
105            bucket: self.bucket,
106            expected_bucket_owner: self.expected_bucket_owner,
107        })
108    }
109}