google_vault1/
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 *Vault* crate version *6.0.0+20240617*, where *20240617* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v6.0.0*.
6//!
7//! Everything else about the *Vault* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/vault).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/vault1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Vault) ...
13//!
14//! * [matters](api::Matter)
15//!  * [*add permissions*](api::MatterAddPermissionCall), [*close*](api::MatterCloseCall), [*count*](api::MatterCountCall), [*create*](api::MatterCreateCall), [*delete*](api::MatterDeleteCall), [*exports create*](api::MatterExportCreateCall), [*exports delete*](api::MatterExportDeleteCall), [*exports get*](api::MatterExportGetCall), [*exports list*](api::MatterExportListCall), [*get*](api::MatterGetCall), [*holds accounts create*](api::MatterHoldAccountCreateCall), [*holds accounts delete*](api::MatterHoldAccountDeleteCall), [*holds accounts list*](api::MatterHoldAccountListCall), [*holds add held accounts*](api::MatterHoldAddHeldAccountCall), [*holds create*](api::MatterHoldCreateCall), [*holds delete*](api::MatterHoldDeleteCall), [*holds get*](api::MatterHoldGetCall), [*holds list*](api::MatterHoldListCall), [*holds remove held accounts*](api::MatterHoldRemoveHeldAccountCall), [*holds update*](api::MatterHoldUpdateCall), [*list*](api::MatterListCall), [*remove permissions*](api::MatterRemovePermissionCall), [*reopen*](api::MatterReopenCall), [*saved queries create*](api::MatterSavedQueryCreateCall), [*saved queries delete*](api::MatterSavedQueryDeleteCall), [*saved queries get*](api::MatterSavedQueryGetCall), [*saved queries list*](api::MatterSavedQueryListCall), [*undelete*](api::MatterUndeleteCall) and [*update*](api::MatterUpdateCall)
16//! * [operations](api::Operation)
17//!  * [*cancel*](api::OperationCancelCall), [*delete*](api::OperationDeleteCall), [*get*](api::OperationGetCall) and [*list*](api::OperationListCall)
18//!
19//!
20//!
21//!
22//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
23//!
24//! # Structure of this Library
25//!
26//! The API is structured into the following primary items:
27//!
28//! * **[Hub](Vault)**
29//!     * a central object to maintain state and allow accessing all *Activities*
30//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
31//!       allow access to individual [*Call Builders*](common::CallBuilder)
32//! * **[Resources](common::Resource)**
33//!     * primary types that you can apply *Activities* to
34//!     * a collection of properties and *Parts*
35//!     * **[Parts](common::Part)**
36//!         * a collection of properties
37//!         * never directly used in *Activities*
38//! * **[Activities](common::CallBuilder)**
39//!     * operations to apply to *Resources*
40//!
41//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
42//!
43//! Generally speaking, you can invoke *Activities* like this:
44//!
45//! ```Rust,ignore
46//! let r = hub.resource().activity(...).doit().await
47//! ```
48//!
49//! Or specifically ...
50//!
51//! ```ignore
52//! let r = hub.matters().exports_create(...).doit().await
53//! let r = hub.matters().exports_delete(...).doit().await
54//! let r = hub.matters().exports_get(...).doit().await
55//! let r = hub.matters().exports_list(...).doit().await
56//! let r = hub.matters().holds_accounts_create(...).doit().await
57//! let r = hub.matters().holds_accounts_delete(...).doit().await
58//! let r = hub.matters().holds_accounts_list(...).doit().await
59//! let r = hub.matters().holds_add_held_accounts(...).doit().await
60//! let r = hub.matters().holds_create(...).doit().await
61//! let r = hub.matters().holds_delete(...).doit().await
62//! let r = hub.matters().holds_get(...).doit().await
63//! let r = hub.matters().holds_list(...).doit().await
64//! let r = hub.matters().holds_remove_held_accounts(...).doit().await
65//! let r = hub.matters().holds_update(...).doit().await
66//! let r = hub.matters().saved_queries_create(...).doit().await
67//! let r = hub.matters().saved_queries_delete(...).doit().await
68//! let r = hub.matters().saved_queries_get(...).doit().await
69//! let r = hub.matters().saved_queries_list(...).doit().await
70//! let r = hub.matters().add_permissions(...).doit().await
71//! let r = hub.matters().close(...).doit().await
72//! let r = hub.matters().count(...).doit().await
73//! let r = hub.matters().create(...).doit().await
74//! let r = hub.matters().delete(...).doit().await
75//! let r = hub.matters().get(...).doit().await
76//! let r = hub.matters().list(...).doit().await
77//! let r = hub.matters().remove_permissions(...).doit().await
78//! let r = hub.matters().reopen(...).doit().await
79//! let r = hub.matters().undelete(...).doit().await
80//! let r = hub.matters().update(...).doit().await
81//! ```
82//!
83//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
84//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
85//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
86//! The `doit()` method performs the actual communication with the server and returns the respective result.
87//!
88//! # Usage
89//!
90//! ## Setting up your Project
91//!
92//! To use this library, you would put the following lines into your `Cargo.toml` file:
93//!
94//! ```toml
95//! [dependencies]
96//! google-vault1 = "*"
97//! serde = "1"
98//! serde_json = "1"
99//! ```
100//!
101//! ## A complete example
102//!
103//! ```test_harness,no_run
104//! extern crate hyper;
105//! extern crate hyper_rustls;
106//! extern crate google_vault1 as vault1;
107//! use vault1::{Result, Error};
108//! # async fn dox() {
109//! use vault1::{Vault, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
110//!
111//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
112//! // `client_secret`, among other things.
113//! let secret: yup_oauth2::ApplicationSecret = Default::default();
114//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
115//! // unless you replace  `None` with the desired Flow.
116//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
117//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
118//! // retrieve them from storage.
119//! let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
120//!     secret,
121//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
122//! ).build().await.unwrap();
123//!
124//! let client = hyper_util::client::legacy::Client::builder(
125//!     hyper_util::rt::TokioExecutor::new()
126//! )
127//! .build(
128//!     hyper_rustls::HttpsConnectorBuilder::new()
129//!         .with_native_roots()
130//!         .unwrap()
131//!         .https_or_http()
132//!         .enable_http1()
133//!         .build()
134//! );
135//! let mut hub = Vault::new(client, auth);
136//! // You can configure optional parameters by calling the respective setters at will, and
137//! // execute the final call using `doit()`.
138//! // Values shown here are possibly random and not representative !
139//! let result = hub.matters().holds_list("matterId")
140//!              .view("At")
141//!              .page_token("sanctus")
142//!              .page_size(-80)
143//!              .doit().await;
144//!
145//! match result {
146//!     Err(e) => match e {
147//!         // The Error enum provides details about what exactly happened.
148//!         // You can also just use its `Debug`, `Display` or `Error` traits
149//!          Error::HttpError(_)
150//!         |Error::Io(_)
151//!         |Error::MissingAPIKey
152//!         |Error::MissingToken(_)
153//!         |Error::Cancelled
154//!         |Error::UploadSizeLimitExceeded(_, _)
155//!         |Error::Failure(_)
156//!         |Error::BadRequest(_)
157//!         |Error::FieldClash(_)
158//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
159//!     },
160//!     Ok(res) => println!("Success: {:?}", res),
161//! }
162//! # }
163//! ```
164//! ## Handling Errors
165//!
166//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
167//! the doit() methods, or handed as possibly intermediate results to either the
168//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
169//!
170//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
171//! makes the system potentially resilient to all kinds of errors.
172//!
173//! ## Uploads and Downloads
174//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
175//! read by you to obtain the media.
176//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
177//! 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
178//! this call: `.param("alt", "media")`.
179//!
180//! Methods supporting uploads can do so using up to 2 different protocols:
181//! *simple* and *resumable*. The distinctiveness of each is represented by customized
182//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
183//!
184//! ## Customization and Callbacks
185//!
186//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
187//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
188//! Respective methods will be called to provide progress information, as well as determine whether the system should
189//! retry on failure.
190//!
191//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
192//!
193//! ## Optional Parts in Server-Requests
194//!
195//! All structures provided by this library are made to be [encodable](common::RequestValue) and
196//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
197//! are valid.
198//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
199//! the server to indicate either the set parts of the request or the desired parts in the response.
200//!
201//! ## Builder Arguments
202//!
203//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
204//! These will always take a single argument, for which the following statements are true.
205//!
206//! * [PODs][wiki-pod] are handed by copy
207//! * strings are passed as `&str`
208//! * [request values](common::RequestValue) are moved
209//!
210//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
211//!
212//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
213//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
214//! [google-go-api]: https://github.com/google/google-api-go-client
215//!
216//! ## Cargo Features
217//!
218//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
219//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
220//! generated `openapi` spec would be invalid.
221//!
222//!
223//!
224
225// Unused attributes happen thanks to defined, but unused structures We don't
226// warn about this, as depending on the API, some data structures or facilities
227// are never used. Instead of pre-determining this, we just disable the lint.
228// It's manually tuned to not have any unused imports in fully featured APIs.
229// Same with unused_mut.
230#![allow(unused_imports, unused_mut, dead_code)]
231
232// DO NOT EDIT !
233// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
234// DO NOT EDIT !
235
236pub extern crate hyper;
237pub extern crate hyper_rustls;
238pub extern crate hyper_util;
239#[cfg(feature = "yup-oauth2")]
240pub extern crate yup_oauth2;
241
242pub extern crate google_apis_common as common;
243pub use common::{Delegate, Error, FieldMask, Result};
244
245pub mod api;
246pub use api::Vault;