google_datastream1/
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 *Datastream* crate version *6.0.0+20240612*, where *20240612* is the exact revision of the *datastream:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v6.0.0*.
6//!
7//! Everything else about the *Datastream* *v1* API can be found at the
8//! [official documentation site](https://cloud.google.com/datastream/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/datastream1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Datastream) ...
13//!
14//! * projects
15//!  * [*locations connection profiles create*](api::ProjectLocationConnectionProfileCreateCall), [*locations connection profiles delete*](api::ProjectLocationConnectionProfileDeleteCall), [*locations connection profiles discover*](api::ProjectLocationConnectionProfileDiscoverCall), [*locations connection profiles get*](api::ProjectLocationConnectionProfileGetCall), [*locations connection profiles list*](api::ProjectLocationConnectionProfileListCall), [*locations connection profiles patch*](api::ProjectLocationConnectionProfilePatchCall), [*locations fetch static ips*](api::ProjectLocationFetchStaticIpCall), [*locations get*](api::ProjectLocationGetCall), [*locations list*](api::ProjectLocationListCall), [*locations operations cancel*](api::ProjectLocationOperationCancelCall), [*locations operations delete*](api::ProjectLocationOperationDeleteCall), [*locations operations get*](api::ProjectLocationOperationGetCall), [*locations operations list*](api::ProjectLocationOperationListCall), [*locations private connections create*](api::ProjectLocationPrivateConnectionCreateCall), [*locations private connections delete*](api::ProjectLocationPrivateConnectionDeleteCall), [*locations private connections get*](api::ProjectLocationPrivateConnectionGetCall), [*locations private connections list*](api::ProjectLocationPrivateConnectionListCall), [*locations private connections routes create*](api::ProjectLocationPrivateConnectionRouteCreateCall), [*locations private connections routes delete*](api::ProjectLocationPrivateConnectionRouteDeleteCall), [*locations private connections routes get*](api::ProjectLocationPrivateConnectionRouteGetCall), [*locations private connections routes list*](api::ProjectLocationPrivateConnectionRouteListCall), [*locations streams create*](api::ProjectLocationStreamCreateCall), [*locations streams delete*](api::ProjectLocationStreamDeleteCall), [*locations streams get*](api::ProjectLocationStreamGetCall), [*locations streams list*](api::ProjectLocationStreamListCall), [*locations streams objects get*](api::ProjectLocationStreamObjectGetCall), [*locations streams objects list*](api::ProjectLocationStreamObjectListCall), [*locations streams objects lookup*](api::ProjectLocationStreamObjectLookupCall), [*locations streams objects start backfill job*](api::ProjectLocationStreamObjectStartBackfillJobCall), [*locations streams objects stop backfill job*](api::ProjectLocationStreamObjectStopBackfillJobCall), [*locations streams patch*](api::ProjectLocationStreamPatchCall) and [*locations streams run*](api::ProjectLocationStreamRunCall)
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](Datastream)**
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().locations_connection_profiles_create(...).doit().await
51//! let r = hub.projects().locations_connection_profiles_delete(...).doit().await
52//! let r = hub.projects().locations_connection_profiles_patch(...).doit().await
53//! let r = hub.projects().locations_operations_get(...).doit().await
54//! let r = hub.projects().locations_private_connections_routes_create(...).doit().await
55//! let r = hub.projects().locations_private_connections_routes_delete(...).doit().await
56//! let r = hub.projects().locations_private_connections_create(...).doit().await
57//! let r = hub.projects().locations_private_connections_delete(...).doit().await
58//! let r = hub.projects().locations_streams_create(...).doit().await
59//! let r = hub.projects().locations_streams_delete(...).doit().await
60//! let r = hub.projects().locations_streams_patch(...).doit().await
61//! let r = hub.projects().locations_streams_run(...).doit().await
62//! ```
63//!
64//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
65//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
66//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
67//! The `doit()` method performs the actual communication with the server and returns the respective result.
68//!
69//! # Usage
70//!
71//! ## Setting up your Project
72//!
73//! To use this library, you would put the following lines into your `Cargo.toml` file:
74//!
75//! ```toml
76//! [dependencies]
77//! google-datastream1 = "*"
78//! serde = "1"
79//! serde_json = "1"
80//! ```
81//!
82//! ## A complete example
83//!
84//! ```test_harness,no_run
85//! extern crate hyper;
86//! extern crate hyper_rustls;
87//! extern crate google_datastream1 as datastream1;
88//! use datastream1::api::ConnectionProfile;
89//! use datastream1::{Result, Error};
90//! # async fn dox() {
91//! use datastream1::{Datastream, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
92//!
93//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
94//! // `client_secret`, among other things.
95//! let secret: yup_oauth2::ApplicationSecret = Default::default();
96//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
97//! // unless you replace  `None` with the desired Flow.
98//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
99//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
100//! // retrieve them from storage.
101//! let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
102//!     secret,
103//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
104//! ).build().await.unwrap();
105//!
106//! let client = hyper_util::client::legacy::Client::builder(
107//!     hyper_util::rt::TokioExecutor::new()
108//! )
109//! .build(
110//!     hyper_rustls::HttpsConnectorBuilder::new()
111//!         .with_native_roots()
112//!         .unwrap()
113//!         .https_or_http()
114//!         .enable_http1()
115//!         .build()
116//! );
117//! let mut hub = Datastream::new(client, auth);
118//! // As the method needs a request, you would usually fill it with the desired information
119//! // into the respective structure. Some of the parts shown here might not be applicable !
120//! // Values shown here are possibly random and not representative !
121//! let mut req = ConnectionProfile::default();
122//!
123//! // You can configure optional parameters by calling the respective setters at will, and
124//! // execute the final call using `doit()`.
125//! // Values shown here are possibly random and not representative !
126//! let result = hub.projects().locations_connection_profiles_create(req, "parent")
127//!              .validate_only(true)
128//!              .request_id("duo")
129//!              .force(true)
130//!              .connection_profile_id("gubergren")
131//!              .doit().await;
132//!
133//! match result {
134//!     Err(e) => match e {
135//!         // The Error enum provides details about what exactly happened.
136//!         // You can also just use its `Debug`, `Display` or `Error` traits
137//!          Error::HttpError(_)
138//!         |Error::Io(_)
139//!         |Error::MissingAPIKey
140//!         |Error::MissingToken(_)
141//!         |Error::Cancelled
142//!         |Error::UploadSizeLimitExceeded(_, _)
143//!         |Error::Failure(_)
144//!         |Error::BadRequest(_)
145//!         |Error::FieldClash(_)
146//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
147//!     },
148//!     Ok(res) => println!("Success: {:?}", res),
149//! }
150//! # }
151//! ```
152//! ## Handling Errors
153//!
154//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
155//! the doit() methods, or handed as possibly intermediate results to either the
156//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
157//!
158//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
159//! makes the system potentially resilient to all kinds of errors.
160//!
161//! ## Uploads and Downloads
162//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
163//! read by you to obtain the media.
164//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
165//! 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
166//! this call: `.param("alt", "media")`.
167//!
168//! Methods supporting uploads can do so using up to 2 different protocols:
169//! *simple* and *resumable*. The distinctiveness of each is represented by customized
170//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
171//!
172//! ## Customization and Callbacks
173//!
174//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
175//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
176//! Respective methods will be called to provide progress information, as well as determine whether the system should
177//! retry on failure.
178//!
179//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
180//!
181//! ## Optional Parts in Server-Requests
182//!
183//! All structures provided by this library are made to be [encodable](common::RequestValue) and
184//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
185//! are valid.
186//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
187//! the server to indicate either the set parts of the request or the desired parts in the response.
188//!
189//! ## Builder Arguments
190//!
191//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
192//! These will always take a single argument, for which the following statements are true.
193//!
194//! * [PODs][wiki-pod] are handed by copy
195//! * strings are passed as `&str`
196//! * [request values](common::RequestValue) are moved
197//!
198//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
199//!
200//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
201//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
202//! [google-go-api]: https://github.com/google/google-api-go-client
203//!
204//! ## Cargo Features
205//!
206//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
207//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
208//! generated `openapi` spec would be invalid.
209//!
210//!
211//!
212
213// Unused attributes happen thanks to defined, but unused structures We don't
214// warn about this, as depending on the API, some data structures or facilities
215// are never used. Instead of pre-determining this, we just disable the lint.
216// It's manually tuned to not have any unused imports in fully featured APIs.
217// Same with unused_mut.
218#![allow(unused_imports, unused_mut, dead_code)]
219
220// DO NOT EDIT !
221// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
222// DO NOT EDIT !
223
224pub extern crate hyper;
225pub extern crate hyper_rustls;
226pub extern crate hyper_util;
227#[cfg(feature = "yup-oauth2")]
228pub extern crate yup_oauth2;
229
230pub extern crate google_apis_common as common;
231pub use common::{Delegate, Error, FieldMask, Result};
232
233pub mod api;
234pub use api::Datastream;