google_notebooks1/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 *AI Platform Notebooks* crate version *6.0.0+20240613*, where *20240613* is the exact revision of the *notebooks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v6.0.0*.
6//!
7//! Everything else about the *AI Platform Notebooks* *v1* API can be found at the
8//! [official documentation site](https://cloud.google.com/notebooks/docs/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/notebooks1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](AIPlatformNotebooks) ...
13//!
14//! * projects
15//! * [*locations environments create*](api::ProjectLocationEnvironmentCreateCall), [*locations environments delete*](api::ProjectLocationEnvironmentDeleteCall), [*locations environments get*](api::ProjectLocationEnvironmentGetCall), [*locations environments list*](api::ProjectLocationEnvironmentListCall), [*locations executions create*](api::ProjectLocationExecutionCreateCall), [*locations executions delete*](api::ProjectLocationExecutionDeleteCall), [*locations executions get*](api::ProjectLocationExecutionGetCall), [*locations executions list*](api::ProjectLocationExecutionListCall), [*locations get*](api::ProjectLocationGetCall), [*locations instances create*](api::ProjectLocationInstanceCreateCall), [*locations instances delete*](api::ProjectLocationInstanceDeleteCall), [*locations instances diagnose*](api::ProjectLocationInstanceDiagnoseCall), [*locations instances get*](api::ProjectLocationInstanceGetCall), [*locations instances get iam policy*](api::ProjectLocationInstanceGetIamPolicyCall), [*locations instances get instance health*](api::ProjectLocationInstanceGetInstanceHealthCall), [*locations instances is upgradeable*](api::ProjectLocationInstanceIsUpgradeableCall), [*locations instances list*](api::ProjectLocationInstanceListCall), [*locations instances migrate*](api::ProjectLocationInstanceMigrateCall), [*locations instances register*](api::ProjectLocationInstanceRegisterCall), [*locations instances report*](api::ProjectLocationInstanceReportCall), [*locations instances report event*](api::ProjectLocationInstanceReportEventCall), [*locations instances reset*](api::ProjectLocationInstanceResetCall), [*locations instances rollback*](api::ProjectLocationInstanceRollbackCall), [*locations instances set accelerator*](api::ProjectLocationInstanceSetAcceleratorCall), [*locations instances set iam policy*](api::ProjectLocationInstanceSetIamPolicyCall), [*locations instances set labels*](api::ProjectLocationInstanceSetLabelCall), [*locations instances set machine type*](api::ProjectLocationInstanceSetMachineTypeCall), [*locations instances start*](api::ProjectLocationInstanceStartCall), [*locations instances stop*](api::ProjectLocationInstanceStopCall), [*locations instances test iam permissions*](api::ProjectLocationInstanceTestIamPermissionCall), [*locations instances update config*](api::ProjectLocationInstanceUpdateConfigCall), [*locations instances update metadata items*](api::ProjectLocationInstanceUpdateMetadataItemCall), [*locations instances update shielded instance config*](api::ProjectLocationInstanceUpdateShieldedInstanceConfigCall), [*locations instances upgrade*](api::ProjectLocationInstanceUpgradeCall), [*locations instances upgrade internal*](api::ProjectLocationInstanceUpgradeInternalCall), [*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 runtimes create*](api::ProjectLocationRuntimeCreateCall), [*locations runtimes delete*](api::ProjectLocationRuntimeDeleteCall), [*locations runtimes diagnose*](api::ProjectLocationRuntimeDiagnoseCall), [*locations runtimes get*](api::ProjectLocationRuntimeGetCall), [*locations runtimes get iam policy*](api::ProjectLocationRuntimeGetIamPolicyCall), [*locations runtimes list*](api::ProjectLocationRuntimeListCall), [*locations runtimes migrate*](api::ProjectLocationRuntimeMigrateCall), [*locations runtimes patch*](api::ProjectLocationRuntimePatchCall), [*locations runtimes refresh runtime token internal*](api::ProjectLocationRuntimeRefreshRuntimeTokenInternalCall), [*locations runtimes report event*](api::ProjectLocationRuntimeReportEventCall), [*locations runtimes reset*](api::ProjectLocationRuntimeResetCall), [*locations runtimes set iam policy*](api::ProjectLocationRuntimeSetIamPolicyCall), [*locations runtimes start*](api::ProjectLocationRuntimeStartCall), [*locations runtimes stop*](api::ProjectLocationRuntimeStopCall), [*locations runtimes switch*](api::ProjectLocationRuntimeSwitchCall), [*locations runtimes test iam permissions*](api::ProjectLocationRuntimeTestIamPermissionCall), [*locations runtimes upgrade*](api::ProjectLocationRuntimeUpgradeCall), [*locations schedules create*](api::ProjectLocationScheduleCreateCall), [*locations schedules delete*](api::ProjectLocationScheduleDeleteCall), [*locations schedules get*](api::ProjectLocationScheduleGetCall), [*locations schedules list*](api::ProjectLocationScheduleListCall) and [*locations schedules trigger*](api::ProjectLocationScheduleTriggerCall)
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](AIPlatformNotebooks)**
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_environments_create(...).doit().await
51//! let r = hub.projects().locations_environments_delete(...).doit().await
52//! let r = hub.projects().locations_executions_create(...).doit().await
53//! let r = hub.projects().locations_executions_delete(...).doit().await
54//! let r = hub.projects().locations_instances_create(...).doit().await
55//! let r = hub.projects().locations_instances_delete(...).doit().await
56//! let r = hub.projects().locations_instances_diagnose(...).doit().await
57//! let r = hub.projects().locations_instances_migrate(...).doit().await
58//! let r = hub.projects().locations_instances_register(...).doit().await
59//! let r = hub.projects().locations_instances_report(...).doit().await
60//! let r = hub.projects().locations_instances_report_event(...).doit().await
61//! let r = hub.projects().locations_instances_reset(...).doit().await
62//! let r = hub.projects().locations_instances_rollback(...).doit().await
63//! let r = hub.projects().locations_instances_set_accelerator(...).doit().await
64//! let r = hub.projects().locations_instances_set_labels(...).doit().await
65//! let r = hub.projects().locations_instances_set_machine_type(...).doit().await
66//! let r = hub.projects().locations_instances_start(...).doit().await
67//! let r = hub.projects().locations_instances_stop(...).doit().await
68//! let r = hub.projects().locations_instances_update_config(...).doit().await
69//! let r = hub.projects().locations_instances_update_shielded_instance_config(...).doit().await
70//! let r = hub.projects().locations_instances_upgrade(...).doit().await
71//! let r = hub.projects().locations_instances_upgrade_internal(...).doit().await
72//! let r = hub.projects().locations_operations_get(...).doit().await
73//! let r = hub.projects().locations_runtimes_create(...).doit().await
74//! let r = hub.projects().locations_runtimes_delete(...).doit().await
75//! let r = hub.projects().locations_runtimes_diagnose(...).doit().await
76//! let r = hub.projects().locations_runtimes_migrate(...).doit().await
77//! let r = hub.projects().locations_runtimes_patch(...).doit().await
78//! let r = hub.projects().locations_runtimes_report_event(...).doit().await
79//! let r = hub.projects().locations_runtimes_reset(...).doit().await
80//! let r = hub.projects().locations_runtimes_start(...).doit().await
81//! let r = hub.projects().locations_runtimes_stop(...).doit().await
82//! let r = hub.projects().locations_runtimes_switch(...).doit().await
83//! let r = hub.projects().locations_runtimes_upgrade(...).doit().await
84//! let r = hub.projects().locations_schedules_create(...).doit().await
85//! let r = hub.projects().locations_schedules_delete(...).doit().await
86//! let r = hub.projects().locations_schedules_trigger(...).doit().await
87//! ```
88//!
89//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
90//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
91//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
92//! The `doit()` method performs the actual communication with the server and returns the respective result.
93//!
94//! # Usage
95//!
96//! ## Setting up your Project
97//!
98//! To use this library, you would put the following lines into your `Cargo.toml` file:
99//!
100//! ```toml
101//! [dependencies]
102//! google-notebooks1 = "*"
103//! serde = "1"
104//! serde_json = "1"
105//! ```
106//!
107//! ## A complete example
108//!
109//! ```test_harness,no_run
110//! extern crate hyper;
111//! extern crate hyper_rustls;
112//! extern crate google_notebooks1 as notebooks1;
113//! use notebooks1::api::Runtime;
114//! use notebooks1::{Result, Error};
115//! # async fn dox() {
116//! use notebooks1::{AIPlatformNotebooks, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
117//!
118//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
119//! // `client_secret`, among other things.
120//! let secret: yup_oauth2::ApplicationSecret = Default::default();
121//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
122//! // unless you replace `None` with the desired Flow.
123//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
124//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
125//! // retrieve them from storage.
126//! let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
127//! secret,
128//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
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_http1()
140//! .build()
141//! );
142//! let mut hub = AIPlatformNotebooks::new(client, auth);
143//! // As the method needs a request, you would usually fill it with the desired information
144//! // into the respective structure. Some of the parts shown here might not be applicable !
145//! // Values shown here are possibly random and not representative !
146//! let mut req = Runtime::default();
147//!
148//! // You can configure optional parameters by calling the respective setters at will, and
149//! // execute the final call using `doit()`.
150//! // Values shown here are possibly random and not representative !
151//! let result = hub.projects().locations_runtimes_create(req, "parent")
152//! .runtime_id("voluptua.")
153//! .request_id("At")
154//! .doit().await;
155//!
156//! match result {
157//! Err(e) => match e {
158//! // The Error enum provides details about what exactly happened.
159//! // You can also just use its `Debug`, `Display` or `Error` traits
160//! Error::HttpError(_)
161//! |Error::Io(_)
162//! |Error::MissingAPIKey
163//! |Error::MissingToken(_)
164//! |Error::Cancelled
165//! |Error::UploadSizeLimitExceeded(_, _)
166//! |Error::Failure(_)
167//! |Error::BadRequest(_)
168//! |Error::FieldClash(_)
169//! |Error::JsonDecodeError(_, _) => println!("{}", e),
170//! },
171//! Ok(res) => println!("Success: {:?}", res),
172//! }
173//! # }
174//! ```
175//! ## Handling Errors
176//!
177//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
178//! the doit() methods, or handed as possibly intermediate results to either the
179//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
180//!
181//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
182//! makes the system potentially resilient to all kinds of errors.
183//!
184//! ## Uploads and Downloads
185//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
186//! read by you to obtain the media.
187//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
188//! 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
189//! this call: `.param("alt", "media")`.
190//!
191//! Methods supporting uploads can do so using up to 2 different protocols:
192//! *simple* and *resumable*. The distinctiveness of each is represented by customized
193//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
194//!
195//! ## Customization and Callbacks
196//!
197//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
198//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
199//! Respective methods will be called to provide progress information, as well as determine whether the system should
200//! retry on failure.
201//!
202//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
203//!
204//! ## Optional Parts in Server-Requests
205//!
206//! All structures provided by this library are made to be [encodable](common::RequestValue) and
207//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
208//! are valid.
209//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
210//! the server to indicate either the set parts of the request or the desired parts in the response.
211//!
212//! ## Builder Arguments
213//!
214//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
215//! These will always take a single argument, for which the following statements are true.
216//!
217//! * [PODs][wiki-pod] are handed by copy
218//! * strings are passed as `&str`
219//! * [request values](common::RequestValue) are moved
220//!
221//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
222//!
223//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
224//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
225//! [google-go-api]: https://github.com/google/google-api-go-client
226//!
227//! ## Cargo Features
228//!
229//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
230//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
231//! generated `openapi` spec would be invalid.
232//!
233//!
234//!
235
236// Unused attributes happen thanks to defined, but unused structures We don't
237// warn about this, as depending on the API, some data structures or facilities
238// are never used. Instead of pre-determining this, we just disable the lint.
239// It's manually tuned to not have any unused imports in fully featured APIs.
240// Same with unused_mut.
241#![allow(unused_imports, unused_mut, dead_code)]
242
243// DO NOT EDIT !
244// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
245// DO NOT EDIT !
246
247pub extern crate hyper;
248pub extern crate hyper_rustls;
249pub extern crate hyper_util;
250#[cfg(feature = "yup-oauth2")]
251pub extern crate yup_oauth2;
252
253pub extern crate google_apis_common as common;
254pub use common::{Delegate, Error, FieldMask, Result};
255
256pub mod api;
257pub use api::AIPlatformNotebooks;