pub struct DownloadAuthorizationRequestBuilder<'a> { /* private fields */ }Expand description
A builder to create a DownloadAuthorizationRequest.
After building the DownloadAuthorizationRequest, pass it to
get_download_authorization to obtain a DownloadAuthorization
The bucket ID, file name prefix, and valid duration are required.
See https://www.backblaze.com/b2/docs/b2_get_download_authorization.html for furter information.
Implementations
sourceimpl<'a> DownloadAuthorizationRequestBuilder<'a>
impl<'a> DownloadAuthorizationRequestBuilder<'a>
sourcepub fn bucket_id(self, id: &'a str) -> Self
pub fn bucket_id(self, id: &'a str) -> Self
Create a download authorization for the specified bucket ID.
sourcepub fn file_name_prefix(
self,
name: &'a str
) -> Result<Self, FileNameValidationError>
pub fn file_name_prefix(
self,
name: &'a str
) -> Result<Self, FileNameValidationError>
Use the given file name prefix to determine what files the DownloadAuthorization will allow access to.
sourcepub fn duration(self, dur: Duration) -> Result<Self, ValidationError>
pub fn duration(self, dur: Duration) -> Result<Self, ValidationError>
Specify the amount of time for which the DownloadAuthorization will be valid.
This must be between one second and one week, inclusive.
sourcepub fn content_disposition(self, disposition: ContentDisposition) -> Self
pub fn content_disposition(self, disposition: ContentDisposition) -> Self
If specified, download requests must have this content disposition. The grammar is specified in RFC 6266, except that parameter names containing a ‘*’ are not allowed.
sourcepub fn content_language<S: Into<String>>(self, lang: S) -> Self
pub fn content_language<S: Into<String>>(self, lang: S) -> Self
If specified, download requests must have this content language. The grammar is specified in RFC 2616.
sourcepub fn expiration(self, expiration: Expires) -> Self
pub fn expiration(self, expiration: Expires) -> Self
If specified, download requests must have this expiration.
sourcepub fn cache_control(self, cache_control: CacheControl) -> Self
pub fn cache_control(self, cache_control: CacheControl) -> Self
If specified, download requests must have this cache control.
sourcepub fn content_encoding(self, encoding: ContentEncoding) -> Self
pub fn content_encoding(self, encoding: ContentEncoding) -> Self
If specified, download requests must have this content encoding.
sourcepub fn content_type(self, content_type: impl Into<Mime>) -> Self
pub fn content_type(self, content_type: impl Into<Mime>) -> Self
If specified, download requests must have this content type.
sourcepub fn build(self) -> Result<DownloadAuthorizationRequest<'a>, ValidationError>
pub fn build(self) -> Result<DownloadAuthorizationRequest<'a>, ValidationError>
Build a DownloadAuthorizationRequest.
Trait Implementations
sourceimpl<'a> Default for DownloadAuthorizationRequestBuilder<'a>
impl<'a> Default for DownloadAuthorizationRequestBuilder<'a>
sourcefn default() -> DownloadAuthorizationRequestBuilder<'a>
fn default() -> DownloadAuthorizationRequestBuilder<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for DownloadAuthorizationRequestBuilder<'a>
impl<'a> Send for DownloadAuthorizationRequestBuilder<'a>
impl<'a> Sync for DownloadAuthorizationRequestBuilder<'a>
impl<'a> Unpin for DownloadAuthorizationRequestBuilder<'a>
impl<'a> UnwindSafe for DownloadAuthorizationRequestBuilder<'a>
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