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§
Source§impl<'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.