google_storage1/lib.rs
1// DO NOT EDIT !
2// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
3// DO NOT EDIT !
4
5//! This documentation was generated from *storage* crate version *7.0.0+20251218*, where *20251218* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *storage* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/storage/docs/json_api/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/storage1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Storage) ...
13//!
14//! * anywhere caches
15//! * [*disable*](api::AnywhereCachDisableCall), [*get*](api::AnywhereCachGetCall), [*insert*](api::AnywhereCachInsertCall), [*list*](api::AnywhereCachListCall), [*pause*](api::AnywhereCachPauseCall), [*resume*](api::AnywhereCachResumeCall) and [*update*](api::AnywhereCachUpdateCall)
16//! * [bucket access controls](api::BucketAccessControl)
17//! * [*delete*](api::BucketAccessControlDeleteCall), [*get*](api::BucketAccessControlGetCall), [*insert*](api::BucketAccessControlInsertCall), [*list*](api::BucketAccessControlListCall), [*patch*](api::BucketAccessControlPatchCall) and [*update*](api::BucketAccessControlUpdateCall)
18//! * [buckets](api::Bucket)
19//! * [*delete*](api::BucketDeleteCall), [*get*](api::BucketGetCall), [*get iam policy*](api::BucketGetIamPolicyCall), [*get storage layout*](api::BucketGetStorageLayoutCall), [*insert*](api::BucketInsertCall), [*list*](api::BucketListCall), [*lock retention policy*](api::BucketLockRetentionPolicyCall), [*operations advance relocate bucket*](api::BucketOperationAdvanceRelocateBucketCall), [*operations cancel*](api::BucketOperationCancelCall), [*operations get*](api::BucketOperationGetCall), [*operations list*](api::BucketOperationListCall), [*patch*](api::BucketPatchCall), [*relocate*](api::BucketRelocateCall), [*restore*](api::BucketRestoreCall), [*set iam policy*](api::BucketSetIamPolicyCall), [*test iam permissions*](api::BucketTestIamPermissionCall) and [*update*](api::BucketUpdateCall)
20//! * [channels](api::Channel)
21//! * [*stop*](api::ChannelStopCall)
22//! * default object access controls
23//! * [*delete*](api::DefaultObjectAccessControlDeleteCall), [*get*](api::DefaultObjectAccessControlGetCall), [*insert*](api::DefaultObjectAccessControlInsertCall), [*list*](api::DefaultObjectAccessControlListCall), [*patch*](api::DefaultObjectAccessControlPatchCall) and [*update*](api::DefaultObjectAccessControlUpdateCall)
24//! * [folders](api::Folder)
25//! * [*delete*](api::FolderDeleteCall), [*get*](api::FolderGetCall), [*insert*](api::FolderInsertCall), [*list*](api::FolderListCall) and [*rename*](api::FolderRenameCall)
26//! * [managed folders](api::ManagedFolder)
27//! * [*delete*](api::ManagedFolderDeleteCall), [*get*](api::ManagedFolderGetCall), [*get iam policy*](api::ManagedFolderGetIamPolicyCall), [*insert*](api::ManagedFolderInsertCall), [*list*](api::ManagedFolderListCall), [*set iam policy*](api::ManagedFolderSetIamPolicyCall) and [*test iam permissions*](api::ManagedFolderTestIamPermissionCall)
28//! * [notifications](api::Notification)
29//! * [*delete*](api::NotificationDeleteCall), [*get*](api::NotificationGetCall), [*insert*](api::NotificationInsertCall) and [*list*](api::NotificationListCall)
30//! * [object access controls](api::ObjectAccessControl)
31//! * [*delete*](api::ObjectAccessControlDeleteCall), [*get*](api::ObjectAccessControlGetCall), [*insert*](api::ObjectAccessControlInsertCall), [*list*](api::ObjectAccessControlListCall), [*patch*](api::ObjectAccessControlPatchCall) and [*update*](api::ObjectAccessControlUpdateCall)
32//! * [objects](api::Object)
33//! * [*bulk restore*](api::ObjectBulkRestoreCall), [*compose*](api::ObjectComposeCall), [*copy*](api::ObjectCopyCall), [*delete*](api::ObjectDeleteCall), [*get*](api::ObjectGetCall), [*get iam policy*](api::ObjectGetIamPolicyCall), [*insert*](api::ObjectInsertCall), [*list*](api::ObjectListCall), [*move*](api::ObjectMoveCall), [*patch*](api::ObjectPatchCall), [*restore*](api::ObjectRestoreCall), [*rewrite*](api::ObjectRewriteCall), [*set iam policy*](api::ObjectSetIamPolicyCall), [*test iam permissions*](api::ObjectTestIamPermissionCall), [*update*](api::ObjectUpdateCall) and [*watch all*](api::ObjectWatchAllCall)
34//! * projects
35//! * [*hmac keys create*](api::ProjectHmacKeyCreateCall), [*hmac keys delete*](api::ProjectHmacKeyDeleteCall), [*hmac keys get*](api::ProjectHmacKeyGetCall), [*hmac keys list*](api::ProjectHmacKeyListCall), [*hmac keys update*](api::ProjectHmacKeyUpdateCall) and [*service account get*](api::ProjectServiceAccountGetCall)
36//!
37//!
38//! Upload supported by ...
39//!
40//! * [*insert objects*](api::ObjectInsertCall)
41//!
42//! Download supported by ...
43//!
44//! * [*get objects*](api::ObjectGetCall)
45//!
46//! Subscription supported by ...
47//!
48//! * [*list objects*](api::ObjectListCall)
49//! * [*watch all objects*](api::ObjectWatchAllCall)
50//!
51//!
52//!
53//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
54//!
55//! # Structure of this Library
56//!
57//! The API is structured into the following primary items:
58//!
59//! * **[Hub](Storage)**
60//! * a central object to maintain state and allow accessing all *Activities*
61//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
62//! allow access to individual [*Call Builders*](common::CallBuilder)
63//! * **[Resources](common::Resource)**
64//! * primary types that you can apply *Activities* to
65//! * a collection of properties and *Parts*
66//! * **[Parts](common::Part)**
67//! * a collection of properties
68//! * never directly used in *Activities*
69//! * **[Activities](common::CallBuilder)**
70//! * operations to apply to *Resources*
71//!
72//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
73//!
74//! Generally speaking, you can invoke *Activities* like this:
75//!
76//! ```Rust,ignore
77//! let r = hub.resource().activity(...).doit().await
78//! ```
79//!
80//! Or specifically ...
81//!
82//! ```ignore
83//! let r = hub.buckets().delete(...).doit().await
84//! let r = hub.buckets().get(...).doit().await
85//! let r = hub.buckets().get_iam_policy(...).doit().await
86//! let r = hub.buckets().get_storage_layout(...).doit().await
87//! let r = hub.buckets().insert(...).doit().await
88//! let r = hub.buckets().list(...).doit().await
89//! let r = hub.buckets().lock_retention_policy(...).doit().await
90//! let r = hub.buckets().patch(...).doit().await
91//! let r = hub.buckets().relocate(...).doit().await
92//! let r = hub.buckets().restore(...).doit().await
93//! let r = hub.buckets().set_iam_policy(...).doit().await
94//! let r = hub.buckets().test_iam_permissions(...).doit().await
95//! let r = hub.buckets().update(...).doit().await
96//! let r = hub.buckets().operations_advance_relocate_bucket(...).doit().await
97//! let r = hub.buckets().operations_cancel(...).doit().await
98//! let r = hub.buckets().operations_get(...).doit().await
99//! let r = hub.buckets().operations_list(...).doit().await
100//! ```
101//!
102//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
103//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
104//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
105//! The `doit()` method performs the actual communication with the server and returns the respective result.
106//!
107//! # Usage
108//!
109//! ## Setting up your Project
110//!
111//! To use this library, you would put the following lines into your `Cargo.toml` file:
112//!
113//! ```toml
114//! [dependencies]
115//! google-storage1 = "*"
116//! serde = "1"
117//! serde_json = "1"
118//! ```
119//!
120//! ## A complete example
121//!
122//! ```test_harness,no_run
123//! extern crate hyper;
124//! extern crate hyper_rustls;
125//! extern crate google_storage1 as storage1;
126//! use storage1::{Result, Error};
127//! # async fn dox() {
128//! use storage1::{Storage, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
129//!
130//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
131//! // `client_secret`, among other things.
132//! let secret: yup_oauth2::ApplicationSecret = Default::default();
133//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
134//! // unless you replace `None` with the desired Flow.
135//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
136//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
137//! // retrieve them from storage.
138//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
139//! .with_native_roots()
140//! .unwrap()
141//! .https_only()
142//! .enable_http2()
143//! .build();
144//!
145//! let executor = hyper_util::rt::TokioExecutor::new();
146//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
147//! secret,
148//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
149//! yup_oauth2::client::CustomHyperClientBuilder::from(
150//! hyper_util::client::legacy::Client::builder(executor).build(connector),
151//! ),
152//! ).build().await.unwrap();
153//!
154//! let client = hyper_util::client::legacy::Client::builder(
155//! hyper_util::rt::TokioExecutor::new()
156//! )
157//! .build(
158//! hyper_rustls::HttpsConnectorBuilder::new()
159//! .with_native_roots()
160//! .unwrap()
161//! .https_or_http()
162//! .enable_http2()
163//! .build()
164//! );
165//! let mut hub = Storage::new(client, auth);
166//! // You can configure optional parameters by calling the respective setters at will, and
167//! // execute the final call using `doit()`.
168//! // Values shown here are possibly random and not representative !
169//! let result = hub.buckets().list("project")
170//! .user_project("gubergren")
171//! .soft_deleted(true)
172//! .return_partial_success(false)
173//! .projection("dolor")
174//! .prefix("ea")
175//! .page_token("ipsum")
176//! .max_results(13)
177//! .doit().await;
178//!
179//! match result {
180//! Err(e) => match e {
181//! // The Error enum provides details about what exactly happened.
182//! // You can also just use its `Debug`, `Display` or `Error` traits
183//! Error::HttpError(_)
184//! |Error::Io(_)
185//! |Error::MissingAPIKey
186//! |Error::MissingToken(_)
187//! |Error::Cancelled
188//! |Error::UploadSizeLimitExceeded(_, _)
189//! |Error::Failure(_)
190//! |Error::BadRequest(_)
191//! |Error::FieldClash(_)
192//! |Error::JsonDecodeError(_, _) => println!("{}", e),
193//! },
194//! Ok(res) => println!("Success: {:?}", res),
195//! }
196//! # }
197//! ```
198//! ## Handling Errors
199//!
200//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
201//! the doit() methods, or handed as possibly intermediate results to either the
202//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
203//!
204//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
205//! makes the system potentially resilient to all kinds of errors.
206//!
207//! ## Uploads and Downloads
208//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
209//! read by you to obtain the media.
210//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
211//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
212//! this call: `.param("alt", "media")`.
213//!
214//! Methods supporting uploads can do so using up to 2 different protocols:
215//! *simple* and *resumable*. The distinctiveness of each is represented by customized
216//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
217//!
218//! ## Customization and Callbacks
219//!
220//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
221//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
222//! Respective methods will be called to provide progress information, as well as determine whether the system should
223//! retry on failure.
224//!
225//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
226//!
227//! ## Optional Parts in Server-Requests
228//!
229//! All structures provided by this library are made to be [encodable](common::RequestValue) and
230//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
231//! are valid.
232//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
233//! the server to indicate either the set parts of the request or the desired parts in the response.
234//!
235//! ## Builder Arguments
236//!
237//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
238//! These will always take a single argument, for which the following statements are true.
239//!
240//! * [PODs][wiki-pod] are handed by copy
241//! * strings are passed as `&str`
242//! * [request values](common::RequestValue) are moved
243//!
244//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
245//!
246//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
247//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
248//! [google-go-api]: https://github.com/google/google-api-go-client
249//!
250//! ## Cargo Features
251//!
252//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
253//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
254//! generated `openapi` spec would be invalid.
255//!
256//!
257//!
258
259// Unused attributes happen thanks to defined, but unused structures We don't
260// warn about this, as depending on the API, some data structures or facilities
261// are never used. Instead of pre-determining this, we just disable the lint.
262// It's manually tuned to not have any unused imports in fully featured APIs.
263// Same with unused_mut.
264#![allow(unused_imports, unused_mut, dead_code)]
265
266// DO NOT EDIT !
267// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
268// DO NOT EDIT !
269
270pub extern crate hyper;
271pub extern crate hyper_rustls;
272pub extern crate hyper_util;
273#[cfg(feature = "yup-oauth2")]
274pub extern crate yup_oauth2;
275
276pub extern crate google_apis_common as common;
277pub use common::{Delegate, Error, FieldMask, Result};
278
279pub mod api;
280pub use api::Storage;