google_androidmanagement1/
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 *Android Management* crate version *7.0.0+20251216*, where *20251216* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Android Management* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/android/management).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/androidmanagement1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](AndroidManagement) ...
13//!
14//! * [enterprises](api::Enterprise)
15//!  * [*applications get*](api::EnterpriseApplicationGetCall), [*create*](api::EnterpriseCreateCall), [*delete*](api::EnterpriseDeleteCall), [*devices delete*](api::EnterpriseDeviceDeleteCall), [*devices get*](api::EnterpriseDeviceGetCall), [*devices issue command*](api::EnterpriseDeviceIssueCommandCall), [*devices list*](api::EnterpriseDeviceListCall), [*devices operations cancel*](api::EnterpriseDeviceOperationCancelCall), [*devices operations get*](api::EnterpriseDeviceOperationGetCall), [*devices operations list*](api::EnterpriseDeviceOperationListCall), [*devices patch*](api::EnterpriseDevicePatchCall), [*enrollment tokens create*](api::EnterpriseEnrollmentTokenCreateCall), [*enrollment tokens delete*](api::EnterpriseEnrollmentTokenDeleteCall), [*enrollment tokens get*](api::EnterpriseEnrollmentTokenGetCall), [*enrollment tokens list*](api::EnterpriseEnrollmentTokenListCall), [*generate enterprise upgrade url*](api::EnterpriseGenerateEnterpriseUpgradeUrlCall), [*get*](api::EnterpriseGetCall), [*list*](api::EnterpriseListCall), [*migration tokens create*](api::EnterpriseMigrationTokenCreateCall), [*migration tokens get*](api::EnterpriseMigrationTokenGetCall), [*migration tokens list*](api::EnterpriseMigrationTokenListCall), [*patch*](api::EnterprisePatchCall), [*policies delete*](api::EnterprisePolicyDeleteCall), [*policies get*](api::EnterprisePolicyGetCall), [*policies list*](api::EnterprisePolicyListCall), [*policies modify policy applications*](api::EnterprisePolicyModifyPolicyApplicationCall), [*policies patch*](api::EnterprisePolicyPatchCall), [*policies remove policy applications*](api::EnterprisePolicyRemovePolicyApplicationCall), [*web apps create*](api::EnterpriseWebAppCreateCall), [*web apps delete*](api::EnterpriseWebAppDeleteCall), [*web apps get*](api::EnterpriseWebAppGetCall), [*web apps list*](api::EnterpriseWebAppListCall), [*web apps patch*](api::EnterpriseWebAppPatchCall) and [*web tokens create*](api::EnterpriseWebTokenCreateCall)
16//! * [provisioning info](api::ProvisioningInfo)
17//!  * [*get*](api::ProvisioningInfoGetCall)
18//! * [signup urls](api::SignupUrl)
19//!  * [*create*](api::SignupUrlCreateCall)
20//!
21//!
22//!
23//!
24//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
25//!
26//! # Structure of this Library
27//!
28//! The API is structured into the following primary items:
29//!
30//! * **[Hub](AndroidManagement)**
31//!     * a central object to maintain state and allow accessing all *Activities*
32//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
33//!       allow access to individual [*Call Builders*](common::CallBuilder)
34//! * **[Resources](common::Resource)**
35//!     * primary types that you can apply *Activities* to
36//!     * a collection of properties and *Parts*
37//!     * **[Parts](common::Part)**
38//!         * a collection of properties
39//!         * never directly used in *Activities*
40//! * **[Activities](common::CallBuilder)**
41//!     * operations to apply to *Resources*
42//!
43//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
44//!
45//! Generally speaking, you can invoke *Activities* like this:
46//!
47//! ```Rust,ignore
48//! let r = hub.resource().activity(...).doit().await
49//! ```
50//!
51//! Or specifically ...
52//!
53//! ```ignore
54//! let r = hub.enterprises().applications_get(...).doit().await
55//! let r = hub.enterprises().devices_operations_cancel(...).doit().await
56//! let r = hub.enterprises().devices_operations_get(...).doit().await
57//! let r = hub.enterprises().devices_operations_list(...).doit().await
58//! let r = hub.enterprises().devices_delete(...).doit().await
59//! let r = hub.enterprises().devices_get(...).doit().await
60//! let r = hub.enterprises().devices_issue_command(...).doit().await
61//! let r = hub.enterprises().devices_list(...).doit().await
62//! let r = hub.enterprises().devices_patch(...).doit().await
63//! let r = hub.enterprises().enrollment_tokens_create(...).doit().await
64//! let r = hub.enterprises().enrollment_tokens_delete(...).doit().await
65//! let r = hub.enterprises().enrollment_tokens_get(...).doit().await
66//! let r = hub.enterprises().enrollment_tokens_list(...).doit().await
67//! let r = hub.enterprises().migration_tokens_create(...).doit().await
68//! let r = hub.enterprises().migration_tokens_get(...).doit().await
69//! let r = hub.enterprises().migration_tokens_list(...).doit().await
70//! let r = hub.enterprises().policies_delete(...).doit().await
71//! let r = hub.enterprises().policies_get(...).doit().await
72//! let r = hub.enterprises().policies_list(...).doit().await
73//! let r = hub.enterprises().policies_modify_policy_applications(...).doit().await
74//! let r = hub.enterprises().policies_patch(...).doit().await
75//! let r = hub.enterprises().policies_remove_policy_applications(...).doit().await
76//! let r = hub.enterprises().web_apps_create(...).doit().await
77//! let r = hub.enterprises().web_apps_delete(...).doit().await
78//! let r = hub.enterprises().web_apps_get(...).doit().await
79//! let r = hub.enterprises().web_apps_list(...).doit().await
80//! let r = hub.enterprises().web_apps_patch(...).doit().await
81//! let r = hub.enterprises().web_tokens_create(...).doit().await
82//! let r = hub.enterprises().create(...).doit().await
83//! let r = hub.enterprises().delete(...).doit().await
84//! let r = hub.enterprises().generate_enterprise_upgrade_url(...).doit().await
85//! let r = hub.enterprises().get(...).doit().await
86//! let r = hub.enterprises().list(...).doit().await
87//! let r = hub.enterprises().patch(...).doit().await
88//! ```
89//!
90//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
91//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
92//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
93//! The `doit()` method performs the actual communication with the server and returns the respective result.
94//!
95//! # Usage
96//!
97//! ## Setting up your Project
98//!
99//! To use this library, you would put the following lines into your `Cargo.toml` file:
100//!
101//! ```toml
102//! [dependencies]
103//! google-androidmanagement1 = "*"
104//! serde = "1"
105//! serde_json = "1"
106//! ```
107//!
108//! ## A complete example
109//!
110//! ```test_harness,no_run
111//! extern crate hyper;
112//! extern crate hyper_rustls;
113//! extern crate google_androidmanagement1 as androidmanagement1;
114//! use androidmanagement1::{Result, Error};
115//! # async fn dox() {
116//! use androidmanagement1::{AndroidManagement, 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 = AndroidManagement::new(client, auth);
154//! // You can configure optional parameters by calling the respective setters at will, and
155//! // execute the final call using `doit()`.
156//! // Values shown here are possibly random and not representative !
157//! let result = hub.enterprises().devices_operations_list("name")
158//!              .return_partial_success(true)
159//!              .page_token("amet.")
160//!              .page_size(-20)
161//!              .filter("ipsum")
162//!              .doit().await;
163//!
164//! match result {
165//!     Err(e) => match e {
166//!         // The Error enum provides details about what exactly happened.
167//!         // You can also just use its `Debug`, `Display` or `Error` traits
168//!          Error::HttpError(_)
169//!         |Error::Io(_)
170//!         |Error::MissingAPIKey
171//!         |Error::MissingToken(_)
172//!         |Error::Cancelled
173//!         |Error::UploadSizeLimitExceeded(_, _)
174//!         |Error::Failure(_)
175//!         |Error::BadRequest(_)
176//!         |Error::FieldClash(_)
177//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
178//!     },
179//!     Ok(res) => println!("Success: {:?}", res),
180//! }
181//! # }
182//! ```
183//! ## Handling Errors
184//!
185//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
186//! the doit() methods, or handed as possibly intermediate results to either the
187//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
188//!
189//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
190//! makes the system potentially resilient to all kinds of errors.
191//!
192//! ## Uploads and Downloads
193//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
194//! read by you to obtain the media.
195//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
196//! 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
197//! this call: `.param("alt", "media")`.
198//!
199//! Methods supporting uploads can do so using up to 2 different protocols:
200//! *simple* and *resumable*. The distinctiveness of each is represented by customized
201//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
202//!
203//! ## Customization and Callbacks
204//!
205//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
206//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
207//! Respective methods will be called to provide progress information, as well as determine whether the system should
208//! retry on failure.
209//!
210//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
211//!
212//! ## Optional Parts in Server-Requests
213//!
214//! All structures provided by this library are made to be [encodable](common::RequestValue) and
215//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
216//! are valid.
217//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
218//! the server to indicate either the set parts of the request or the desired parts in the response.
219//!
220//! ## Builder Arguments
221//!
222//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
223//! These will always take a single argument, for which the following statements are true.
224//!
225//! * [PODs][wiki-pod] are handed by copy
226//! * strings are passed as `&str`
227//! * [request values](common::RequestValue) are moved
228//!
229//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
230//!
231//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
232//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
233//! [google-go-api]: https://github.com/google/google-api-go-client
234//!
235//! ## Cargo Features
236//!
237//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
238//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
239//! generated `openapi` spec would be invalid.
240//!
241//!
242//!
243
244// Unused attributes happen thanks to defined, but unused structures We don't
245// warn about this, as depending on the API, some data structures or facilities
246// are never used. Instead of pre-determining this, we just disable the lint.
247// It's manually tuned to not have any unused imports in fully featured APIs.
248// Same with unused_mut.
249#![allow(unused_imports, unused_mut, dead_code)]
250
251// DO NOT EDIT !
252// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
253// DO NOT EDIT !
254
255pub extern crate hyper;
256pub extern crate hyper_rustls;
257pub extern crate hyper_util;
258#[cfg(feature = "yup-oauth2")]
259pub extern crate yup_oauth2;
260
261pub extern crate google_apis_common as common;
262pub use common::{Delegate, Error, FieldMask, Result};
263
264pub mod api;
265pub use api::AndroidManagement;