pub struct BucketAccessControlClient<'a>(_);
Expand description

Operations on BucketAccessControls.

Implementations

Create a new BucketAccessControl using the provided NewBucketAccessControl, related to the Bucket provided by the bucket_name argument.

Important

Important: This method fails with a 400 Bad Request response for buckets with uniform bucket-level access enabled. Use Bucket::get_iam_policy and Bucket::set_iam_policy to control access instead.

Example
use cloud_storage::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, NewBucketAccessControl};
use cloud_storage::bucket_access_control::{Role, Entity};

let client = Client::default();
let new_bucket_access_control = NewBucketAccessControl {
    entity: Entity::AllUsers,
    role: Role::Reader,
};
client.bucket_access_control().create("mybucket", &new_bucket_access_control).await?;

Returns all BucketAccessControls related to this bucket.

Important

Important: This method fails with a 400 Bad Request response for buckets with uniform bucket-level access enabled. Use Bucket::get_iam_policy and Bucket::set_iam_policy to control access instead.

Example
use cloud_storage::Client;
use cloud_storage::bucket_access_control::BucketAccessControl;

let client = Client::default();
let acls = client.bucket_access_control().list("mybucket").await?;

Returns the ACL entry for the specified entity on the specified bucket.

Important

Important: This method fails with a 400 Bad Request response for buckets with uniform bucket-level access enabled. Use Bucket::get_iam_policy and Bucket::set_iam_policy to control access instead.

Example
use cloud_storage::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, Entity};

let client = Client::default();
let controls = client.bucket_access_control().read("mybucket", &Entity::AllUsers).await?;

Update this BucketAccessControl.

Important

Important: This method fails with a 400 Bad Request response for buckets with uniform bucket-level access enabled. Use Bucket::get_iam_policy and Bucket::set_iam_policy to control access instead.

Example
use cloud_storage::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, Entity};

let client = Client::default();
let mut acl = client.bucket_access_control().read("mybucket", &Entity::AllUsers).await?;
acl.entity = Entity::AllAuthenticatedUsers;
client.bucket_access_control().update(&acl).await?;

Permanently deletes the ACL entry for the specified entity on the specified bucket.

Important

Important: This method fails with a 400 Bad Request response for buckets with uniform bucket-level access enabled. Use Bucket::get_iam_policy and Bucket::set_iam_policy to control access instead.

Example
use cloud_storage::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, Entity};

let client = Client::default();
let controls = client.bucket_access_control().read("mybucket", &Entity::AllUsers).await?;
client.bucket_access_control().delete(controls).await?;

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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