Struct b2_client::bucket::UpdateBucketBuilder
source · [−]pub struct UpdateBucketBuilder { /* private fields */ }Expand description
A builder to create an UpdateBucket request.
Implementations
sourceimpl UpdateBucketBuilder
impl UpdateBucketBuilder
sourcepub fn bucket_id(self, bucket_id: impl Into<String>) -> Self
pub fn bucket_id(self, bucket_id: impl Into<String>) -> Self
The ID of the bucket to update.
This is required.
sourcepub fn bucket_type(self, typ: BucketType) -> Result<Self, ValidationError>
pub fn bucket_type(self, typ: BucketType) -> Result<Self, ValidationError>
Change the bucket’s type to the one provided.
sourcepub fn bucket_info(self, info: Value) -> Self
pub fn bucket_info(self, info: Value) -> Self
Replace the current bucket information with the specified information.
This can contain arbitrary metadata for your own use. You can also set
cache-control settings from here (but see
cache_control). If Cache-Control is set here and
via the cache-control method, the latter will override this value.
sourcepub fn cache_control(self, cache_control: CacheControl) -> Self
pub fn cache_control(self, cache_control: CacheControl) -> Self
Set the default Cache-Control header value for files downloaded from the bucket.
sourcepub fn cors_rules(
self,
rules: impl Into<Vec<CorsRule>>
) -> Result<Self, ValidationError>
pub fn cors_rules(
self,
rules: impl Into<Vec<CorsRule>>
) -> Result<Self, ValidationError>
Replace the bucket’s current provided CORS rules with the provided rules.
See https://www.backblaze.com/b2/docs/cors_rules.html for further information.
sourcepub fn retention_policy(self, policy: FileRetentionPolicy) -> Self
pub fn retention_policy(self, policy: FileRetentionPolicy) -> Self
Replace the bucket’s default retention policy.
The Authorization must have Capability::WriteBucketRetentions.
sourcepub fn encryption_settings(self, settings: ServerSideEncryption) -> Self
pub fn encryption_settings(self, settings: ServerSideEncryption) -> Self
Replace the bucket’s server-side encryption settings.
The Authorization must have Capability::WriteBucketEncryption.
sourcepub fn lifecycle_rules(
self,
rules: impl Into<Vec<LifecycleRule>>
) -> Result<Self, LifecycleRuleValidationError>
pub fn lifecycle_rules(
self,
rules: impl Into<Vec<LifecycleRule>>
) -> Result<Self, LifecycleRuleValidationError>
Replace the bucket’s lifecycle rules with the provided list.
See the documentation for CreateBucketBuilder::lifecycle_rules for the lifecycle requirements and examples.
sourcepub fn if_revision_is(self, revision: u16) -> Self
pub fn if_revision_is(self, revision: u16) -> Self
Only perform the update if the bucket’s current revision is the provided version.
pub fn build<'a>(self) -> Result<UpdateBucket<'a>, ValidationError>
Trait Implementations
sourceimpl Default for UpdateBucketBuilder
impl Default for UpdateBucketBuilder
sourcefn default() -> UpdateBucketBuilder
fn default() -> UpdateBucketBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for UpdateBucketBuilder
impl Send for UpdateBucketBuilder
impl Sync for UpdateBucketBuilder
impl Unpin for UpdateBucketBuilder
impl UnwindSafe for UpdateBucketBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more