gcloud_storage/http/buckets/
list.rs

1use reqwest_middleware::{ClientWithMiddleware as Client, RequestBuilder};
2
3use crate::http::buckets::Bucket;
4use crate::http::object_access_controls::Projection;
5
6/// Request message for DeleteBucket.
7#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Debug, Default)]
8#[serde(rename_all = "camelCase")]
9pub struct ListBucketsRequest {
10    /// Required. A valid API project identifier.
11    pub project: String,
12    /// Maximum number of buckets to return in a single response. The service will
13    /// use this parameter or 1,000 items, whichever is smaller.
14    pub max_results: Option<i32>,
15    /// A previously-returned page token representing part of the larger set of
16    /// results to view.
17    pub page_token: Option<String>,
18    /// Filter results to buckets whose names begin with this prefix.
19    pub prefix: Option<String>,
20    /// Set of properties to return. Defaults to `NO_ACL`.
21    pub projection: Option<Projection>,
22    /// A glob pattern used to filter results (for example, foo*bar).
23    pub match_glob: Option<String>,
24}
25
26/// The result of a call to Buckets.ListBuckets
27#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Debug)]
28#[serde(rename_all = "camelCase")]
29pub struct ListBucketsResponse {
30    /// The list of items.
31    pub items: Vec<Bucket>,
32    /// The continuation token, used to page through large result sets. Provide
33    /// this value in a subsequent request to return the next page of results.
34    pub next_page_token: Option<String>,
35}
36
37pub(crate) fn build(base_url: &str, client: &Client, req: &ListBucketsRequest) -> RequestBuilder {
38    let url = format!("{base_url}/b");
39    client.get(url).query(&req)
40}