Struct bonsaidb::keystorage::s3::aws_sdk_s3::operation::put_bucket_policy::builders::PutBucketPolicyFluentBuilder
pub struct PutBucketPolicyFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to PutBucketPolicy
.
Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must have the PutBucketPolicy
permissions on the specified bucket and belong to the bucket owner's account in order to use this operation.
If you don't have PutBucketPolicy
permissions, Amazon S3 returns a 403 Access Denied
error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a 405 Method Not Allowed
error.
To ensure that bucket owners don't inadvertently lock themselves out of their own buckets, the root principal in a bucket owner's Amazon Web Services account can perform the GetBucketPolicy
, PutBucketPolicy
, and DeleteBucketPolicy
API actions, even if their bucket policy explicitly denies the root principal's access. Bucket owner root principals can only be blocked from performing these API actions by VPC endpoint policies and Amazon Web Services Organizations policies.
For more information, see Bucket policy examples.
The following operations are related to PutBucketPolicy
:
Implementations§
§impl PutBucketPolicyFluentBuilder
impl PutBucketPolicyFluentBuilder
pub fn as_input(&self) -> &PutBucketPolicyInputBuilder
pub fn as_input(&self) -> &PutBucketPolicyInputBuilder
Access the PutBucketPolicy as a reference.
pub async fn send(
self
) -> impl Future<Output = Result<PutBucketPolicyOutput, SdkError<PutBucketPolicyError, Response<SdkBody>>>>
pub async fn send( self ) -> impl Future<Output = Result<PutBucketPolicyOutput, SdkError<PutBucketPolicyError, Response<SdkBody>>>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
pub async fn customize(
self
) -> impl Future<Output = Result<CustomizableOperation<PutBucketPolicyOutput, PutBucketPolicyError, PutBucketPolicyFluentBuilder>, SdkError<PutBucketPolicyError, Response>>>
pub async fn customize( self ) -> impl Future<Output = Result<CustomizableOperation<PutBucketPolicyOutput, PutBucketPolicyError, PutBucketPolicyFluentBuilder>, SdkError<PutBucketPolicyError, Response>>>
Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn bucket(self, input: impl Into<String>) -> PutBucketPolicyFluentBuilder
pub fn bucket(self, input: impl Into<String>) -> PutBucketPolicyFluentBuilder
The name of the bucket.
pub fn set_bucket(self, input: Option<String>) -> PutBucketPolicyFluentBuilder
pub fn set_bucket(self, input: Option<String>) -> PutBucketPolicyFluentBuilder
The name of the bucket.
pub fn get_bucket(&self) -> &Option<String>
pub fn get_bucket(&self) -> &Option<String>
The name of the bucket.
pub fn content_md5(
self,
input: impl Into<String>
) -> PutBucketPolicyFluentBuilder
pub fn content_md5( self, input: impl Into<String> ) -> PutBucketPolicyFluentBuilder
The MD5 hash of the request body.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
pub fn set_content_md5(
self,
input: Option<String>
) -> PutBucketPolicyFluentBuilder
pub fn set_content_md5( self, input: Option<String> ) -> PutBucketPolicyFluentBuilder
The MD5 hash of the request body.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
pub fn get_content_md5(&self) -> &Option<String>
pub fn get_content_md5(&self) -> &Option<String>
The MD5 hash of the request body.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
pub fn checksum_algorithm(
self,
input: ChecksumAlgorithm
) -> PutBucketPolicyFluentBuilder
pub fn checksum_algorithm( self, input: ChecksumAlgorithm ) -> PutBucketPolicyFluentBuilder
Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum
or x-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm
parameter.
pub fn set_checksum_algorithm(
self,
input: Option<ChecksumAlgorithm>
) -> PutBucketPolicyFluentBuilder
pub fn set_checksum_algorithm( self, input: Option<ChecksumAlgorithm> ) -> PutBucketPolicyFluentBuilder
Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum
or x-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm
parameter.
pub fn get_checksum_algorithm(&self) -> &Option<ChecksumAlgorithm>
pub fn get_checksum_algorithm(&self) -> &Option<ChecksumAlgorithm>
Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum
or x-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm
parameter.
pub fn confirm_remove_self_bucket_access(
self,
input: bool
) -> PutBucketPolicyFluentBuilder
pub fn confirm_remove_self_bucket_access( self, input: bool ) -> PutBucketPolicyFluentBuilder
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
pub fn set_confirm_remove_self_bucket_access(
self,
input: Option<bool>
) -> PutBucketPolicyFluentBuilder
pub fn set_confirm_remove_self_bucket_access( self, input: Option<bool> ) -> PutBucketPolicyFluentBuilder
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
pub fn get_confirm_remove_self_bucket_access(&self) -> &Option<bool>
pub fn get_confirm_remove_self_bucket_access(&self) -> &Option<bool>
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
pub fn policy(self, input: impl Into<String>) -> PutBucketPolicyFluentBuilder
pub fn policy(self, input: impl Into<String>) -> PutBucketPolicyFluentBuilder
The bucket policy as a JSON document.
pub fn set_policy(self, input: Option<String>) -> PutBucketPolicyFluentBuilder
pub fn set_policy(self, input: Option<String>) -> PutBucketPolicyFluentBuilder
The bucket policy as a JSON document.
pub fn get_policy(&self) -> &Option<String>
pub fn get_policy(&self) -> &Option<String>
The bucket policy as a JSON document.
pub fn expected_bucket_owner(
self,
input: impl Into<String>
) -> PutBucketPolicyFluentBuilder
pub fn expected_bucket_owner( self, input: impl Into<String> ) -> PutBucketPolicyFluentBuilder
The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden
(access denied).
pub fn set_expected_bucket_owner(
self,
input: Option<String>
) -> PutBucketPolicyFluentBuilder
pub fn set_expected_bucket_owner( self, input: Option<String> ) -> PutBucketPolicyFluentBuilder
The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden
(access denied).
pub fn get_expected_bucket_owner(&self) -> &Option<String>
pub fn get_expected_bucket_owner(&self) -> &Option<String>
The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden
(access denied).
Trait Implementations§
§impl Clone for PutBucketPolicyFluentBuilder
impl Clone for PutBucketPolicyFluentBuilder
§fn clone(&self) -> PutBucketPolicyFluentBuilder
fn clone(&self) -> PutBucketPolicyFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more