Struct cloud_storage::sync::BucketAccessControlClient
source · [−]pub struct BucketAccessControlClient<'a>(_);
Expand description
Operations on BucketAccessControl
s.
Implementations
sourceimpl<'a> BucketAccessControlClient<'a>
impl<'a> BucketAccessControlClient<'a>
sourcepub fn create(
&self,
bucket: &str,
new_bucket_access_control: &NewBucketAccessControl
) -> Result<BucketAccessControl>
pub 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::sync::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, NewBucketAccessControl};
use cloud_storage::bucket_access_control::{Role, Entity};
let client = Client::new()?;
let new_bucket_access_control = NewBucketAccessControl {
entity: Entity::AllUsers,
role: Role::Reader,
};
client.bucket_access_control().create("mybucket", &new_bucket_access_control)?;
sourcepub fn list(&self, bucket: &str) -> Result<Vec<BucketAccessControl>>
pub 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::sync::Client;
use cloud_storage::bucket_access_control::BucketAccessControl;
let client = Client::new()?;
let acls = client.bucket_access_control().list("mybucket")?;
sourcepub fn read(&self, bucket: &str, entity: &Entity) -> Result<BucketAccessControl>
pub 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::sync::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, Entity};
let client = Client::new()?;
let controls = client.bucket_access_control().read("mybucket", &Entity::AllUsers)?;
sourcepub fn update(
&self,
bucket_access_control: &BucketAccessControl
) -> Result<BucketAccessControl>
pub 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::sync::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, Entity};
let client = Client::new()?;
let mut acl = client.bucket_access_control().read("mybucket", &Entity::AllUsers)?;
acl.entity = Entity::AllAuthenticatedUsers;
client.bucket_access_control().update(&acl)?;
sourcepub fn delete(&self, bucket_access_control: BucketAccessControl) -> Result<()>
pub 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::sync::Client;
use cloud_storage::bucket_access_control::{BucketAccessControl, Entity};
let client = Client::new()?;
let controls = client.bucket_access_control().read("mybucket", &Entity::AllUsers)?;
client.bucket_access_control().delete(controls)?;
Trait Implementations
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more