Struct aws_sdk_s3::client::fluent_builders::PutBucketPolicy [−][src]
pub struct PutBucketPolicy<C = DynConnector, M = AwsMiddleware, R = Standard> { /* fields omitted */ }
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.
As a security precaution, the root user of the Amazon Web Services account that owns a bucket can always use this operation, even if the policy explicitly denies the root user the ability to perform this action.
For more information, see Bucket policy examples.
The following operations are related to PutBucketPolicy
:
Implementations
impl<C, M, R> PutBucketPolicy<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
impl<C, M, R> PutBucketPolicy<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
pub async fn send(
self
) -> Result<PutBucketPolicyOutput, SdkError<PutBucketPolicyError>> where
R::Policy: SmithyRetryPolicy<PutBucketPolicyInputOperationOutputAlias, PutBucketPolicyOutput, PutBucketPolicyError, PutBucketPolicyInputOperationRetryAlias>,
pub async fn send(
self
) -> Result<PutBucketPolicyOutput, SdkError<PutBucketPolicyError>> where
R::Policy: SmithyRetryPolicy<PutBucketPolicyInputOperationOutputAlias, PutBucketPolicyOutput, PutBucketPolicyError, PutBucketPolicyInputOperationRetryAlias>,
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.
The name of the bucket.
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.
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.
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
The bucket policy as a JSON document.
The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied)
error.
The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied)
error.
Trait Implementations
Auto Trait Implementations
impl<C = DynConnector, M = AwsMiddleware, R = Standard> !RefUnwindSafe for PutBucketPolicy<C, M, R>
impl<C, M, R> Send for PutBucketPolicy<C, M, R> where
C: Send + Sync,
M: Send + Sync,
R: Send + Sync,
impl<C, M, R> Sync for PutBucketPolicy<C, M, R> where
C: Send + Sync,
M: Send + Sync,
R: Send + Sync,
impl<C, M, R> Unpin for PutBucketPolicy<C, M, R>
impl<C = DynConnector, M = AwsMiddleware, R = Standard> !UnwindSafe for PutBucketPolicy<C, M, R>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more