pub struct B2CreateKeyBody {
pub account_id: String,
pub capabilities: Vec<B2KeyCapability>,
pub key_name: String,
pub valid_duration_in_seconds: Option<u64>,
pub bucket_id: Option<String>,
pub name_prefix: Option<String>,
}Fields§
§account_id: StringYour account ID.
capabilities: Vec<B2KeyCapability>The list of capabilities this key should have.
key_name: StringThe name for this key. There is no requirement for the key name to be unique. Key names are limited to 100 characters and can contain letters, numbers, and “-”, but not I18N characters, such as é, à, and ü.
valid_duration_in_seconds: Option<u64>When provided, the key will expire after the given number of seconds, and will have expirationTimestamp set. Value must be a positive integer, and must be less than 1000 days (in seconds).
bucket_id: Option<String>When provided, the new key can only access the specified bucket. Only the following capabilities can be specified:
listAllBucketNames, listBuckets, readBuckets,
readBucketEncryption, writeBucketNotifications,
readBucketNotifications, writeBucketEncryption,
readBucketRetentions, writeBucketRetentions,
listFiles, readFiles, shareFiles,
writeFiles, deleteFiles, readFileLegalHolds,
writeFileLegalHolds, readFileRetentions,
writeFileRetentions, and bypassGovernance.
For all buckets, this field can either be left empty or set to null.
name_prefix: Option<String>When provided, this parameter limits access to files with names starting with the specified prefix. By default, the restriction is applied to all buckets unless a bucketId is included in the request.
Implementations§
Source§impl B2CreateKeyBody
impl B2CreateKeyBody
Sourcepub fn builder() -> B2CreateKeyBodyBuilder<((), (), (), (), (), ())>
pub fn builder() -> B2CreateKeyBodyBuilder<((), (), (), (), (), ())>
Create a builder for building B2CreateKeyBody.
On the builder, call .account_id(...), .capabilities(...), .key_name(...), .valid_duration_in_seconds(...)(optional), .bucket_id(...)(optional), .name_prefix(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of B2CreateKeyBody.
Trait Implementations§
Source§impl Clone for B2CreateKeyBody
impl Clone for B2CreateKeyBody
Source§fn clone(&self) -> B2CreateKeyBody
fn clone(&self) -> B2CreateKeyBody
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more