google_firestore1/
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 *Firestore* crate version *7.0.0+20251216*, where *20251216* is the exact revision of the *firestore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Firestore* *v1* API can be found at the
8//! [official documentation site](https://cloud.google.com/firestore).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/firestore1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Firestore) ...
13//!
14//! * projects
15//!  * [*databases backup schedules create*](api::ProjectDatabaseBackupScheduleCreateCall), [*databases backup schedules delete*](api::ProjectDatabaseBackupScheduleDeleteCall), [*databases backup schedules get*](api::ProjectDatabaseBackupScheduleGetCall), [*databases backup schedules list*](api::ProjectDatabaseBackupScheduleListCall), [*databases backup schedules patch*](api::ProjectDatabaseBackupSchedulePatchCall), [*databases bulk delete documents*](api::ProjectDatabaseBulkDeleteDocumentCall), [*databases clone*](api::ProjectDatabaseCloneCall), [*databases collection groups fields get*](api::ProjectDatabaseCollectionGroupFieldGetCall), [*databases collection groups fields list*](api::ProjectDatabaseCollectionGroupFieldListCall), [*databases collection groups fields patch*](api::ProjectDatabaseCollectionGroupFieldPatchCall), [*databases collection groups indexes create*](api::ProjectDatabaseCollectionGroupIndexCreateCall), [*databases collection groups indexes delete*](api::ProjectDatabaseCollectionGroupIndexDeleteCall), [*databases collection groups indexes get*](api::ProjectDatabaseCollectionGroupIndexGetCall), [*databases collection groups indexes list*](api::ProjectDatabaseCollectionGroupIndexListCall), [*databases create*](api::ProjectDatabaseCreateCall), [*databases delete*](api::ProjectDatabaseDeleteCall), [*databases documents batch get*](api::ProjectDatabaseDocumentBatchGetCall), [*databases documents batch write*](api::ProjectDatabaseDocumentBatchWriteCall), [*databases documents begin transaction*](api::ProjectDatabaseDocumentBeginTransactionCall), [*databases documents commit*](api::ProjectDatabaseDocumentCommitCall), [*databases documents create document*](api::ProjectDatabaseDocumentCreateDocumentCall), [*databases documents delete*](api::ProjectDatabaseDocumentDeleteCall), [*databases documents execute pipeline*](api::ProjectDatabaseDocumentExecutePipelineCall), [*databases documents get*](api::ProjectDatabaseDocumentGetCall), [*databases documents list*](api::ProjectDatabaseDocumentListCall), [*databases documents list collection ids*](api::ProjectDatabaseDocumentListCollectionIdCall), [*databases documents list documents*](api::ProjectDatabaseDocumentListDocumentCall), [*databases documents listen*](api::ProjectDatabaseDocumentListenCall), [*databases documents partition query*](api::ProjectDatabaseDocumentPartitionQueryCall), [*databases documents patch*](api::ProjectDatabaseDocumentPatchCall), [*databases documents rollback*](api::ProjectDatabaseDocumentRollbackCall), [*databases documents run aggregation query*](api::ProjectDatabaseDocumentRunAggregationQueryCall), [*databases documents run query*](api::ProjectDatabaseDocumentRunQueryCall), [*databases documents write*](api::ProjectDatabaseDocumentWriteCall), [*databases export documents*](api::ProjectDatabaseExportDocumentCall), [*databases get*](api::ProjectDatabaseGetCall), [*databases import documents*](api::ProjectDatabaseImportDocumentCall), [*databases list*](api::ProjectDatabaseListCall), [*databases operations cancel*](api::ProjectDatabaseOperationCancelCall), [*databases operations delete*](api::ProjectDatabaseOperationDeleteCall), [*databases operations get*](api::ProjectDatabaseOperationGetCall), [*databases operations list*](api::ProjectDatabaseOperationListCall), [*databases patch*](api::ProjectDatabasePatchCall), [*databases restore*](api::ProjectDatabaseRestoreCall), [*databases user creds create*](api::ProjectDatabaseUserCredCreateCall), [*databases user creds delete*](api::ProjectDatabaseUserCredDeleteCall), [*databases user creds disable*](api::ProjectDatabaseUserCredDisableCall), [*databases user creds enable*](api::ProjectDatabaseUserCredEnableCall), [*databases user creds get*](api::ProjectDatabaseUserCredGetCall), [*databases user creds list*](api::ProjectDatabaseUserCredListCall), [*databases user creds reset password*](api::ProjectDatabaseUserCredResetPasswordCall), [*locations backups delete*](api::ProjectLocationBackupDeleteCall), [*locations backups get*](api::ProjectLocationBackupGetCall), [*locations backups list*](api::ProjectLocationBackupListCall), [*locations get*](api::ProjectLocationGetCall) and [*locations list*](api::ProjectLocationListCall)
16//!
17//!
18//!
19//!
20//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
21//!
22//! # Structure of this Library
23//!
24//! The API is structured into the following primary items:
25//!
26//! * **[Hub](Firestore)**
27//!     * a central object to maintain state and allow accessing all *Activities*
28//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
29//!       allow access to individual [*Call Builders*](common::CallBuilder)
30//! * **[Resources](common::Resource)**
31//!     * primary types that you can apply *Activities* to
32//!     * a collection of properties and *Parts*
33//!     * **[Parts](common::Part)**
34//!         * a collection of properties
35//!         * never directly used in *Activities*
36//! * **[Activities](common::CallBuilder)**
37//!     * operations to apply to *Resources*
38//!
39//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
40//!
41//! Generally speaking, you can invoke *Activities* like this:
42//!
43//! ```Rust,ignore
44//! let r = hub.resource().activity(...).doit().await
45//! ```
46//!
47//! Or specifically ...
48//!
49//! ```ignore
50//! let r = hub.projects().databases_collection_groups_fields_patch(...).doit().await
51//! let r = hub.projects().databases_collection_groups_indexes_create(...).doit().await
52//! let r = hub.projects().databases_operations_get(...).doit().await
53//! let r = hub.projects().databases_bulk_delete_documents(...).doit().await
54//! let r = hub.projects().databases_clone(...).doit().await
55//! let r = hub.projects().databases_create(...).doit().await
56//! let r = hub.projects().databases_delete(...).doit().await
57//! let r = hub.projects().databases_export_documents(...).doit().await
58//! let r = hub.projects().databases_import_documents(...).doit().await
59//! let r = hub.projects().databases_patch(...).doit().await
60//! let r = hub.projects().databases_restore(...).doit().await
61//! ```
62//!
63//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
64//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
65//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
66//! The `doit()` method performs the actual communication with the server and returns the respective result.
67//!
68//! # Usage
69//!
70//! ## Setting up your Project
71//!
72//! To use this library, you would put the following lines into your `Cargo.toml` file:
73//!
74//! ```toml
75//! [dependencies]
76//! google-firestore1 = "*"
77//! serde = "1"
78//! serde_json = "1"
79//! ```
80//!
81//! ## A complete example
82//!
83//! ```test_harness,no_run
84//! extern crate hyper;
85//! extern crate hyper_rustls;
86//! extern crate google_firestore1 as firestore1;
87//! use firestore1::api::GoogleFirestoreAdminV1Field;
88//! use firestore1::{Result, Error};
89//! # async fn dox() {
90//! use firestore1::{Firestore, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
91//!
92//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
93//! // `client_secret`, among other things.
94//! let secret: yup_oauth2::ApplicationSecret = Default::default();
95//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
96//! // unless you replace  `None` with the desired Flow.
97//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
98//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
99//! // retrieve them from storage.
100//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
101//!     .with_native_roots()
102//!     .unwrap()
103//!     .https_only()
104//!     .enable_http2()
105//!     .build();
106//!
107//! let executor = hyper_util::rt::TokioExecutor::new();
108//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
109//!     secret,
110//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
111//!     yup_oauth2::client::CustomHyperClientBuilder::from(
112//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
113//!     ),
114//! ).build().await.unwrap();
115//!
116//! let client = hyper_util::client::legacy::Client::builder(
117//!     hyper_util::rt::TokioExecutor::new()
118//! )
119//! .build(
120//!     hyper_rustls::HttpsConnectorBuilder::new()
121//!         .with_native_roots()
122//!         .unwrap()
123//!         .https_or_http()
124//!         .enable_http2()
125//!         .build()
126//! );
127//! let mut hub = Firestore::new(client, auth);
128//! // As the method needs a request, you would usually fill it with the desired information
129//! // into the respective structure. Some of the parts shown here might not be applicable !
130//! // Values shown here are possibly random and not representative !
131//! let mut req = GoogleFirestoreAdminV1Field::default();
132//!
133//! // You can configure optional parameters by calling the respective setters at will, and
134//! // execute the final call using `doit()`.
135//! // Values shown here are possibly random and not representative !
136//! let result = hub.projects().databases_collection_groups_fields_patch(req, "name")
137//!              .update_mask(FieldMask::new::<&str>(&[]))
138//!              .doit().await;
139//!
140//! match result {
141//!     Err(e) => match e {
142//!         // The Error enum provides details about what exactly happened.
143//!         // You can also just use its `Debug`, `Display` or `Error` traits
144//!          Error::HttpError(_)
145//!         |Error::Io(_)
146//!         |Error::MissingAPIKey
147//!         |Error::MissingToken(_)
148//!         |Error::Cancelled
149//!         |Error::UploadSizeLimitExceeded(_, _)
150//!         |Error::Failure(_)
151//!         |Error::BadRequest(_)
152//!         |Error::FieldClash(_)
153//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
154//!     },
155//!     Ok(res) => println!("Success: {:?}", res),
156//! }
157//! # }
158//! ```
159//! ## Handling Errors
160//!
161//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
162//! the doit() methods, or handed as possibly intermediate results to either the
163//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
164//!
165//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
166//! makes the system potentially resilient to all kinds of errors.
167//!
168//! ## Uploads and Downloads
169//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
170//! read by you to obtain the media.
171//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
172//! 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
173//! this call: `.param("alt", "media")`.
174//!
175//! Methods supporting uploads can do so using up to 2 different protocols:
176//! *simple* and *resumable*. The distinctiveness of each is represented by customized
177//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
178//!
179//! ## Customization and Callbacks
180//!
181//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
182//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
183//! Respective methods will be called to provide progress information, as well as determine whether the system should
184//! retry on failure.
185//!
186//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
187//!
188//! ## Optional Parts in Server-Requests
189//!
190//! All structures provided by this library are made to be [encodable](common::RequestValue) and
191//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
192//! are valid.
193//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
194//! the server to indicate either the set parts of the request or the desired parts in the response.
195//!
196//! ## Builder Arguments
197//!
198//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
199//! These will always take a single argument, for which the following statements are true.
200//!
201//! * [PODs][wiki-pod] are handed by copy
202//! * strings are passed as `&str`
203//! * [request values](common::RequestValue) are moved
204//!
205//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
206//!
207//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
208//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
209//! [google-go-api]: https://github.com/google/google-api-go-client
210//!
211//! ## Cargo Features
212//!
213//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
214//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
215//! generated `openapi` spec would be invalid.
216//!
217//!
218//!
219
220// Unused attributes happen thanks to defined, but unused structures We don't
221// warn about this, as depending on the API, some data structures or facilities
222// are never used. Instead of pre-determining this, we just disable the lint.
223// It's manually tuned to not have any unused imports in fully featured APIs.
224// Same with unused_mut.
225#![allow(unused_imports, unused_mut, dead_code)]
226
227// DO NOT EDIT !
228// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
229// DO NOT EDIT !
230
231pub extern crate hyper;
232pub extern crate hyper_rustls;
233pub extern crate hyper_util;
234#[cfg(feature = "yup-oauth2")]
235pub extern crate yup_oauth2;
236
237pub extern crate google_apis_common as common;
238pub use common::{Delegate, Error, FieldMask, Result};
239
240pub mod api;
241pub use api::Firestore;