backblaze_b2_client/definitions/bodies.rs
1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize, Serializer};
4use serde_with::skip_serializing_none;
5use typed_builder::TypedBuilder;
6
7use super::shared::{
8 B2BucketFileRetention, B2BucketRetention, B2BucketType, B2BucketTypeUpdate, B2CorsRule,
9 B2CustomerAgnosticServerSideEncryption, B2FileLegalHold, B2KeyCapability, B2LifeCycleRules,
10 B2MetadataDirective, B2ReplicationConfig, B2ServerSideEncryption,
11};
12
13#[derive(Clone, Serialize, Debug, TypedBuilder)]
14#[serde(rename_all = "camelCase")]
15#[builder(field_defaults(default))]
16pub struct B2CopyFileBody {
17 #[builder(!default)]
18 /// The ID of the source file being copied.
19 pub source_file_id: String,
20 /// The ID of the bucket where the copied file will be stored. If this is not set, the copied file will be added to the same bucket as the source file.
21 /// <br> Note that the bucket containing the source file and the destination bucket must belong to the same account.
22 pub large_file_id: Option<String>,
23 #[builder(!default)]
24 /// The name of the new file being created.
25 pub file_name: String,
26 /// The range of bytes to copy. If not provided, the whole source file will be copied.
27 pub range: Option<String>,
28 /// The strategy for how to populate metadata for the new file.
29 /// <br> If COPY is the indicated strategy, then supplying the contentType or fileInfo param is an error.
30 pub metadata_directive: Option<B2MetadataDirective>,
31 /// Must only be supplied if the metadataDirective is REPLACE.
32 /// <br> The MIME type of the content of the file, which will be returned in the Content-Type header when downloading the file.
33 /// <br> Use the Content-Type b2/x-auto to automatically set the stored Content-Type post upload.
34 /// <br> In the case where a file extension is absent or the lookup fails, the Content-Type is set to application/octet-stream. The Content-Type mappings can be perused [here](https://www.backblaze.com/docs/cloud-storage-b2-content-type-mappings).
35 pub content_type: Option<String>,
36 /// Must only be supplied if the metadataDirective is REPLACE.
37 /// <br> This field stores the metadata that will be stored with the file. It follows the same rules that are applied to [b2_upload_file](super::headers::B2UploadFileHeaders).
38 pub file_info: Option<HashMap<String, String>>,
39 /// If present, specifies the Object Lock retention settings for the new file.
40 /// <br> Setting the value requires the [writeFileRetentions](B2KeyCapability::WriteFileRetentions) capability and that the destination bucket is Object Lock-enabled. See [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for details.
41 pub file_retention: Option<B2BucketFileRetention>,
42 /// If present, specifies the Object Lock legal hold status for the new file.
43 /// <br> Setting the value requires the [writeFileLegalHolds](B2KeyCapability::WriteFileLegalHolds) capability and that the destination bucket is Object Lock-enabled. [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for details.
44 pub legal_hold: Option<B2FileLegalHold>,
45 /// If present, specifies the parameters for Backblaze B2 to use for accessing the source file data using Server-Side Encryption.
46 /// <Br> This parameter is required if and only if the source file has been encrypted using [Server-Side Encryption with Customer-Managed Keys (SSE-C)](https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api#enable-and-manage-ssec),
47 /// and the provided encryption key must match the one with which the source file was encrypted. See [Server-Side Encryption][https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api] for details.
48 pub source_server_side_encryption: Option<B2CustomerAgnosticServerSideEncryption>,
49 /// If present, specifies the parameters for Backblaze B2 to use for encrypting the copied data before storing the destination file using Server-Side Encryption. See [Server-Side Encryption][https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api] for details.
50 pub destination_server_side_encryption: Option<B2CustomerAgnosticServerSideEncryption>,
51}
52
53#[derive(Clone, Serialize, Debug, TypedBuilder)]
54#[serde(rename_all = "camelCase")]
55pub struct B2CopyPartBody {
56 /// The ID of the source file being copied.
57 pub source_file_id: String,
58 /// The ID of the large file the part will belong to, as returned by [b2_start_large_file](super::responses::B2StartLargeFileResponse::file_id).
59 pub large_file_id: String,
60 /// A number from 1 to 10000. The parts uploaded for one file must have contiguous numbers, starting with 1.
61 pub part_number: u16,
62 #[builder(default)]
63 /// The range of bytes to copy. If not provided, the whole source file will be copied.
64 pub range: Option<String>,
65 #[builder(default)]
66 /// If present, specifies the parameters for Backblaze B2 to use for accessing the source file data using Server-Side Encryption.
67 /// <Br> This parameter must be provided only if the source file has been encrypted using [Server-Side Encryption with Customer-Managed Keys (SSE-C)](https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api#enable-and-manage-ssec),
68 /// and the provided encryption key must match the one with which the source file was encrypted. See [Server-Side Encryption][https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api] for details.
69 pub source_server_side_encryption: Option<B2CustomerAgnosticServerSideEncryption>,
70 #[builder(default)]
71 /// If present, specifies the parameters for Backblaze B2 to use for encrypting the copied data before storing the destination file using Server-Side Encryption
72 /// <Br> This parameter must be provided only if the large file was started with [Server-Side Encryption with Customer-Managed Keys (SSE-C)](https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api#enable-and-manage-ssec),
73 /// and the provided encryption key must match the one with which the large file was started. See [Server-Side Encryption][https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api] for details.
74 pub destination_server_side_encryption: Option<B2CustomerAgnosticServerSideEncryption>,
75}
76
77#[derive(Clone, Serialize, Debug, TypedBuilder)]
78#[serde(rename_all = "camelCase")]
79#[builder(field_defaults(default))]
80pub struct B2CreateBucketBody {
81 #[builder(!default)]
82 /// Your account ID.
83 pub account_id: String,
84 /// The name to give the new bucket.
85 /// <br> Bucket names must be a minimum of 6 and a maximum of 63 characters long, and must be globally unique, two different B2 accounts cannot have buckets with the same name.
86 /// Bucket names can consist of letters, digits, and "-". Bucket names cannot start with "b2-", these are reserved for internal Backblaze use.
87 #[builder(!default)]
88 pub bucket_name: String,
89 /// Either ["allPublic"](B2BucketType::AllPublic), meaning that files in this bucket can be downloaded by anybody,
90 /// or ["allPrivate"](B2BucketType::AllPrivate), meaning that you need a bucket authorization token to download the files.
91 #[builder(!default)]
92 pub bucket_type: B2BucketType,
93 /// User-defined information to be stored with the bucket as a JSON object mapping names to values. See [Buckets](https://www.backblaze.com/docs/cloud-storage-buckets).
94 /// <br> Cache-Control policies can be set here on a global level for all the files in the bucket.
95 pub bucket_info: Option<HashMap<String, String>>,
96 /// The initial list of CORS rules for this bucket.
97 /// See [CORS Rules](https://www.backblaze.com/docs/cloud-storage-cross-origin-resource-sharing-rules) for an overview and the rule structure.
98 pub cors_rules: Option<Vec<B2CorsRule>>,
99 /// If present, the boolean value specifies whether bucket is Object Lock-enabled.
100 /// <br> The default value is false. Setting the value to true requires the [writeBucketRetentions](super::shared::B2KeyCapability::WriteFileRetentions) capability.
101 pub file_lock_enabled: Option<bool>,
102 /// The initial list of lifecycle rules for this bucket. See [Lifecycle Rules](https://www.backblaze.com/docs/cloud-storage-lifecycle-rules).
103 pub life_cycle_rules: Option<Vec<B2LifeCycleRules>>,
104 /// The configuration to create a Replication Rule. See [Cloud Replication](https://www.backblaze.com/docs/cloud-storage-create-a-cloud-replication-rule-with-the-native-api) Rules.
105 /// At least one of the [`asReplicationSource`](B2ReplicationConfig::AsReplicationSource) or [`asReplicationDestination`](B2ReplicationConfig::AsReplicationDestination) parameters is required, but they can also both be present.
106 /// <br><br> NOTE: The first time that you configure Cloud Replication, complete the following tasks to ensure that you have the correct permission:
107 /// - Verify your email address.
108 /// - Have a payment history on file or make a payment.
109 pub replication_configuration: Option<B2ReplicationConfig>,
110 /// The default server-side encryption settings for this bucket. See Server-Side Encryption for an overview and the parameter structure.
111 /// <br> Setting the value requires the [`writeBucketEncryption`](B2KeyCapability::WriteBucketEncryption) application key capability.
112 pub default_server_side_encryption: Option<B2ServerSideEncryption>,
113}
114
115#[derive(Clone, Debug, Serialize, TypedBuilder)]
116#[serde(rename_all = "camelCase")]
117pub struct B2UpdateFileRetentionBody {
118 /// The name of the file.
119 pub file_name: String,
120 /// The ID of the file.
121 pub file_id: String,
122 /// Specifies the file retention settings for Backblaze B2 to use for this file.
123 /// See [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for details.
124 pub file_retention: B2BucketFileRetention,
125 #[builder(default)]
126 /// Must be specified and set to true if deleting an existing governance mode retention setting or shortening an existing governance mode retention period.
127 /// See [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for details.
128 pub bypass_governance: Option<bool>,
129}
130
131#[derive(Clone, Debug, Serialize, TypedBuilder)]
132#[serde(rename_all = "camelCase")]
133pub struct B2FinishLargeFileBody {
134 /// The ID returned by [b2_start_large_file](crate::simple_client::B2SimpleClient::start_large_file).
135 pub file_id: String,
136 /// An array of hex SHA1 checksums of the parts of the large file. This is a double-check that the right parts were uploaded in the right order, and that none were missed.
137 /// Note that the part numbers start at 1, and the SHA1 of the part 1 is the first string in the array, at index 0.
138 pub part_sha1_array: Vec<String>,
139}
140
141#[derive(Clone, Debug, Serialize, TypedBuilder)]
142#[serde(rename_all = "camelCase")]
143#[builder(field_defaults(default))]
144pub struct B2StartLargeFileUploadBody {
145 #[builder(!default)]
146 /// The ID of the bucket that the file will go in.
147 pub bucket_id: String,
148 #[builder(!default)]
149 /// The name of the file. See [Files](https://www.backblaze.com/docs/cloud-storage-files) for requirements on file names.
150 pub file_name: String,
151 #[builder(!default)]
152 /// The MIME type of the content of the file, which will be returned in the `Content-Type` header when downloading the file.
153 /// Use the Content-Type `b2/x-auto` to automatically set the stored `Content-Type` post upload.
154 /// In the case where a file extension is absent or the lookup fails, the `Content-Type` is set to `application/octet-stream`.
155 /// The `Content-Type` mappings can be perused [here](https://www.backblaze.com/docs/cloud-storage-b2-content-type-mappings).
156 pub content_type: String,
157 /// If this is present, B2 will use it as the value of the upload timestamp.
158 /// The value should be a base 10 number that represents a UTC time when the original source file was uploaded.
159 /// It is a base 10 number of milliseconds since midnight, January 1st, 1970 UTC. This fits in a 64-bit integer, such as the type long in Java,
160 /// and so it can be passed directly into the Java call `Date.setTime(long time)`. The value must not use a date that is set to a time in the future.
161 /// If the value is null, it will be ignored.
162 /// <br><br> Note: The timestamp should not interfere with the bucket lifecycle rules.
163 /// <br><br> For example, a conflict between the timestamp and a lifecycle rule, such as `daysFromStartingToCancelingUnfinishedLargeFiles`,
164 /// may also result in a large file upload being canceled.
165 pub custom_upload_timestamp: Option<u64>,
166 /// A JSON object holding the name/value pairs for the custom file info.
167 pub file_info: Option<HashMap<String, String>>,
168 /// If present, specifies the Object Lock retention settings for the new file.
169 /// <br> Setting the value requires the [writeFileRetentions](B2KeyCapability::WriteFileRetentions) capability and that the destination bucket is Object Lock-enabled.
170 /// See [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for details.
171 pub file_retention: Option<B2BucketFileRetention>,
172 /// If present, specifies the Object Lock legal hold status for the new file.
173 /// <br> Setting the value requires the [writeFileLegalHolds](B2KeyCapability::WriteFileLegalHolds) capability and that the destination bucket is Object Lock-enabled.
174 /// See [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for details.
175 pub legal_hold: Option<B2FileLegalHold>,
176 /// If present, specifies the parameters for Backblaze B2 to use for encrypting the uploaded data before storing the file using Server-Side Encryption.
177 /// See [`Server-Side Encryption`](https://www.backblaze.com/docs/cloud-storage-enable-server-side-encryption-with-the-native-api) for details.
178 pub server_side_encryption: Option<B2ServerSideEncryption>,
179}
180
181/// The api for the b2_update_file_legal_hold endpoint returns same
182/// schema as the passed body, so we can just reuse this struct for both
183#[derive(Clone, Debug, Serialize, Deserialize, TypedBuilder)]
184#[serde(rename_all = "camelCase")]
185pub struct B2UpdateFileLegalHoldBodyResponse {
186 /// The name of the file.
187 pub file_id: String,
188 /// The ID of the file.
189 pub file_name: String,
190 /// The legal hold on this file.
191 pub legal_hold: B2FileLegalHold,
192}
193
194#[skip_serializing_none]
195#[derive(Clone, Debug, Serialize, TypedBuilder)]
196#[serde(rename_all = "camelCase")]
197#[builder(field_defaults(default))]
198pub struct B2UpdateBucketBody {
199 #[builder(!default)]
200 /// The account that the bucket is in.
201 pub account_id: String,
202 #[builder(!default)]
203 /// The unique identifier of the bucket.
204 pub bucket_id: String,
205 /// The bucket type, If not specified, the setting will remain unchanged
206 pub bucket_type: Option<B2BucketTypeUpdate>,
207 /// User-defined information to be stored with the bucket as a JSON object mapping names to values. See [Buckets](https://www.backblaze.com/docs/cloud-storage-buckets).
208 /// <br> Cache-Control policies can be set here on a global level for all the files in the bucket.
209 pub bucket_info: Option<HashMap<String, String>>,
210 /// The initial list of CORS rules for this bucket.
211 /// See [CORS Rules](https://www.backblaze.com/docs/cloud-storage-cross-origin-resource-sharing-rules) for an overview and the rule structure.
212 pub cors_rules: Option<Vec<B2CorsRule>>,
213 /// The default Object Lock retention settings for this bucket. See Object Lock for an overview and the parameter structure.
214 /// <br><br> If specified, the existing default bucket retention settings will be replaced with the new settings.
215 /// If not specified, the setting will remain unchanged. Setting the value requires the [writeBucketRetentions](super::shared::B2KeyCapability::WriteFileRetentions) capability and that the bucket is Object Lock-enabled.
216 pub default_retention: Option<B2BucketRetention>,
217 /// The default server-side encryption settings for this bucket. See Server-Side Encryption for an overview and the parameter structure.
218 /// <br> Setting the value requires the [`writeBucketEncryption`](B2KeyCapability::WriteBucketEncryption) application key capability.
219 pub default_server_side_encryption: Option<B2ServerSideEncryption>,
220 /// If present, the boolean value specifies whether bucket is [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) enabled.
221 /// Once Object Lock is enabled on a bucket, it cannot be disabled.
222 /// <br><br> A value of true will be accepted if you have [`writeBucketRetentions`](B2KeyCapability::WriteBucketRetentions) capability.
223 /// But you cannot enable Object Lock on a restricted bucket (e.g. share buckets, snapshot) or on a bucket that contains source replication configuration.
224 /// <br><br> A value of false will only be accepted if the bucket does not have Object Lock enabled.
225 pub file_lock_enabled: Option<bool>,
226 /// The initial list of lifecycle rules for this bucket. See [Lifecycle Rules](https://www.backblaze.com/docs/cloud-storage-lifecycle-rules).\
227 /// <br><br> If specified, the existing lifecycle rules will be replaced with this new list. If not specified, the setting will remain unchanged.
228 pub life_cycle_rules: Option<Vec<B2LifeCycleRules>>,
229 /// The configuration to create a Replication Rule. See [Cloud Replication](https://www.backblaze.com/docs/cloud-storage-create-a-cloud-replication-rule-with-the-native-api) Rules.
230 /// At least one of the [`asReplicationSource`](B2ReplicationConfig::AsReplicationSource) or [`asReplicationDestination`](B2ReplicationConfig::AsReplicationDestination) parameters is required, but they can also both be present.
231 /// <br><br> NOTE: The first time that you configure Cloud Replication, complete the following tasks to ensure that you have the correct permission:
232 /// - Verify your email address.
233 /// - Have a payment history on file or make a payment.
234 pub replication_configuration: Option<B2ReplicationConfig>,
235 /// When set, the update will only happen if the revision number stored in the B2 service matches the one passed in.
236 /// This can be used to avoid having simultaneous updates make conflicting changes.
237 pub if_revision_is: Option<u32>,
238}
239
240#[derive(Clone, Debug)]
241pub enum B2BucketTypeList {
242 All,
243 Types(Vec<B2BucketType>),
244}
245
246impl Serialize for B2BucketTypeList {
247 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
248 where
249 S: Serializer,
250 {
251 use B2BucketTypeList::*;
252
253 match self {
254 All => {
255 use serde::ser::SerializeSeq;
256 let mut seq = serializer.serialize_seq(Some(1))?;
257 seq.serialize_element("all")?;
258 seq.end()
259 }
260 Types(types) => {
261 if types.is_empty() {
262 use serde::ser::Error;
263 return Err(S::Error::custom(
264 "B2BucketTypeList Types array cannot be empty",
265 ));
266 }
267 types.serialize(serializer)
268 }
269 }
270 }
271}
272
273#[derive(Clone, Serialize, Debug, TypedBuilder)]
274#[serde(rename_all = "camelCase")]
275#[builder(field_defaults(default))]
276pub struct B2ListBucketsBody {
277 #[builder(!default)]
278 /// Your account ID.
279 pub account_id: String,
280 /// When `bucketId` is specified, the result will be a list containing just this bucket, if it's present in the account,
281 /// or no buckets if the account does not have a bucket with this ID.
282 pub bucket_id: Option<String>,
283 /// When `bucketName`` is specified, the result will be a list containing just this bucket, if it's present in the account,
284 /// or no buckets if the account does not have a bucket with this name.
285 pub bucket_name: Option<String>,
286 /// If present, this will be used as a filter for bucket types returned in the list buckets response. If not present, only buckets with bucket types "allPublic", "allPrivate" and "snapshot" will be returned. A special filter value of ["all"] will return all bucket types.
287 /// <br><br>If present, it must be in the form of a json array of strings containing valid bucket types in quotes and separated by a comma. Valid bucket types include "allPrivate", "allPublic", "restricted", "snapshot", "shared", and other values added in the future.
288 /// <br><br>A bad request error will be returned if "all" is used with other bucketTypes, bucketTypes is empty, or invalid bucketTypes are requested.
289 pub bucket_types: Option<Vec<B2BucketTypeList>>,
290}
291
292#[derive(Clone, Serialize, Debug, TypedBuilder)]
293#[serde(rename_all = "camelCase")]
294#[builder(field_defaults(default))]
295pub struct B2GetDownloadAuthorizationBody {
296 #[builder(!default)]
297 /// The identifier for the bucket.
298 pub bucket_id: String,
299 #[builder(!default)]
300 /// The file name prefix of files the download authorization token will allow b2_download_file_by_name to access.
301 /// For example, if you have a private bucket named `"photos"` and generate a download authorization token for the fileNamePrefix `"pets/"`
302 /// you will be able to use the download authorization token to access:
303 /// <br><br> https://f345.backblazeb2.com/file/photos/pets/kitten.jpg but not https://f345.backblazeb2.com/file/photos/vacation.jpg.
304 pub file_name_prefix: String,
305 #[builder(!default)]
306 /// The number of seconds before the authorization token will expire. The minimum value is 1 second. The maximum value is 604800 which is one week in seconds.
307 pub valid_duration_in_seconds: u64,
308 /// If this is present, download requests using the returned authorization must include the same value for b2ContentDisposition.
309 /// The value must match the grammar specified in RFC 6266 (except that parameter names that contain an '*' are not allowed).
310 pub b2_content_disposition: Option<String>,
311 /// If this is present, download requests using the returned authorization must include the same value for b2ContentLanguage.
312 /// The value must match the grammar specified in RFC 2616.
313 pub b2_content_language: Option<String>,
314 /// If this is present, download requests using the returned authorization must include the same value for b2Expires.
315 /// The value must match the grammar specified in RFC 2616.
316 pub b2_expires: Option<String>,
317 /// If this is present, download requests using the returned authorization must include the same value for b2CacheControl.
318 /// The value must match the grammar specified in RFC 2616.
319 pub b2_cache_control: Option<String>,
320 /// If this is present, download requests using the returned authorization must include the same value for b2ContentEncoding.
321 /// The value must match the grammar specified in RFC 2616.
322 pub b2_content_encoding: Option<String>,
323 /// If this is present, download requests using the returned authorization must include the same value for b2ContentType.
324 /// The value must match the grammar specified in RFC 2616.
325 pub b2_content_type: Option<String>,
326}
327
328#[derive(Clone, Serialize, Debug, TypedBuilder)]
329#[serde(rename_all = "camelCase")]
330pub struct B2DeleteFileVersionBody {
331 /// The name of the file.
332 pub file_name: String,
333 /// The ID of the file, as returned by
334 /// [b2_upload_file](crate::simple_client::B2SimpleClient::upload_file), [b2_list_file_names](crate::simple_client::B2SimpleClient::list_file_names),
335 /// or [b2_list_file_versions](crate::simple_client::B2SimpleClient::list_file_versions).
336 pub file_id: String,
337 #[builder(default)]
338 /// Must be specified and set to `true` if deleting a file version protected by Object Lock governance mode retention settings.
339 /// Setting the value requires the [bypassGovernance](B2KeyCapability::BypassGovernance) application key capability.
340 /// See [Object Lock](https://www.backblaze.com/docs/cloud-storage-enable-object-lock-with-the-native-api) for more information.
341 pub bypass_governance: Option<bool>,
342}
343
344#[derive(Clone, Serialize, Debug, TypedBuilder)]
345#[serde(rename_all = "camelCase")]
346pub struct B2CreateKeyBody {
347 /// Your account ID.
348 pub account_id: String,
349 /// The list of capabilities this key should have.
350 pub capabilities: Vec<B2KeyCapability>,
351 /// The name for this key. There is no requirement for the key name to be unique.
352 /// Key names are limited to 100 characters and can contain letters, numbers, and "-", but not I18N characters, such as é, à, and ü.
353 pub key_name: String,
354 #[builder(default)]
355 /// When provided, the key will expire after the given number of seconds, and will have expirationTimestamp set.
356 /// Value must be a positive integer, and must be less than 1000 days (in seconds).
357 pub valid_duration_in_seconds: Option<u64>,
358 #[builder(default)]
359 /// When provided, the new key can only access the specified bucket. Only the following capabilities can be specified:
360 /// [listAllBucketNames](B2KeyCapability::ListAllBucketNames), [listBuckets](B2KeyCapability::ListBuckets), [readBuckets](B2KeyCapability::ReadBuckets),
361 /// [readBucketEncryption](B2KeyCapability::ReadBucketEncryption), [writeBucketNotifications](B2KeyCapability::WriteBucketEncryption),
362 /// [readBucketNotifications](B2KeyCapability::ReadBucketNotifications), [writeBucketEncryption](B2KeyCapability::WriteBucketEncryption),
363 /// [readBucketRetentions](B2KeyCapability::ReadBucketRetentions), [writeBucketRetentions](B2KeyCapability::WriteBucketRetentions),
364 /// [listFiles](B2KeyCapability::ListFiles), [readFiles](B2KeyCapability::ReadFiles), [shareFiles](B2KeyCapability::ShareFiles),
365 /// [writeFiles](B2KeyCapability::WriteFiles), [deleteFiles](B2KeyCapability::DeleteFiles), [readFileLegalHolds](B2KeyCapability::ReadFileLegalHolds),
366 /// [writeFileLegalHolds](B2KeyCapability::WriteFileLegalHolds), [readFileRetentions](B2KeyCapability::ReadFileRetentions),
367 /// [writeFileRetentions](B2KeyCapability::WriteFileRetentions), and [bypassGovernance](B2KeyCapability::BypassGovernance).
368 /// <br><br> For all buckets, this field can either be left empty or set to null.
369 pub bucket_id: Option<String>,
370 #[builder(default)]
371 /// When provided, this parameter limits access to files with names starting with the specified prefix.
372 /// By default, the restriction is applied to all buckets unless a [bucketId](B2CreateKeyBody::bucket_id) is included in the request.
373 pub name_prefix: Option<String>,
374}