pub struct BucketAccessControlClient<'a>(/* private fields */);
Expand description
Operations on BucketAccessControl
s.
Implementations§
Source§impl<'a> BucketAccessControlClient<'a>
impl<'a> BucketAccessControlClient<'a>
Sourcepub async fn create(
&self,
bucket: &str,
new_bucket_access_control: &NewBucketAccessControl,
) -> Result<BucketAccessControl>
pub async fn create( &self, bucket: &str, new_bucket_access_control: &NewBucketAccessControl, ) -> Result<BucketAccessControl>
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?;
Sourcepub async fn list(&self, bucket: &str) -> Result<Vec<BucketAccessControl>>
pub async fn list(&self, bucket: &str) -> Result<Vec<BucketAccessControl>>
Returns all BucketAccessControl
s 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?;
Sourcepub async fn read(
&self,
bucket: &str,
entity: &Entity,
) -> Result<BucketAccessControl>
pub async fn read( &self, bucket: &str, entity: &Entity, ) -> Result<BucketAccessControl>
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?;
Sourcepub async fn update(
&self,
bucket_access_control: &BucketAccessControl,
) -> Result<BucketAccessControl>
pub async fn update( &self, bucket_access_control: &BucketAccessControl, ) -> Result<BucketAccessControl>
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?;
Sourcepub async fn delete(
&self,
bucket_access_control: BucketAccessControl,
) -> Result<()>
pub async fn delete( &self, bucket_access_control: BucketAccessControl, ) -> Result<()>
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§
impl<'a> Freeze for BucketAccessControlClient<'a>
impl<'a> !RefUnwindSafe for BucketAccessControlClient<'a>
impl<'a> Send for BucketAccessControlClient<'a>
impl<'a> Sync for BucketAccessControlClient<'a>
impl<'a> Unpin for BucketAccessControlClient<'a>
impl<'a> !UnwindSafe for BucketAccessControlClient<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more