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