google_cloud_storage/http/objects/watch_all.rs
1use reqwest_middleware::{ClientWithMiddleware as Client, RequestBuilder};
2
3use crate::http::channels::WatchableChannel;
4use crate::http::object_access_controls::Projection;
5use crate::http::Escape;
6
7/// Request message for WatchAllObjects.
8#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Debug)]
9#[serde(rename_all = "camelCase")]
10pub struct WatchAllObjectsRequest {
11 /// Name of the bucket in which to look for objects.
12 #[serde(skip_serializing)]
13 pub bucket: String,
14 /// If `true`, lists all versions of an object as distinct results.
15 /// The default is `false`. For more information, see
16 /// [Object
17 /// Versioning](<https://cloud.google.com/storage/docs/object-versioning>).
18 pub versions: Option<bool>,
19 /// Returns results in a directory-like mode. `items` will contain
20 /// only objects whose names, aside from the `prefix`, do not
21 /// contain `delimiter`. Objects whose names, aside from the
22 /// `prefix`, contain `delimiter` will have their name,
23 /// truncated after the `delimiter`, returned in
24 /// `prefixes`. Duplicate `prefixes` are omitted.
25 pub delimiter: Option<String>,
26 /// Maximum number of `items` plus `prefixes` to return
27 /// in a single page of responses. As duplicate `prefixes` are
28 /// omitted, fewer total results may be returned than requested. The service
29 /// will use this parameter or 1,000 items, whichever is smaller.
30 pub max_results: Option<i32>,
31 /// Filter results to objects whose names begin with this prefix.
32 pub prefix: Option<String>,
33 /// If true, objects that end in exactly one instance of `delimiter`
34 /// will have their metadata included in `items` in addition to
35 /// `prefixes`.
36 pub include_trailing_delimiter: Option<bool>,
37 /// A previously-returned page token representing part of the larger set of
38 /// results to view.
39 pub page_token: Option<String>,
40 /// Set of properties to return. Defaults to `NO_ACL`.
41 pub projection: Option<Projection>,
42 /// Properties of the channel to be inserted.
43 #[serde(skip_serializing)]
44 pub channel: Option<WatchableChannel>,
45}
46
47#[allow(dead_code)]
48pub(crate) fn build(base_url: &str, client: &Client, req: &WatchAllObjectsRequest) -> RequestBuilder {
49 let url = format!("{}/b/{}/o/watch", base_url, req.bucket.escape());
50 client.post(url).query(&req).json(&req.channel)
51}