google_vmmigration1/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 *VM Migration Service* crate version *7.0.0+20251204*, where *20251204* is the exact revision of the *vmmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *VM Migration Service* *v1* API can be found at the
8//! [official documentation site](https://cloud.google.com/migrate/virtual-machines).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/vmmigration1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](VMMigrationService) ...
13//!
14//! * projects
15//! * [*locations get*](api::ProjectLocationGetCall), [*locations groups add group migration*](api::ProjectLocationGroupAddGroupMigrationCall), [*locations groups create*](api::ProjectLocationGroupCreateCall), [*locations groups delete*](api::ProjectLocationGroupDeleteCall), [*locations groups get*](api::ProjectLocationGroupGetCall), [*locations groups list*](api::ProjectLocationGroupListCall), [*locations groups patch*](api::ProjectLocationGroupPatchCall), [*locations groups remove group migration*](api::ProjectLocationGroupRemoveGroupMigrationCall), [*locations image imports create*](api::ProjectLocationImageImportCreateCall), [*locations image imports delete*](api::ProjectLocationImageImportDeleteCall), [*locations image imports get*](api::ProjectLocationImageImportGetCall), [*locations image imports image import jobs cancel*](api::ProjectLocationImageImportImageImportJobCancelCall), [*locations image imports image import jobs get*](api::ProjectLocationImageImportImageImportJobGetCall), [*locations image imports image import jobs list*](api::ProjectLocationImageImportImageImportJobListCall), [*locations image imports list*](api::ProjectLocationImageImportListCall), [*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 sources create*](api::ProjectLocationSourceCreateCall), [*locations sources datacenter connectors create*](api::ProjectLocationSourceDatacenterConnectorCreateCall), [*locations sources datacenter connectors delete*](api::ProjectLocationSourceDatacenterConnectorDeleteCall), [*locations sources datacenter connectors get*](api::ProjectLocationSourceDatacenterConnectorGetCall), [*locations sources datacenter connectors list*](api::ProjectLocationSourceDatacenterConnectorListCall), [*locations sources datacenter connectors upgrade appliance*](api::ProjectLocationSourceDatacenterConnectorUpgradeApplianceCall), [*locations sources delete*](api::ProjectLocationSourceDeleteCall), [*locations sources disk migration jobs cancel*](api::ProjectLocationSourceDiskMigrationJobCancelCall), [*locations sources disk migration jobs create*](api::ProjectLocationSourceDiskMigrationJobCreateCall), [*locations sources disk migration jobs delete*](api::ProjectLocationSourceDiskMigrationJobDeleteCall), [*locations sources disk migration jobs get*](api::ProjectLocationSourceDiskMigrationJobGetCall), [*locations sources disk migration jobs list*](api::ProjectLocationSourceDiskMigrationJobListCall), [*locations sources disk migration jobs patch*](api::ProjectLocationSourceDiskMigrationJobPatchCall), [*locations sources disk migration jobs run*](api::ProjectLocationSourceDiskMigrationJobRunCall), [*locations sources fetch inventory*](api::ProjectLocationSourceFetchInventoryCall), [*locations sources fetch storage inventory*](api::ProjectLocationSourceFetchStorageInventoryCall), [*locations sources get*](api::ProjectLocationSourceGetCall), [*locations sources list*](api::ProjectLocationSourceListCall), [*locations sources migrating vms clone jobs cancel*](api::ProjectLocationSourceMigratingVmCloneJobCancelCall), [*locations sources migrating vms clone jobs create*](api::ProjectLocationSourceMigratingVmCloneJobCreateCall), [*locations sources migrating vms clone jobs get*](api::ProjectLocationSourceMigratingVmCloneJobGetCall), [*locations sources migrating vms clone jobs list*](api::ProjectLocationSourceMigratingVmCloneJobListCall), [*locations sources migrating vms create*](api::ProjectLocationSourceMigratingVmCreateCall), [*locations sources migrating vms cutover jobs cancel*](api::ProjectLocationSourceMigratingVmCutoverJobCancelCall), [*locations sources migrating vms cutover jobs create*](api::ProjectLocationSourceMigratingVmCutoverJobCreateCall), [*locations sources migrating vms cutover jobs get*](api::ProjectLocationSourceMigratingVmCutoverJobGetCall), [*locations sources migrating vms cutover jobs list*](api::ProjectLocationSourceMigratingVmCutoverJobListCall), [*locations sources migrating vms delete*](api::ProjectLocationSourceMigratingVmDeleteCall), [*locations sources migrating vms extend migration*](api::ProjectLocationSourceMigratingVmExtendMigrationCall), [*locations sources migrating vms finalize migration*](api::ProjectLocationSourceMigratingVmFinalizeMigrationCall), [*locations sources migrating vms get*](api::ProjectLocationSourceMigratingVmGetCall), [*locations sources migrating vms list*](api::ProjectLocationSourceMigratingVmListCall), [*locations sources migrating vms patch*](api::ProjectLocationSourceMigratingVmPatchCall), [*locations sources migrating vms pause migration*](api::ProjectLocationSourceMigratingVmPauseMigrationCall), [*locations sources migrating vms replication cycles get*](api::ProjectLocationSourceMigratingVmReplicationCycleGetCall), [*locations sources migrating vms replication cycles list*](api::ProjectLocationSourceMigratingVmReplicationCycleListCall), [*locations sources migrating vms resume migration*](api::ProjectLocationSourceMigratingVmResumeMigrationCall), [*locations sources migrating vms start migration*](api::ProjectLocationSourceMigratingVmStartMigrationCall), [*locations sources patch*](api::ProjectLocationSourcePatchCall), [*locations sources utilization reports create*](api::ProjectLocationSourceUtilizationReportCreateCall), [*locations sources utilization reports delete*](api::ProjectLocationSourceUtilizationReportDeleteCall), [*locations sources utilization reports get*](api::ProjectLocationSourceUtilizationReportGetCall), [*locations sources utilization reports list*](api::ProjectLocationSourceUtilizationReportListCall), [*locations target projects create*](api::ProjectLocationTargetProjectCreateCall), [*locations target projects delete*](api::ProjectLocationTargetProjectDeleteCall), [*locations target projects get*](api::ProjectLocationTargetProjectGetCall), [*locations target projects list*](api::ProjectLocationTargetProjectListCall) and [*locations target projects patch*](api::ProjectLocationTargetProjectPatchCall)
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](VMMigrationService)**
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_groups_add_group_migration(...).doit().await
51//! let r = hub.projects().locations_groups_create(...).doit().await
52//! let r = hub.projects().locations_groups_delete(...).doit().await
53//! let r = hub.projects().locations_groups_patch(...).doit().await
54//! let r = hub.projects().locations_groups_remove_group_migration(...).doit().await
55//! let r = hub.projects().locations_image_imports_image_import_jobs_cancel(...).doit().await
56//! let r = hub.projects().locations_image_imports_create(...).doit().await
57//! let r = hub.projects().locations_image_imports_delete(...).doit().await
58//! let r = hub.projects().locations_operations_get(...).doit().await
59//! let r = hub.projects().locations_sources_datacenter_connectors_create(...).doit().await
60//! let r = hub.projects().locations_sources_datacenter_connectors_delete(...).doit().await
61//! let r = hub.projects().locations_sources_datacenter_connectors_upgrade_appliance(...).doit().await
62//! let r = hub.projects().locations_sources_disk_migration_jobs_cancel(...).doit().await
63//! let r = hub.projects().locations_sources_disk_migration_jobs_create(...).doit().await
64//! let r = hub.projects().locations_sources_disk_migration_jobs_delete(...).doit().await
65//! let r = hub.projects().locations_sources_disk_migration_jobs_patch(...).doit().await
66//! let r = hub.projects().locations_sources_disk_migration_jobs_run(...).doit().await
67//! let r = hub.projects().locations_sources_migrating_vms_clone_jobs_cancel(...).doit().await
68//! let r = hub.projects().locations_sources_migrating_vms_clone_jobs_create(...).doit().await
69//! let r = hub.projects().locations_sources_migrating_vms_cutover_jobs_cancel(...).doit().await
70//! let r = hub.projects().locations_sources_migrating_vms_cutover_jobs_create(...).doit().await
71//! let r = hub.projects().locations_sources_migrating_vms_create(...).doit().await
72//! let r = hub.projects().locations_sources_migrating_vms_delete(...).doit().await
73//! let r = hub.projects().locations_sources_migrating_vms_extend_migration(...).doit().await
74//! let r = hub.projects().locations_sources_migrating_vms_finalize_migration(...).doit().await
75//! let r = hub.projects().locations_sources_migrating_vms_patch(...).doit().await
76//! let r = hub.projects().locations_sources_migrating_vms_pause_migration(...).doit().await
77//! let r = hub.projects().locations_sources_migrating_vms_resume_migration(...).doit().await
78//! let r = hub.projects().locations_sources_migrating_vms_start_migration(...).doit().await
79//! let r = hub.projects().locations_sources_utilization_reports_create(...).doit().await
80//! let r = hub.projects().locations_sources_utilization_reports_delete(...).doit().await
81//! let r = hub.projects().locations_sources_create(...).doit().await
82//! let r = hub.projects().locations_sources_delete(...).doit().await
83//! let r = hub.projects().locations_sources_patch(...).doit().await
84//! let r = hub.projects().locations_target_projects_create(...).doit().await
85//! let r = hub.projects().locations_target_projects_delete(...).doit().await
86//! let r = hub.projects().locations_target_projects_patch(...).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-vmmigration1 = "*"
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_vmmigration1 as vmmigration1;
113//! use vmmigration1::api::Group;
114//! use vmmigration1::{Result, Error};
115//! # async fn dox() {
116//! use vmmigration1::{VMMigrationService, 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 connector = hyper_rustls::HttpsConnectorBuilder::new()
127//! .with_native_roots()
128//! .unwrap()
129//! .https_only()
130//! .enable_http2()
131//! .build();
132//!
133//! let executor = hyper_util::rt::TokioExecutor::new();
134//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
135//! secret,
136//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
137//! yup_oauth2::client::CustomHyperClientBuilder::from(
138//! hyper_util::client::legacy::Client::builder(executor).build(connector),
139//! ),
140//! ).build().await.unwrap();
141//!
142//! let client = hyper_util::client::legacy::Client::builder(
143//! hyper_util::rt::TokioExecutor::new()
144//! )
145//! .build(
146//! hyper_rustls::HttpsConnectorBuilder::new()
147//! .with_native_roots()
148//! .unwrap()
149//! .https_or_http()
150//! .enable_http2()
151//! .build()
152//! );
153//! let mut hub = VMMigrationService::new(client, auth);
154//! // As the method needs a request, you would usually fill it with the desired information
155//! // into the respective structure. Some of the parts shown here might not be applicable !
156//! // Values shown here are possibly random and not representative !
157//! let mut req = Group::default();
158//!
159//! // You can configure optional parameters by calling the respective setters at will, and
160//! // execute the final call using `doit()`.
161//! // Values shown here are possibly random and not representative !
162//! let result = hub.projects().locations_groups_create(req, "parent")
163//! .request_id("voluptua.")
164//! .group_id("At")
165//! .doit().await;
166//!
167//! match result {
168//! Err(e) => match e {
169//! // The Error enum provides details about what exactly happened.
170//! // You can also just use its `Debug`, `Display` or `Error` traits
171//! Error::HttpError(_)
172//! |Error::Io(_)
173//! |Error::MissingAPIKey
174//! |Error::MissingToken(_)
175//! |Error::Cancelled
176//! |Error::UploadSizeLimitExceeded(_, _)
177//! |Error::Failure(_)
178//! |Error::BadRequest(_)
179//! |Error::FieldClash(_)
180//! |Error::JsonDecodeError(_, _) => println!("{}", e),
181//! },
182//! Ok(res) => println!("Success: {:?}", res),
183//! }
184//! # }
185//! ```
186//! ## Handling Errors
187//!
188//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
189//! the doit() methods, or handed as possibly intermediate results to either the
190//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
191//!
192//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
193//! makes the system potentially resilient to all kinds of errors.
194//!
195//! ## Uploads and Downloads
196//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
197//! read by you to obtain the media.
198//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
199//! 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
200//! this call: `.param("alt", "media")`.
201//!
202//! Methods supporting uploads can do so using up to 2 different protocols:
203//! *simple* and *resumable*. The distinctiveness of each is represented by customized
204//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
205//!
206//! ## Customization and Callbacks
207//!
208//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
209//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
210//! Respective methods will be called to provide progress information, as well as determine whether the system should
211//! retry on failure.
212//!
213//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
214//!
215//! ## Optional Parts in Server-Requests
216//!
217//! All structures provided by this library are made to be [encodable](common::RequestValue) and
218//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
219//! are valid.
220//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
221//! the server to indicate either the set parts of the request or the desired parts in the response.
222//!
223//! ## Builder Arguments
224//!
225//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
226//! These will always take a single argument, for which the following statements are true.
227//!
228//! * [PODs][wiki-pod] are handed by copy
229//! * strings are passed as `&str`
230//! * [request values](common::RequestValue) are moved
231//!
232//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
233//!
234//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
235//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
236//! [google-go-api]: https://github.com/google/google-api-go-client
237//!
238//! ## Cargo Features
239//!
240//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
241//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
242//! generated `openapi` spec would be invalid.
243//!
244//!
245//!
246
247// Unused attributes happen thanks to defined, but unused structures We don't
248// warn about this, as depending on the API, some data structures or facilities
249// are never used. Instead of pre-determining this, we just disable the lint.
250// It's manually tuned to not have any unused imports in fully featured APIs.
251// Same with unused_mut.
252#![allow(unused_imports, unused_mut, dead_code)]
253
254// DO NOT EDIT !
255// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
256// DO NOT EDIT !
257
258pub extern crate hyper;
259pub extern crate hyper_rustls;
260pub extern crate hyper_util;
261#[cfg(feature = "yup-oauth2")]
262pub extern crate yup_oauth2;
263
264pub extern crate google_apis_common as common;
265pub use common::{Delegate, Error, FieldMask, Result};
266
267pub mod api;
268pub use api::VMMigrationService;