backblaze_b2_client/definitions/
query_params.rs

1use std::num::NonZeroU32;
2
3use serde::{Deserialize, Serialize};
4use typed_builder::TypedBuilder;
5
6#[derive(Clone, Debug, Deserialize, Serialize, TypedBuilder)]
7#[serde(rename_all = "camelCase")]
8#[builder(field_defaults(default))]
9pub struct B2ListUnfinishedLargeFilesQueryParameters {
10    #[builder(!default)]
11    /// The bucket to look for file names in.
12    pub bucket_id: String,
13    /// When a `namePrefix` is provided, only files whose names match the prefix will be returned.
14    /// Whe using an application key that is restricted to a name prefix, you must provide a prefix here that is at least as restrictive.
15    pub name_prefix: Option<String>,
16    /// The first upload to return. If there is an upload with this ID, it will be returned in the list. If not, the first upload after this the first one after this ID.
17    pub start_file_id: Option<String>,
18    /// The maximum number of files to return from this call. The default value is 100, and the maximum allowed is 100.
19    pub max_file_count: Option<u8>,
20}
21
22#[derive(Clone, Debug, Deserialize, Serialize, TypedBuilder)]
23#[serde(rename_all = "camelCase")]
24#[builder(field_defaults(default))]
25pub struct B2ListPartsQueryParameters {
26    #[builder(!default)]
27    /// The ID returned by [b2_start_large_file](crate::simple_client::B2SimpleClient::start_large_file).
28    /// This is the file whose parts will be listed.
29    pub file_id: String,
30    /// The first part to return. If there is a part with this number, it will be returned as the first in the list.
31    /// If not, the returned list will start with the first part number after this one.
32    pub start_part_number: Option<u32>,
33    /// The maximum number of parts to return from this call. The default value is 100, and the maximum allowed is 1000.
34    pub max_part_count: Option<u16>,
35}
36
37#[derive(Clone, Debug, Deserialize, Serialize, TypedBuilder)]
38#[serde(rename_all = "camelCase")]
39#[builder(field_defaults(default))]
40pub struct B2ListKeysParameters {
41    #[builder(!default)]
42    /// The ID of your account.
43    pub account_id: String,
44    /// The maximum number of files to return from this call. The default value is 100, and the maximum is 10000. Passing in 0 means to use the default of 100.
45    /// <br><br><Br>
46    /// NOTE: [b2_list_keys](crate::simple_client::B2SimpleClient::list_keys) is a Class C transaction (see [Pricing](https://www.backblaze.com/b2/cloud-storage-pricing.html)).
47    /// The maximum number of files returned per transaction is 1000. If you set maxFileCount to more than 1000 and more than 1000 are returned,
48    /// the call will be billed as multiple transactions, as if you had made requests in a loop asking for 1000 at a time. For example:
49    /// if you set maxFileCount to 10000 and 3123 items are returned, you will be billed for 4 Class C transactions.
50    pub max_key_count: Option<u16>,
51    /// The first key to return. Used when a query hits the maxKeyCount, and you want to get more.
52    /// Set to the value returned as the nextApplicationKeyId in the previous query.
53    pub start_application_key_id: Option<String>,
54}
55
56#[derive(Clone, Debug, Serialize, TypedBuilder)]
57#[serde(rename_all = "camelCase")]
58#[builder(field_defaults(default))]
59pub struct B2ListFileVersionsQueryParameters {
60    #[builder(!default)]
61    /// The bucket to look for file names in.
62    pub bucket_id: String,
63    /// The first file name to return.
64    /// <br> If there are no files with this name, the first version of the file with the first name after the given name will be the first in the list.
65    /// <br> If startFileId is also specified, the name-and-id pair is the starting point. If there is a file with the given name and ID, it will be first in the list.
66    /// Otherwise, the first file version that comes after the given name and ID will be first in the list.
67    pub start_file_name: Option<String>,
68    /// The first file ID to return. `startFileName` must also be provided if `startFileId` is specified. (See [startFileName](B2ListFileVersionsQueryParameters::start_file_name))
69    pub start_file_id: Option<String>,
70    /// The maximum number of files to return from this call. The default value is 100, and the maximum is 10000. Passing in 0 means to use the default of 100.
71    /// <br><br><Br>
72    /// NOTE: [b2_list_file_versions](crate::simple_client::B2SimpleClient::list_file_versions) is a Class C transaction (see [Pricing](https://www.backblaze.com/b2/cloud-storage-pricing.html)).
73    /// The maximum number of files returned per transaction is 1000. If you set maxFileCount to more than 1000 and more than 1000 are returned,
74    /// the call will be billed as multiple transactions, as if you had made requests in a loop asking for 1000 at a time. For example:
75    /// if you set maxFileCount to 10000 and 3123 items are returned, you will be billed for 4 Class C transactions.
76    pub max_file_count: Option<NonZeroU32>,
77    /// Files returned will be limited to those with the given prefix. Defaults to the empty string, which matches all files.
78    pub prefix: Option<String>,
79    /// Files returned will be limited to those within the top folder, or any one subfolder. Defaults to NULL.
80    /// Folder names will also be returned. The delimiter character will be used to "break" file names into folders.
81    pub delimiter: Option<String>,
82}
83
84#[derive(Clone, Debug, Serialize, TypedBuilder)]
85#[serde(rename_all = "camelCase")]
86#[builder(field_defaults(default))]
87pub struct B2ListFileNamesQueryParameters {
88    #[builder(!default)]
89    /// The bucket to look for file names in. Returned by [b2_list_buckets](crate::simple_client::B2SimpleClient::list_buckets).
90    pub bucket_id: String,
91    /// The first file name to return. If there is a file with this name, it will be returned in the list. If not, the first file name after this the first one after this name.
92    pub start_file_name: Option<String>,
93    /// The maximum number of files to return from this call. The default value is 100, and the maximum is 10000. Passing in 0 means to use the default of 100.
94    /// <br><br><Br>
95    /// NOTE: [b2_list_file_names](crate::simple_client::B2SimpleClient::list_file_names) is a Class C transaction (see [Pricing](https://www.backblaze.com/b2/cloud-storage-pricing.html)).
96    /// The maximum number of files returned per transaction is 1000. If you set maxFileCount to more than 1000 and more than 1000 are returned,
97    /// the call will be billed as multiple transactions, as if you had made requests in a loop asking for 1000 at a time. For example:
98    /// if you set maxFileCount to 10000 and 3123 items are returned, you will be billed for 4 Class C transactions.
99    pub max_file_count: Option<NonZeroU32>,
100    /// Files returned will be limited to those with the given prefix. Defaults to the empty string, which matches all files.
101    pub prefix: Option<String>,
102    /// Files returned will be limited to those within the top folder, or any one subfolder. Defaults to NULL.
103    /// Folder names will also be returned. The delimiter character will be used to "break" file names into folders.
104    pub delimiter: Option<String>,
105}
106
107#[derive(Clone, Debug, Deserialize, Serialize, TypedBuilder)]
108#[serde(rename_all = "camelCase")]
109#[builder(field_defaults(default))]
110pub struct B2DownloadFileQueryParameters {
111    /// If this is present, B2 will use it as the value of the 'Content-Disposition' header, overriding any 'b2-content-disposition' specified when the file was uploaded.
112    /// <br><br>The value must match the grammar specified in RFC 6266. Parameter continuations are not supported.
113    /// 'Extended-value's are supported for charset 'UTF-8' (case-insensitive) when the language is empty.
114    /// Note that this file info will not be included in downloads as a x-bz-info-b2-content-disposition header.
115    /// Instead, it (or the value specified in a request) will be in the Content-Disposition.
116    /// <br><br>If including this header in the response exceeds the 7000-byte overall limit (2048 bytes for files encrypted with SSE), this request will be rejected.
117    /// See [Files](https://www.backblaze.com/docs/cloud-storage-files) for further details about HTTP header size limit.
118    /// <br><br>Requests with this specified must also have an authorization token.
119    pub b2_content_disposition: Option<String>,
120    /// If this is present, B2 will use it as the value of the 'Content-Language' header, overriding any 'b2-content-language' specified when the file was uploaded.
121    /// <br><br>The value must match the grammar specified in RFC 2616. Note that this file info will not be included in downloads as a x-bz-info-b2-content-language header.
122    /// Instead, it (or the value specified in a request) will be in the Content-Language.
123    /// <br><br>If including this header in the response exceeds the 7000-byte overall limit (2048 bytes for files encrypted with SSE), this request will be rejected.
124    /// See [Files](https://www.backblaze.com/docs/cloud-storage-files) for further details about HTTP header size limit.
125    /// <br><br>Requests with this specified must also have an authorization token.
126    pub b2_content_language: Option<String>,
127    /// If this is present, B2 will use it as the value of the 'Expires' header, overriding any 'b2-expires' specified when the file was uploaded.
128    /// <br><br>The value must match the grammar specified in RFC 2616. Note that this file info will not be included in downloads as a x-bz-info-b2-expires header.
129    /// Instead, it (or the value specified in a request) will be in the Expires.
130    /// <br><br>If including this header in the response exceeds the 7000-byte overall limit (2048 bytes for files encrypted with SSE), this request will be rejected.
131    /// See [Files](https://www.backblaze.com/docs/cloud-storage-files) for further details about HTTP header size limit.
132    /// <br><br>Requests with this specified must also have an authorization token.
133    pub b2_expires: Option<String>,
134    /// If this is present, B2 will use it as the value of the 'Cache-Control' header, overriding any 'b2-cache-control' specified when the file was uploaded.
135    /// <br><br>The value must match the grammar specified in RFC 2616. Note that this file info will not be included in downloads as a x-bz-info-b2-cache-control header.
136    /// Instead, it (or the value specified in a request) will be in the Cache-Control.
137    /// <br><br>If including this header in the response exceeds the 7000-byte overall limit (2048 bytes for files encrypted with SSE), this request will be rejected.
138    /// See [Files](https://www.backblaze.com/docs/cloud-storage-files) for further details about HTTP header size limit.
139    /// <br><br>Requests with this specified must also have an authorization token.
140    pub b2_cache_control: Option<String>,
141    /// If this is present, B2 will use it as the value of the 'Content-Encoding' header, overriding any 'b2-content-encoding' specified when the file was uploaded.
142    /// <br><br>The value must match the grammar specified in RFC 2616. Note that this file info will not be included in downloads as a x-bz-info-b2-content-encoding header.
143    /// Instead, it (or the value specified in a request) will be in the Content-Encoding.
144    /// <br><br>If including this header in the response exceeds the 7000-byte overall limit (2048 bytes for files encrypted with SSE), this request will be rejected.
145    /// See [Files](https://www.backblaze.com/docs/cloud-storage-files) for further details about HTTP header size limit.
146    /// <br><br>Requests with this specified must also have an authorization token.
147    pub b2_content_encoding: Option<String>,
148    /// If this is present, B2 will use it as the value of the 'Content-Type' header, overriding any 'Content-Type' specified when the file was uploaded.
149    /// <br><br>The value must match the grammar specified in RFC 2616. Note that this file info will not be included in downloads as a x-bz-info-b2-content-type header.
150    /// Instead, it (or the value specified in a request) will be in the Content-Type.
151    /// <br><br>If including this header in the response exceeds the 7000-byte overall limit (2048 bytes for files encrypted with SSE), this request will be rejected.
152    /// See [Files](https://www.backblaze.com/docs/cloud-storage-files) for further details about HTTP header size limit.
153    /// <br><br>Requests with this specified must also have an authorization token.
154    pub b2_content_type: Option<String>,
155}